diff --git a/ui/src/app/shared/pod-name.test.ts b/ui/src/app/shared/pod-name.test.ts index 1aa72c14d05e..2544d514d5d3 100644 --- a/ui/src/app/shared/pod-name.test.ts +++ b/ui/src/app/shared/pod-name.test.ts @@ -28,19 +28,19 @@ describe('pod names', () => { }); test('getPodName', () => { - const node = { + const node = ({ name: 'nodename', id: '1', templateName: shortTemplateName - } as unknown as NodeStatus; - const wf = { + } as unknown) as NodeStatus; + const wf = ({ metadata: { name: shortWfName, annotations: { [ANNOTATION_KEY_POD_NAME_VERSION]: POD_NAME_V1 } } - } as unknown as Workflow; + } as unknown) as Workflow; const v1podName = node.id; const v2podName = `${shortWfName}-${shortTemplateName}-${createFNVHash(node.name)}`; @@ -63,7 +63,7 @@ describe('pod names', () => { test('getTemplateNameFromNode', () => { // case: no template ref or template name // expect fallback to empty string - const node = {} as unknown as NodeStatus; + const node = ({} as unknown) as NodeStatus; expect(getTemplateNameFromNode(node)).toEqual(''); // case: template ref defined but no template name defined diff --git a/ui/src/app/shared/pod-name.ts b/ui/src/app/shared/pod-name.ts index 8cf1139bd477..4498731d9c20 100644 --- a/ui/src/app/shared/pod-name.ts +++ b/ui/src/app/shared/pod-name.ts @@ -21,7 +21,7 @@ export function getPodName(workflow: Workflow, node: NodeStatus): string { const workflowName = workflow.metadata.name; // convert containerSet node name to its corresponding pod node name by removing the "." postfix // this part is from workflow/controller/container_set_template.go#executeContainerSet; the inverse never happens in the back-end, so is unique to the front-end - const podNodeName = node.type == 'Container' ? node.name.replace(/\.[^/.]+$/, '') : node.name; + const podNodeName = node.type === 'Container' ? node.name.replace(/\.[^/.]+$/, '') : node.name; if (workflowName === podNodeName) { return workflowName; } @@ -43,7 +43,7 @@ export function ensurePodNamePrefixLength(prefix: string): string { } return prefix; -}; +} export const createFNVHash = (input: string): number => { let hashint = 2166136261; diff --git a/ui/src/app/shared/utils.ts b/ui/src/app/shared/utils.ts index 94e3691ad1b8..24b8b77d3a52 100644 --- a/ui/src/app/shared/utils.ts +++ b/ui/src/app/shared/utils.ts @@ -84,7 +84,7 @@ export const Utils = { fixLocalStorageString(x: string): string { // empty string is valid, so we cannot use `truthy` - if (x == null || x == 'null' || x == 'undefined') { + if (x == null || x === 'null' || x === 'undefined') { return undefined; // explicitly return undefined } return x; diff --git a/ui/src/app/workflows/components/resubmit-workflow-panel.tsx b/ui/src/app/workflows/components/resubmit-workflow-panel.tsx index 49fbfd46088d..9b2ed35769b7 100644 --- a/ui/src/app/workflows/components/resubmit-workflow-panel.tsx +++ b/ui/src/app/workflows/components/resubmit-workflow-panel.tsx @@ -1,10 +1,10 @@ import {Checkbox} from 'argo-ui'; import React, {useContext, useState} from 'react'; import {Parameter, ResubmitOpts, Workflow} from '../../../models'; -import {Context} from '../../shared/context'; import {uiUrl} from '../../shared/base'; import {ErrorNotice} from '../../shared/components/error-notice'; import {ParametersInput} from '../../shared/components/parameters-input/parameters-input'; +import {Context} from '../../shared/context'; import {services} from '../../shared/services'; import {Utils} from '../../shared/utils'; diff --git a/ui/src/app/workflows/components/retry-workflow-panel.tsx b/ui/src/app/workflows/components/retry-workflow-panel.tsx index ff0e110c8d18..4aa5448da661 100644 --- a/ui/src/app/workflows/components/retry-workflow-panel.tsx +++ b/ui/src/app/workflows/components/retry-workflow-panel.tsx @@ -1,10 +1,10 @@ import {Checkbox} from 'argo-ui'; import React, {useContext, useState} from 'react'; import {Parameter, RetryOpts, Workflow} from '../../../models'; -import {Context} from '../../shared/context'; import {uiUrl} from '../../shared/base'; import {ErrorNotice} from '../../shared/components/error-notice'; import {ParametersInput} from '../../shared/components/parameters-input/parameters-input'; +import {Context} from '../../shared/context'; import {services} from '../../shared/services'; import {Utils} from '../../shared/utils'; diff --git a/ui/src/app/workflows/components/submit-workflow-panel.tsx b/ui/src/app/workflows/components/submit-workflow-panel.tsx index c662a0feda4c..89d9500e1db7 100644 --- a/ui/src/app/workflows/components/submit-workflow-panel.tsx +++ b/ui/src/app/workflows/components/submit-workflow-panel.tsx @@ -1,11 +1,11 @@ import {Select} from 'argo-ui'; import React, {useContext, useMemo, useState} from 'react'; import {Parameter, Template} from '../../../models'; -import {Context} from '../../shared/context'; import {uiUrl} from '../../shared/base'; import {ErrorNotice} from '../../shared/components/error-notice'; import {ParametersInput} from '../../shared/components/parameters-input/parameters-input'; import {TagsInput} from '../../shared/components/tags-input/tags-input'; +import {Context} from '../../shared/context'; import {services} from '../../shared/services'; import {Utils} from '../../shared/utils'; diff --git a/ui/src/app/workflows/components/workflow-details/workflow-details.tsx b/ui/src/app/workflows/components/workflow-details/workflow-details.tsx index 3b5b239b3dd2..381d8b233351 100644 --- a/ui/src/app/workflows/components/workflow-details/workflow-details.tsx +++ b/ui/src/app/workflows/components/workflow-details/workflow-details.tsx @@ -196,7 +196,9 @@ export function WorkflowDetails({history, location, match}: RouteComponentProps< popup .confirm('Confirm', () => ) .then(async yes => { - if (!yes) return; + if (!yes) { + return; + } const allPromises = []; if (isWorkflowInCluster(workflow)) { @@ -218,7 +220,9 @@ export function WorkflowDetails({history, location, match}: RouteComponentProps< setSidePanel('retry'); } else { popup.confirm('Confirm', `Are you sure you want to ${workflowOperation.title.toLowerCase()} this workflow?`).then(yes => { - if (!yes) return; + if (!yes) { + return; + } workflowOperation.action(workflow).catch(setError); }); @@ -466,7 +470,9 @@ export function WorkflowDetails({history, location, match}: RouteComponentProps< function renderResumePopup() { return popup.confirm('Confirm', renderSuspendNodeOptions).then(yes => { - if (!yes) return; + if (!yes) { + return; + } updateOutputParametersForNodeIfRequired() .then(resumeNode)