Skip to content

Commit 9a4a109

Browse files
Addressed jackson's PR reviews
1 parent e080bca commit 9a4a109

File tree

6 files changed

+13
-14
lines changed

6 files changed

+13
-14
lines changed

frontend/packages/console-dynamic-plugin-sdk/src/extensions/console-types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ export type ResourceEventStreamProps = {
697697
};
698698

699699
export type TimestampProps = {
700-
timestamp: string | number | Date;
700+
timestamp: string | number | Date | null;
701701
simple?: boolean;
702702
omitSuffix?: boolean;
703703
className?: string;

frontend/packages/helm-plugin/src/components/details-page/resources/HelmReleaseResourcesRow.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const HelmReleaseResourcesRow: React.FC<RowFunctionArgs<K8sResourceKind>> = ({ o
4646
<HelmReleaseResourceStatus resource={resource} />
4747
</TableData>
4848
<TableData className={tableColumnClasses.created}>
49-
<Timestamp timestamp={resource.metadata?.creationTimestamp || ''} />
49+
<Timestamp timestamp={resource.metadata?.creationTimestamp ?? null} />
5050
</TableData>
5151
</>
5252
);

frontend/packages/helm-plugin/src/components/forms/install-upgrade/HelmChartVersionDropdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import {
3333
export type HelmChartVersionDropdownProps = {
3434
chartVersion: string;
3535
chartName: string;
36-
helmAction: string;
36+
helmAction: string | undefined;
3737
onVersionChange: (chart: HelmChart) => void;
3838
namespace: string;
3939
chartIndexEntry: string;

frontend/packages/helm-plugin/src/components/forms/install-upgrade/HelmInstallUpgradeForm.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ export type HelmInstallUpgradeFormData = {
4040

4141
export interface HelmInstallUpgradeFormProps {
4242
chartHasValues: boolean;
43-
helmActionConfig: HelmActionConfigType;
43+
helmActionConfig: HelmActionConfigType | undefined;
4444
chartMetaDescription: React.ReactNode;
4545
onVersionChange: (chart: HelmChart) => void;
46-
chartError: Error;
46+
chartError: Error | null;
4747
namespace: string;
4848
chartIndexEntry?: string;
4949
annotatedName?: string;
@@ -73,7 +73,7 @@ const HelmInstallUpgradeForm: React.FC<
7373
const { t } = useTranslation();
7474
const theme = React.useContext(ThemeContext);
7575
const { chartName, chartVersion, chartReadme, formData, formSchema, editorType } = values;
76-
const { type: helmAction, title, subTitle } = helmActionConfig;
76+
const { type: helmAction, title, subTitle } = helmActionConfig || {};
7777
const helmReadmeModalLauncher = useHelmReadmeModalLauncher({
7878
readme: chartReadme,
7979
theme,
@@ -193,7 +193,7 @@ const HelmInstallUpgradeForm: React.FC<
193193
handleReset={handleReset}
194194
errorMessage={status?.submitError}
195195
isSubmitting={isSubmitting}
196-
submitLabel={helmActionString(t)[helmAction]}
196+
submitLabel={helmActionString(t)[helmAction || '']}
197197
disableSubmit={isSubmitDisabled}
198198
resetLabel={t('helm-plugin~Cancel')}
199199
sticky

frontend/packages/helm-plugin/src/components/forms/install-upgrade/HelmInstallUpgradePage.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import {
2020
HelmActionType,
2121
HelmChart,
2222
HelmRelease,
23-
HelmActionConfigType,
2423
HelmActionOrigins,
2524
} from '../../../types/helm-types';
2625
import {
@@ -237,7 +236,7 @@ const HelmInstallUpgradePage: React.FunctionComponent = () => {
237236
onNamespaceChange={handleNamespaceChange}
238237
hideApplications
239238
>
240-
<DocumentTitle>{config?.title || ''}</DocumentTitle>
239+
{config?.title && <DocumentTitle>{config.title}</DocumentTitle>}
241240
<Formik
242241
initialValues={initialValues}
243242
onSubmit={handleSubmit}
@@ -249,9 +248,9 @@ const HelmInstallUpgradePage: React.FunctionComponent = () => {
249248
{...formikProps}
250249
chartHasValues={chartHasValues}
251250
chartMetaDescription={chartMetaDescription}
252-
helmActionConfig={config as HelmActionConfigType}
251+
helmActionConfig={config}
253252
onVersionChange={setChartData}
254-
chartError={chartError as Error}
253+
chartError={chartError}
255254
namespace={namespace || ''}
256255
chartIndexEntry={indexEntry || ''}
257256
annotatedName={annotatedName}

frontend/packages/helm-plugin/src/topology/components/HelmReleaseGroup.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ const HelmReleaseGroup: React.FC<HelmReleaseGroupProps> = ({
5454
dragNodeRef,
5555
}) => {
5656
const [hover, hoverRef] = useHover<SVGGElement>();
57-
const [innerHover, innerHoverRef] = useHover<Element>();
57+
const [innerHover, innerHoverRef] = useHover<SVGGElement>();
5858
const [{ dragging: labelDragging }, dragLabelRef] = useDragNode(noRegroupDragSourceSpec);
59-
const nodeRefs = useCombineRefs(innerHoverRef, dragNodeRef as React.Ref<Element>);
59+
const nodeRefs = useCombineRefs(innerHoverRef, dragNodeRef || null);
6060
const [filtered] = useSearchFilter(element.getLabel(), getResource(element)?.metadata?.labels);
6161
const showLabel = useShowLabel(hover);
6262
const hasChildren = element.getChildren()?.length > 0;
@@ -87,7 +87,7 @@ const HelmReleaseGroup: React.FC<HelmReleaseGroupProps> = ({
8787
<NodeShadows />
8888
<Layer id={dragging || labelDragging ? undefined : 'groups2'}>
8989
<g
90-
ref={nodeRefs as React.Ref<SVGGElement>}
90+
ref={nodeRefs}
9191
className={css('odc-helm-release', {
9292
'pf-m-selected': selected,
9393
'pf-m-dragging': dragging || labelDragging,

0 commit comments

Comments
 (0)