From d3433c6102f2e62e900b835f91cb31de11f74f04 Mon Sep 17 00:00:00 2001 From: Anton Gilgur <4970083+agilgur5@users.noreply.github.com> Date: Tue, 20 Feb 2024 01:05:43 -0500 Subject: [PATCH] refactor(ui): flatten directory structures (#12539) Signed-off-by: Anton Gilgur --- .../apiDocs.tsx => api-docs/api-docs.tsx} | 11 +++-- ui/src/app/api-docs/index.ts | 5 ++ ui/src/app/apidocs/index.tsx | 5 -- ui/src/app/app-router.tsx | 4 +- .../cluster-workflow-template-container.tsx | 5 +- .../cluster-workflow-template-creator.tsx | 14 +++--- .../cluster-workflow-template-details.tsx | 27 +++++----- .../cluster-workflow-template-editor.tsx | 18 +++---- .../cluster-workflow-template-link.tsx | 5 +- .../cluster-workflow-template-list.scss | 0 .../cluster-workflow-template-list.tsx | 28 +++++------ .../app/cluster-workflow-templates/index.ts | 2 +- .../cron-workflow-container.tsx | 5 +- .../cron-workflow-creator.tsx | 16 +++--- .../cron-workflow-details.scss | 28 +++++------ .../cron-workflow-details.tsx | 33 +++++++------ .../{components => }/cron-workflow-editor.tsx | 12 ++--- .../cron-workflow-filters.scss | 0 .../cron-workflow-filters.tsx | 9 ++-- .../{components => }/cron-workflow-link.tsx | 5 +- .../cron-workflow-list.scss | 0 .../cron-workflow-list.tsx | 41 ++++++++-------- .../cron-workflow-spec-editior.tsx | 7 +-- .../cron-workflow-status-viewer.tsx | 9 ++-- ui/src/app/cron-workflows/index.ts | 2 +- .../{components => }/pretty-schedule.tsx | 2 +- .../{components => }/schedule-validator.tsx | 2 +- .../build-graph.test.ts | 2 +- .../event-flow-details => }/build-graph.ts | 10 ++-- .../{components => }/event-flow-container.tsx | 3 +- .../event-flow-page.scss | 0 .../event-flow-page.tsx | 49 ++++++++++--------- .../event-flow-details => }/genres.ts | 4 +- .../event-flow-details => }/icons.ts | 2 +- .../{components/event-flow-details => }/id.ts | 0 ui/src/app/event-flow/index.ts | 2 +- .../event-source-container.tsx | 5 +- .../{components => }/event-source-creator.tsx | 14 +++--- .../event-source-details.tsx | 27 +++++----- .../{components => }/event-source-editor.tsx | 8 +-- .../event-source-list.scss | 0 .../event-source-list.tsx | 41 ++++++++-------- .../event-source-log-viewer.tsx | 11 +++-- ui/src/app/event-sources/index.ts | 2 +- ui/src/app/help/{components => }/help.scss | 0 ui/src/app/help/{components => }/help.tsx | 4 +- ui/src/app/help/{index.tsx => index.ts} | 2 +- ui/src/app/login/{index.tsx => index.ts} | 2 +- ui/src/app/login/{components => }/login.scss | 0 ui/src/app/login/{components => }/login.tsx | 4 +- .../modals/{feedback => }/feedback-modal.tsx | 6 +-- .../first-time-user-modal.tsx | 9 ++-- ui/src/app/modals/modal-switch.tsx | 7 +-- .../{new-version => }/new-version-modal.scss | 0 .../{new-version => }/new-version-modal.tsx | 8 +-- ui/src/app/modals/version.ts | 6 +++ ui/src/app/modals/version.tsx | 1 - ui/src/app/plugins/index.ts | 2 +- .../plugin-list => }/plugin-list.tsx | 11 +++-- .../{components => }/plugins-container.tsx | 3 +- ui/src/app/reports/index.ts | 2 +- .../{components => }/report-container.tsx | 3 +- .../{components => }/reports-filters.scss | 0 .../{components => }/reports-filters.tsx | 10 ++-- .../app/reports/{components => }/reports.tsx | 21 ++++---- .../workflows-to-chart-data.ts | 4 +- ui/src/app/sensors/index.ts | 2 +- .../{components => }/sensor-creator.tsx | 14 +++--- .../sensor-details => }/sensor-details.tsx | 28 +++++------ .../{components => }/sensor-editor.tsx | 14 +++--- .../sensor-list => }/sensor-list.tsx | 43 ++++++++-------- .../{components => }/sensor-logs-viewer.tsx | 17 ++++--- .../{components => }/sensor-side-panel.tsx | 12 ++--- .../{components => }/sensors-container.tsx | 4 +- ui/src/app/sensors/{components => }/utils.ts | 2 +- ui/src/app/shared/artifacts.ts | 16 +++--- ui/src/app/shared/components/big-button.tsx | 5 +- .../shared/components/drop-down-button.tsx | 4 +- .../app/shared/components/duration-panel.tsx | 5 +- .../editors/labels-and-annotations-editor.tsx | 5 +- .../components/editors/metadata-editor.tsx | 5 +- .../editors/workflow-parameters-editor.tsx | 5 +- ui/src/app/shared/components/error-notice.tsx | 5 +- .../shared/components/filter-drop-down.tsx | 5 +- .../shared/components/graph/fast-layout.ts | 8 +-- ui/src/app/shared/components/graph/icon.tsx | 5 +- ui/src/app/shared/components/graph/layout.ts | 4 +- .../{object-editor => }/object-editor.tsx | 12 ++--- .../parameters-input.tsx | 5 +- ui/src/app/shared/components/phase-icon.tsx | 5 +- ui/src/app/shared/components/phase.tsx | 5 +- .../resource-editor/resource-editor.tsx | 3 +- ui/src/app/shared/components/tick-meter.tsx | 4 +- ui/src/app/shared/components/timestamp.tsx | 5 +- ui/src/app/shared/cookie.ts | 4 +- ui/src/app/shared/duration.ts | 4 +- ui/src/app/shared/pod-name.ts | 16 +++--- ui/src/app/shared/resource-quantity.ts | 4 +- .../{components => }/use-collect-event.ts | 2 +- ...selocalstorage.ts => use-local-storage.ts} | 0 .../userinfo/{components => }/cli-help.tsx | 2 +- ui/src/app/userinfo/index.tsx | 2 +- .../userinfo/{components => }/user-info.tsx | 11 +++-- ui/src/app/widgets/widget-gallery.tsx | 1 + ui/src/app/widgets/widgets.tsx | 1 + ui/src/app/widgets/workflow-graph.tsx | 1 + .../workflow-event-bindings => }/id.ts | 0 ui/src/app/workflow-event-bindings/index.ts | 2 +- .../workflow-event-bindings-container.tsx | 3 +- .../workflow-event-bindings.tsx | 35 ++++++------- ui/src/app/workflow-templates/index.ts | 2 +- .../workflow-template-container.tsx | 5 +- .../workflow-template-creator.tsx | 16 +++--- .../workflow-template-details.tsx | 25 +++++----- .../workflow-template-editor.tsx | 12 ++--- .../workflow-template-filters.scss | 0 .../workflow-template-filters.tsx | 8 +-- .../workflow-template-link.tsx | 5 +- .../workflow-template-list.scss | 0 .../workflow-template-list.tsx | 42 ++++++++-------- .../components/resubmit-workflow-panel.tsx | 2 +- .../components/retry-workflow-panel.tsx | 2 +- .../components/submit-workflow-panel.tsx | 2 +- .../workflow-details/artifact-panel.tsx | 2 +- .../workflow-details/workflow-details.tsx | 2 +- .../workflow-resource-panel.tsx | 3 +- .../workflows/components/workflow-editor.tsx | 2 +- .../workflows/components/workflow-from.tsx | 7 +-- .../workflow-logs-viewer.tsx | 2 +- .../workflow-yaml-viewer.tsx | 2 +- .../workflows-list/workflows-list.tsx | 2 +- 131 files changed, 556 insertions(+), 502 deletions(-) rename ui/src/app/{apidocs/components/apiDocs.tsx => api-docs/api-docs.tsx} (80%) create mode 100644 ui/src/app/api-docs/index.ts delete mode 100644 ui/src/app/apidocs/index.tsx rename ui/src/app/cluster-workflow-templates/{components => }/cluster-workflow-template-container.tsx (84%) rename ui/src/app/cluster-workflow-templates/{components => }/cluster-workflow-template-creator.tsx (74%) rename ui/src/app/cluster-workflow-templates/{components/cluster-workflow-template-details => }/cluster-workflow-template-details.tsx (87%) rename ui/src/app/cluster-workflow-templates/{components => }/cluster-workflow-template-editor.tsx (78%) rename ui/src/app/cluster-workflow-templates/{components => }/cluster-workflow-template-link.tsx (71%) rename ui/src/app/cluster-workflow-templates/{components/cluster-workflow-template-list => }/cluster-workflow-template-list.scss (100%) rename ui/src/app/cluster-workflow-templates/{components/cluster-workflow-template-list => }/cluster-workflow-template-list.tsx (82%) rename ui/src/app/cron-workflows/{components => }/cron-workflow-container.tsx (72%) rename ui/src/app/cron-workflows/{components => }/cron-workflow-creator.tsx (74%) rename ui/src/app/cron-workflows/{components/cron-workflow-details => }/cron-workflow-details.scss (95%) rename ui/src/app/cron-workflows/{components/cron-workflow-details => }/cron-workflow-details.tsx (91%) rename ui/src/app/cron-workflows/{components => }/cron-workflow-editor.tsx (87%) rename ui/src/app/cron-workflows/{components/cron-workflow-filters => }/cron-workflow-filters.scss (100%) rename ui/src/app/cron-workflows/{components/cron-workflow-filters => }/cron-workflow-filters.tsx (90%) rename ui/src/app/cron-workflows/{components => }/cron-workflow-link.tsx (71%) rename ui/src/app/cron-workflows/{components/cron-workflow-list => }/cron-workflow-list.scss (100%) rename ui/src/app/cron-workflows/{components/cron-workflow-list => }/cron-workflow-list.tsx (88%) rename ui/src/app/cron-workflows/{components => }/cron-workflow-spec-editior.tsx (96%) rename ui/src/app/cron-workflows/{components => }/cron-workflow-status-viewer.tsx (89%) rename ui/src/app/cron-workflows/{components => }/pretty-schedule.tsx (92%) rename ui/src/app/cron-workflows/{components => }/schedule-validator.tsx (88%) rename ui/src/app/event-flow/{components/event-flow-details => }/build-graph.test.ts (89%) rename ui/src/app/event-flow/{components/event-flow-details => }/build-graph.ts (94%) rename ui/src/app/event-flow/{components => }/event-flow-container.tsx (80%) rename ui/src/app/event-flow/{components/event-flow-details => }/event-flow-page.scss (100%) rename ui/src/app/event-flow/{components/event-flow-details => }/event-flow-page.tsx (90%) rename ui/src/app/event-flow/{components/event-flow-details => }/genres.ts (67%) rename ui/src/app/event-flow/{components/event-flow-details => }/icons.ts (96%) rename ui/src/app/event-flow/{components/event-flow-details => }/id.ts (100%) rename ui/src/app/event-sources/{components => }/event-source-container.tsx (73%) rename ui/src/app/event-sources/{components => }/event-source-creator.tsx (79%) rename ui/src/app/event-sources/{components/event-source-details => }/event-source-details.tsx (89%) rename ui/src/app/event-sources/{components => }/event-source-editor.tsx (84%) rename ui/src/app/event-sources/{components/event-source-list => }/event-source-list.scss (100%) rename ui/src/app/event-sources/{components/event-source-list => }/event-source-list.tsx (86%) rename ui/src/app/event-sources/{components => }/event-source-log-viewer.tsx (93%) rename ui/src/app/help/{components => }/help.scss (100%) rename ui/src/app/help/{components => }/help.tsx (94%) rename ui/src/app/help/{index.tsx => index.ts} (50%) rename ui/src/app/login/{index.tsx => index.ts} (50%) rename ui/src/app/login/{components => }/login.scss (100%) rename ui/src/app/login/{components => }/login.tsx (96%) rename ui/src/app/modals/{feedback => }/feedback-modal.tsx (80%) rename ui/src/app/modals/{first-time-user => }/first-time-user-modal.tsx (84%) rename ui/src/app/modals/{new-version => }/new-version-modal.scss (100%) rename ui/src/app/modals/{new-version => }/new-version-modal.tsx (96%) create mode 100644 ui/src/app/modals/version.ts delete mode 100644 ui/src/app/modals/version.tsx rename ui/src/app/plugins/{components/plugin-list => }/plugin-list.tsx (81%) rename ui/src/app/plugins/{components => }/plugins-container.tsx (84%) rename ui/src/app/reports/{components => }/report-container.tsx (92%) rename ui/src/app/reports/{components => }/reports-filters.scss (100%) rename ui/src/app/reports/{components => }/reports-filters.tsx (92%) rename ui/src/app/reports/{components => }/reports.tsx (91%) rename ui/src/app/reports/{components => }/workflows-to-chart-data.ts (97%) rename ui/src/app/sensors/{components => }/sensor-creator.tsx (78%) rename ui/src/app/sensors/{components/sensor-details => }/sensor-details.tsx (85%) rename ui/src/app/sensors/{components => }/sensor-editor.tsx (80%) rename ui/src/app/sensors/{components/sensor-list => }/sensor-list.tsx (85%) rename ui/src/app/sensors/{components => }/sensor-logs-viewer.tsx (91%) rename ui/src/app/sensors/{components => }/sensor-side-panel.tsx (89%) rename ui/src/app/sensors/{components => }/sensors-container.tsx (77%) rename ui/src/app/sensors/{components => }/utils.ts (95%) rename ui/src/app/shared/components/{object-editor => }/object-editor.tsx (95%) rename ui/src/app/shared/components/{parameters-input => }/parameters-input.tsx (95%) rename ui/src/app/shared/{components => }/use-collect-event.ts (76%) rename ui/src/app/shared/{hooks/uselocalstorage.ts => use-local-storage.ts} (100%) rename ui/src/app/userinfo/{components => }/cli-help.tsx (97%) rename ui/src/app/userinfo/{components => }/user-info.tsx (92%) rename ui/src/app/workflow-event-bindings/{components/workflow-event-bindings => }/id.ts (100%) rename ui/src/app/workflow-event-bindings/{components => }/workflow-event-bindings-container.tsx (78%) rename ui/src/app/workflow-event-bindings/{components/workflow-event-bindings => }/workflow-event-bindings.tsx (85%) rename ui/src/app/workflow-templates/{components => }/workflow-template-container.tsx (80%) rename ui/src/app/workflow-templates/{components => }/workflow-template-creator.tsx (74%) rename ui/src/app/workflow-templates/{components/workflow-template-details => }/workflow-template-details.tsx (88%) rename ui/src/app/workflow-templates/{components => }/workflow-template-editor.tsx (81%) rename ui/src/app/workflow-templates/{components/workflow-template-filters => }/workflow-template-filters.scss (100%) rename ui/src/app/workflow-templates/{components/workflow-template-filters => }/workflow-template-filters.tsx (90%) rename ui/src/app/workflow-templates/{components => }/workflow-template-link.tsx (73%) rename ui/src/app/workflow-templates/{components/workflow-template-list => }/workflow-template-list.scss (100%) rename ui/src/app/workflow-templates/{components/workflow-template-list => }/workflow-template-list.tsx (84%) diff --git a/ui/src/app/apidocs/components/apiDocs.tsx b/ui/src/app/api-docs/api-docs.tsx similarity index 80% rename from ui/src/app/apidocs/components/apiDocs.tsx rename to ui/src/app/api-docs/api-docs.tsx index 8d6a6ee9e6e8..c706dd268214 100644 --- a/ui/src/app/apidocs/components/apiDocs.tsx +++ b/ui/src/app/api-docs/api-docs.tsx @@ -1,10 +1,11 @@ import {Page} from 'argo-ui'; import * as React from 'react'; -import {uiUrl} from '../../shared/base'; -import {Loading} from '../../shared/components/loading'; -import {useCollectEvent} from '../../shared/components/use-collect-event'; -export const ApiDocs = () => { +import {uiUrl} from '../shared/base'; +import {Loading} from '../shared/components/loading'; +import {useCollectEvent} from '../shared/use-collect-event'; + +export function ApiDocs() { useCollectEvent('openedApiDocs'); return ( @@ -13,7 +14,7 @@ export const ApiDocs = () => { ); -}; +} // lazy load SwaggerUI as it is infrequently used and imports very large components (which can be split into a separate bundle) const LazySwaggerUI = React.lazy(() => { diff --git a/ui/src/app/api-docs/index.ts b/ui/src/app/api-docs/index.ts new file mode 100644 index 000000000000..bd649afcd817 --- /dev/null +++ b/ui/src/app/api-docs/index.ts @@ -0,0 +1,5 @@ +import {ApiDocs} from './api-docs'; + +export default { + component: ApiDocs +}; diff --git a/ui/src/app/apidocs/index.tsx b/ui/src/app/apidocs/index.tsx deleted file mode 100644 index c505ba801b50..000000000000 --- a/ui/src/app/apidocs/index.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import {ApiDocs} from './components/apiDocs'; - -export default { - component: ApiDocs -}; diff --git a/ui/src/app/app-router.tsx b/ui/src/app/app-router.tsx index f06e01917857..a45fd2521c82 100644 --- a/ui/src/app/app-router.tsx +++ b/ui/src/app/app-router.tsx @@ -5,7 +5,7 @@ import * as React from 'react'; import {useEffect, useState} from 'react'; import {Redirect, Route, Router, Switch} from 'react-router'; import {Version} from '../models'; -import apidocs from './apidocs'; +import apiDocs from './api-docs'; import clusterWorkflowTemplates from './cluster-workflow-templates'; import cronWorkflows from './cron-workflows'; import eventflow from './event-flow'; @@ -172,7 +172,7 @@ export function AppRouter({popupManager, history, notificationsManager}: {popupM - + {Utils.managedNamespace && } diff --git a/ui/src/app/cluster-workflow-templates/components/cluster-workflow-template-container.tsx b/ui/src/app/cluster-workflow-templates/cluster-workflow-template-container.tsx similarity index 84% rename from ui/src/app/cluster-workflow-templates/components/cluster-workflow-template-container.tsx rename to ui/src/app/cluster-workflow-templates/cluster-workflow-template-container.tsx index ef18b0fd8178..3c91343b4f9d 100644 --- a/ui/src/app/cluster-workflow-templates/components/cluster-workflow-template-container.tsx +++ b/ui/src/app/cluster-workflow-templates/cluster-workflow-template-container.tsx @@ -1,7 +1,8 @@ import * as React from 'react'; import {Route, RouteComponentProps, Switch} from 'react-router'; -import {ClusterWorkflowTemplateDetails} from './cluster-workflow-template-details/cluster-workflow-template-details'; -import {ClusterWorkflowTemplateList} from './cluster-workflow-template-list/cluster-workflow-template-list'; + +import {ClusterWorkflowTemplateDetails} from './cluster-workflow-template-details'; +import {ClusterWorkflowTemplateList} from './cluster-workflow-template-list'; export const ClusterWorkflowTemplateContainer = (props: RouteComponentProps) => ( diff --git a/ui/src/app/cluster-workflow-templates/components/cluster-workflow-template-creator.tsx b/ui/src/app/cluster-workflow-templates/cluster-workflow-template-creator.tsx similarity index 74% rename from ui/src/app/cluster-workflow-templates/components/cluster-workflow-template-creator.tsx rename to ui/src/app/cluster-workflow-templates/cluster-workflow-template-creator.tsx index 4ce7cdceb9e1..de44ef82d164 100644 --- a/ui/src/app/cluster-workflow-templates/components/cluster-workflow-template-creator.tsx +++ b/ui/src/app/cluster-workflow-templates/cluster-workflow-template-creator.tsx @@ -1,13 +1,13 @@ import * as React from 'react'; import {useState} from 'react'; -import {ClusterWorkflowTemplate} from '../../../models'; -import {Button} from '../../shared/components/button'; -import {ErrorNotice} from '../../shared/components/error-notice'; -import {ExampleManifests} from '../../shared/components/example-manifests'; -import {UploadButton} from '../../shared/components/upload-button'; -import {exampleClusterWorkflowTemplate} from '../../shared/examples'; -import {services} from '../../shared/services'; +import {ClusterWorkflowTemplate} from '../../models'; +import {Button} from '../shared/components/button'; +import {ErrorNotice} from '../shared/components/error-notice'; +import {ExampleManifests} from '../shared/components/example-manifests'; +import {UploadButton} from '../shared/components/upload-button'; +import {exampleClusterWorkflowTemplate} from '../shared/examples'; +import {services} from '../shared/services'; import {ClusterWorkflowTemplateEditor} from './cluster-workflow-template-editor'; export function ClusterWorkflowTemplateCreator({onCreate}: {onCreate: (workflow: ClusterWorkflowTemplate) => void}) { diff --git a/ui/src/app/cluster-workflow-templates/components/cluster-workflow-template-details/cluster-workflow-template-details.tsx b/ui/src/app/cluster-workflow-templates/cluster-workflow-template-details.tsx similarity index 87% rename from ui/src/app/cluster-workflow-templates/components/cluster-workflow-template-details/cluster-workflow-template-details.tsx rename to ui/src/app/cluster-workflow-templates/cluster-workflow-template-details.tsx index 9c9f1ac01184..d647046c806c 100644 --- a/ui/src/app/cluster-workflow-templates/components/cluster-workflow-template-details/cluster-workflow-template-details.tsx +++ b/ui/src/app/cluster-workflow-templates/cluster-workflow-template-details.tsx @@ -3,20 +3,21 @@ import {SlidingPanel} from 'argo-ui/src/index'; import * as React from 'react'; import {useContext, useEffect, useState} from 'react'; import {RouteComponentProps} from 'react-router'; -import {ClusterWorkflowTemplate} from '../../../../models'; -import {uiUrl} from '../../../shared/base'; -import {ErrorNotice} from '../../../shared/components/error-notice'; -import {Loading} from '../../../shared/components/loading'; -import {useCollectEvent} from '../../../shared/components/use-collect-event'; -import {Context} from '../../../shared/context'; -import {historyUrl} from '../../../shared/history'; -import {services} from '../../../shared/services'; -import {useQueryParams} from '../../../shared/use-query-params'; -import {Utils} from '../../../shared/utils'; -import {SubmitWorkflowPanel} from '../../../workflows/components/submit-workflow-panel'; -import {ClusterWorkflowTemplateEditor} from '../cluster-workflow-template-editor'; -import '../../../workflows/components/workflow-details/workflow-details.scss'; +import {ClusterWorkflowTemplate} from '../../models'; +import {uiUrl} from '../shared/base'; +import {ErrorNotice} from '../shared/components/error-notice'; +import {Loading} from '../shared/components/loading'; +import {useCollectEvent} from '../shared/use-collect-event'; +import {Context} from '../shared/context'; +import {historyUrl} from '../shared/history'; +import {services} from '../shared/services'; +import {useQueryParams} from '../shared/use-query-params'; +import {Utils} from '../shared/utils'; +import {SubmitWorkflowPanel} from '../workflows/components/submit-workflow-panel'; +import {ClusterWorkflowTemplateEditor} from './cluster-workflow-template-editor'; + +import '../workflows/components/workflow-details/workflow-details.scss'; export function ClusterWorkflowTemplateDetails({history, location, match}: RouteComponentProps) { // boiler-plate diff --git a/ui/src/app/cluster-workflow-templates/components/cluster-workflow-template-editor.tsx b/ui/src/app/cluster-workflow-templates/cluster-workflow-template-editor.tsx similarity index 78% rename from ui/src/app/cluster-workflow-templates/components/cluster-workflow-template-editor.tsx rename to ui/src/app/cluster-workflow-templates/cluster-workflow-template-editor.tsx index 533c18db8c52..ebfae00deb04 100644 --- a/ui/src/app/cluster-workflow-templates/components/cluster-workflow-template-editor.tsx +++ b/ui/src/app/cluster-workflow-templates/cluster-workflow-template-editor.tsx @@ -1,13 +1,13 @@ import * as React from 'react'; - import {Tabs} from 'argo-ui'; -import {WorkflowTemplate} from '../../../models'; -import {LabelsAndAnnotationsEditor} from '../../shared/components/editors/labels-and-annotations-editor'; -import {MetadataEditor} from '../../shared/components/editors/metadata-editor'; -import {WorkflowParametersEditor} from '../../shared/components/editors/workflow-parameters-editor'; -import {ObjectEditor} from '../../shared/components/object-editor/object-editor'; -export const ClusterWorkflowTemplateEditor = ({ +import {WorkflowTemplate} from '../../models'; +import {LabelsAndAnnotationsEditor} from '../shared/components/editors/labels-and-annotations-editor'; +import {MetadataEditor} from '../shared/components/editors/metadata-editor'; +import {WorkflowParametersEditor} from '../shared/components/editors/workflow-parameters-editor'; +import {ObjectEditor} from '../shared/components/object-editor'; + +export function ClusterWorkflowTemplateEditor({ onChange, template, onError, @@ -19,7 +19,7 @@ export const ClusterWorkflowTemplateEditor = ({ onError: (error: Error) => void; onTabSelected?: (tab: string) => void; selectedTabKey?: string; -}) => { +}) { return ( ); -}; +} diff --git a/ui/src/app/cluster-workflow-templates/components/cluster-workflow-template-link.tsx b/ui/src/app/cluster-workflow-templates/cluster-workflow-template-link.tsx similarity index 71% rename from ui/src/app/cluster-workflow-templates/components/cluster-workflow-template-link.tsx rename to ui/src/app/cluster-workflow-templates/cluster-workflow-template-link.tsx index b41e70f2ef8a..dc254655dd6c 100644 --- a/ui/src/app/cluster-workflow-templates/components/cluster-workflow-template-link.tsx +++ b/ui/src/app/cluster-workflow-templates/cluster-workflow-template-link.tsx @@ -1,6 +1,7 @@ import * as React from 'react'; -import {uiUrl} from '../../shared/base'; -import {LinkButton} from '../../shared/components/link-button'; + +import {uiUrl} from '../shared/base'; +import {LinkButton} from '../shared/components/link-button'; export const ClusterWorkflowTemplateLink = (props: {name: string}) => ( diff --git a/ui/src/app/cluster-workflow-templates/components/cluster-workflow-template-list/cluster-workflow-template-list.scss b/ui/src/app/cluster-workflow-templates/cluster-workflow-template-list.scss similarity index 100% rename from ui/src/app/cluster-workflow-templates/components/cluster-workflow-template-list/cluster-workflow-template-list.scss rename to ui/src/app/cluster-workflow-templates/cluster-workflow-template-list.scss diff --git a/ui/src/app/cluster-workflow-templates/components/cluster-workflow-template-list/cluster-workflow-template-list.tsx b/ui/src/app/cluster-workflow-templates/cluster-workflow-template-list.tsx similarity index 82% rename from ui/src/app/cluster-workflow-templates/components/cluster-workflow-template-list/cluster-workflow-template-list.tsx rename to ui/src/app/cluster-workflow-templates/cluster-workflow-template-list.tsx index 4f713c8df273..c855a9c885d8 100644 --- a/ui/src/app/cluster-workflow-templates/components/cluster-workflow-template-list/cluster-workflow-template-list.tsx +++ b/ui/src/app/cluster-workflow-templates/cluster-workflow-template-list.tsx @@ -2,21 +2,21 @@ import {Page, SlidingPanel} from 'argo-ui'; import * as React from 'react'; import {useContext, useEffect, useState} from 'react'; import {Link, RouteComponentProps} from 'react-router-dom'; -import * as models from '../../../../models'; -import {uiUrl} from '../../../shared/base'; -import {ErrorNotice} from '../../../shared/components/error-notice'; -import {ExampleManifests} from '../../../shared/components/example-manifests'; -import {InfoIcon} from '../../../shared/components/fa-icons'; -import {Loading} from '../../../shared/components/loading'; -import {Timestamp} from '../../../shared/components/timestamp'; -import {useCollectEvent} from '../../../shared/components/use-collect-event'; -import {ZeroState} from '../../../shared/components/zero-state'; -import {Context} from '../../../shared/context'; -import {useQueryParams} from '../../../shared/use-query-params'; -import {Footnote} from '../../../shared/footnote'; -import {services} from '../../../shared/services'; -import {ClusterWorkflowTemplateCreator} from '../cluster-workflow-template-creator'; +import * as models from '../../models'; +import {uiUrl} from '../shared/base'; +import {ErrorNotice} from '../shared/components/error-notice'; +import {ExampleManifests} from '../shared/components/example-manifests'; +import {InfoIcon} from '../shared/components/fa-icons'; +import {Loading} from '../shared/components/loading'; +import {Timestamp} from '../shared/components/timestamp'; +import {useCollectEvent} from '../shared/use-collect-event'; +import {ZeroState} from '../shared/components/zero-state'; +import {Context} from '../shared/context'; +import {useQueryParams} from '../shared/use-query-params'; +import {Footnote} from '../shared/footnote'; +import {services} from '../shared/services'; +import {ClusterWorkflowTemplateCreator} from './cluster-workflow-template-creator'; import './cluster-workflow-template-list.scss'; diff --git a/ui/src/app/cluster-workflow-templates/index.ts b/ui/src/app/cluster-workflow-templates/index.ts index c6f11005312e..c2ee77ea6d6b 100644 --- a/ui/src/app/cluster-workflow-templates/index.ts +++ b/ui/src/app/cluster-workflow-templates/index.ts @@ -1,4 +1,4 @@ -import {ClusterWorkflowTemplateContainer} from './components/cluster-workflow-template-container'; +import {ClusterWorkflowTemplateContainer} from './cluster-workflow-template-container'; export default { component: ClusterWorkflowTemplateContainer diff --git a/ui/src/app/cron-workflows/components/cron-workflow-container.tsx b/ui/src/app/cron-workflows/cron-workflow-container.tsx similarity index 72% rename from ui/src/app/cron-workflows/components/cron-workflow-container.tsx rename to ui/src/app/cron-workflows/cron-workflow-container.tsx index 5b39ecb7fed1..af8608082637 100644 --- a/ui/src/app/cron-workflows/components/cron-workflow-container.tsx +++ b/ui/src/app/cron-workflows/cron-workflow-container.tsx @@ -1,7 +1,8 @@ import * as React from 'react'; import {Route, RouteComponentProps, Switch} from 'react-router'; -import {CronWorkflowDetails} from './cron-workflow-details/cron-workflow-details'; -import {CronWorkflowList} from './cron-workflow-list/cron-workflow-list'; + +import {CronWorkflowDetails} from './cron-workflow-details'; +import {CronWorkflowList} from './cron-workflow-list'; export const CronWorkflowContainer = (props: RouteComponentProps) => ( diff --git a/ui/src/app/cron-workflows/components/cron-workflow-creator.tsx b/ui/src/app/cron-workflows/cron-workflow-creator.tsx similarity index 74% rename from ui/src/app/cron-workflows/components/cron-workflow-creator.tsx rename to ui/src/app/cron-workflows/cron-workflow-creator.tsx index b54cd98203bf..b15f42e15dec 100644 --- a/ui/src/app/cron-workflows/components/cron-workflow-creator.tsx +++ b/ui/src/app/cron-workflows/cron-workflow-creator.tsx @@ -1,14 +1,14 @@ import * as React from 'react'; import {useState} from 'react'; -import {CronWorkflow} from '../../../models'; -import {Button} from '../../shared/components/button'; -import {ErrorNotice} from '../../shared/components/error-notice'; -import {ExampleManifests} from '../../shared/components/example-manifests'; -import {UploadButton} from '../../shared/components/upload-button'; -import {exampleCronWorkflow} from '../../shared/examples'; -import {services} from '../../shared/services'; -import {Utils} from '../../shared/utils'; +import {CronWorkflow} from '../../models'; +import {Button} from '../shared/components/button'; +import {ErrorNotice} from '../shared/components/error-notice'; +import {ExampleManifests} from '../shared/components/example-manifests'; +import {UploadButton} from '../shared/components/upload-button'; +import {exampleCronWorkflow} from '../shared/examples'; +import {services} from '../shared/services'; +import {Utils} from '../shared/utils'; import {CronWorkflowEditor} from './cron-workflow-editor'; export function CronWorkflowCreator({onCreate, namespace}: {namespace: string; onCreate: (cronWorkflow: CronWorkflow) => void}) { diff --git a/ui/src/app/cron-workflows/components/cron-workflow-details/cron-workflow-details.scss b/ui/src/app/cron-workflows/cron-workflow-details.scss similarity index 95% rename from ui/src/app/cron-workflows/components/cron-workflow-details/cron-workflow-details.scss rename to ui/src/app/cron-workflows/cron-workflow-details.scss index 611e623ebe22..4429e29742d3 100644 --- a/ui/src/app/cron-workflows/components/cron-workflow-details/cron-workflow-details.scss +++ b/ui/src/app/cron-workflows/cron-workflow-details.scss @@ -1,14 +1,14 @@ -@import 'node_modules/argo-ui/src/styles/config'; - -.workflows-cron-list .workflows-list { - &__status { - max-width: 80px; - display: flex; - align-items: center; - - /* checkboxes are not visible and are unused on this page */ - &--checkbox { - appearance: none; - } - } -} +@import 'node_modules/argo-ui/src/styles/config'; + +.workflows-cron-list .workflows-list { + &__status { + max-width: 80px; + display: flex; + align-items: center; + + /* checkboxes are not visible and are unused on this page */ + &--checkbox { + appearance: none; + } + } +} diff --git a/ui/src/app/cron-workflows/components/cron-workflow-details/cron-workflow-details.tsx b/ui/src/app/cron-workflows/cron-workflow-details.tsx similarity index 91% rename from ui/src/app/cron-workflows/components/cron-workflow-details/cron-workflow-details.tsx rename to ui/src/app/cron-workflows/cron-workflow-details.tsx index 2c7ea3801a38..92bf1e33e11c 100644 --- a/ui/src/app/cron-workflows/components/cron-workflow-details/cron-workflow-details.tsx +++ b/ui/src/app/cron-workflows/cron-workflow-details.tsx @@ -2,23 +2,24 @@ import {NotificationType, Page, SlidingPanel} from 'argo-ui'; import * as React from 'react'; import {useContext, useEffect, useState} from 'react'; import {RouteComponentProps} from 'react-router'; -import * as models from '../../../../models'; -import {CronWorkflow, Link, Workflow} from '../../../../models'; -import {uiUrl} from '../../../shared/base'; -import {ErrorNotice} from '../../../shared/components/error-notice'; -import {openLinkWithKey} from '../../../shared/components/links'; -import {Loading} from '../../../shared/components/loading'; -import {useCollectEvent} from '../../../shared/components/use-collect-event'; -import {ZeroState} from '../../../shared/components/zero-state'; -import {Context} from '../../../shared/context'; -import {historyUrl} from '../../../shared/history'; -import {services} from '../../../shared/services'; -import {useQueryParams} from '../../../shared/use-query-params'; -import {WidgetGallery} from '../../../widgets/widget-gallery'; -import {WorkflowsRow} from '../../../workflows/components/workflows-row/workflows-row'; -import {CronWorkflowEditor} from '../cron-workflow-editor'; -import '../../../workflows/components/workflow-details/workflow-details.scss'; +import * as models from '../../models'; +import {CronWorkflow, Link, Workflow} from '../../models'; +import {uiUrl} from '../shared/base'; +import {ErrorNotice} from '../shared/components/error-notice'; +import {openLinkWithKey} from '../shared/components/links'; +import {Loading} from '../shared/components/loading'; +import {useCollectEvent} from '../shared/use-collect-event'; +import {ZeroState} from '../shared/components/zero-state'; +import {Context} from '../shared/context'; +import {historyUrl} from '../shared/history'; +import {services} from '../shared/services'; +import {useQueryParams} from '../shared/use-query-params'; +import {WidgetGallery} from '../widgets/widget-gallery'; +import {WorkflowsRow} from '../workflows/components/workflows-row/workflows-row'; +import {CronWorkflowEditor} from './cron-workflow-editor'; + +import '../workflows/components/workflow-details/workflow-details.scss'; import './cron-workflow-details.scss'; export function CronWorkflowDetails({match, location, history}: RouteComponentProps) { diff --git a/ui/src/app/cron-workflows/components/cron-workflow-editor.tsx b/ui/src/app/cron-workflows/cron-workflow-editor.tsx similarity index 87% rename from ui/src/app/cron-workflows/components/cron-workflow-editor.tsx rename to ui/src/app/cron-workflows/cron-workflow-editor.tsx index 854471a9938e..a48bd95dff3b 100644 --- a/ui/src/app/cron-workflows/components/cron-workflow-editor.tsx +++ b/ui/src/app/cron-workflows/cron-workflow-editor.tsx @@ -1,11 +1,11 @@ import * as React from 'react'; - import {Tabs} from 'argo-ui'; -import {CronWorkflow} from '../../../models'; -import {LabelsAndAnnotationsEditor} from '../../shared/components/editors/labels-and-annotations-editor'; -import {MetadataEditor} from '../../shared/components/editors/metadata-editor'; -import {WorkflowParametersEditor} from '../../shared/components/editors/workflow-parameters-editor'; -import {ObjectEditor} from '../../shared/components/object-editor/object-editor'; + +import {CronWorkflow} from '../../models'; +import {LabelsAndAnnotationsEditor} from '../shared/components/editors/labels-and-annotations-editor'; +import {MetadataEditor} from '../shared/components/editors/metadata-editor'; +import {WorkflowParametersEditor} from '../shared/components/editors/workflow-parameters-editor'; +import {ObjectEditor} from '../shared/components/object-editor'; import {CronWorkflowSpecEditor} from './cron-workflow-spec-editior'; import {CronWorkflowStatusViewer} from './cron-workflow-status-viewer'; diff --git a/ui/src/app/cron-workflows/components/cron-workflow-filters/cron-workflow-filters.scss b/ui/src/app/cron-workflows/cron-workflow-filters.scss similarity index 100% rename from ui/src/app/cron-workflows/components/cron-workflow-filters/cron-workflow-filters.scss rename to ui/src/app/cron-workflows/cron-workflow-filters.scss diff --git a/ui/src/app/cron-workflows/components/cron-workflow-filters/cron-workflow-filters.tsx b/ui/src/app/cron-workflows/cron-workflow-filters.tsx similarity index 90% rename from ui/src/app/cron-workflows/components/cron-workflow-filters/cron-workflow-filters.tsx rename to ui/src/app/cron-workflows/cron-workflow-filters.tsx index 6228b4eef7eb..bb5a401e806f 100644 --- a/ui/src/app/cron-workflows/components/cron-workflow-filters/cron-workflow-filters.tsx +++ b/ui/src/app/cron-workflows/cron-workflow-filters.tsx @@ -1,9 +1,10 @@ import * as React from 'react'; import {useEffect, useState} from 'react'; -import * as models from '../../../../models'; -import {CheckboxFilter} from '../../../shared/components/checkbox-filter/checkbox-filter'; -import {NamespaceFilter} from '../../../shared/components/namespace-filter'; -import {TagsInput} from '../../../shared/components/tags-input/tags-input'; + +import * as models from '../../models'; +import {CheckboxFilter} from '../shared/components/checkbox-filter/checkbox-filter'; +import {NamespaceFilter} from '../shared/components/namespace-filter'; +import {TagsInput} from '../shared/components/tags-input/tags-input'; import './cron-workflow-filters.scss'; diff --git a/ui/src/app/cron-workflows/components/cron-workflow-link.tsx b/ui/src/app/cron-workflows/cron-workflow-link.tsx similarity index 71% rename from ui/src/app/cron-workflows/components/cron-workflow-link.tsx rename to ui/src/app/cron-workflows/cron-workflow-link.tsx index fa691c69bef4..c66b91038277 100644 --- a/ui/src/app/cron-workflows/components/cron-workflow-link.tsx +++ b/ui/src/app/cron-workflows/cron-workflow-link.tsx @@ -1,6 +1,7 @@ import * as React from 'react'; -import {uiUrl} from '../../shared/base'; -import {LinkButton} from '../../shared/components/link-button'; + +import {uiUrl} from '../shared/base'; +import {LinkButton} from '../shared/components/link-button'; export const CronWorkflowLink = (props: {namespace: string; name: string}) => ( diff --git a/ui/src/app/cron-workflows/components/cron-workflow-list/cron-workflow-list.scss b/ui/src/app/cron-workflows/cron-workflow-list.scss similarity index 100% rename from ui/src/app/cron-workflows/components/cron-workflow-list/cron-workflow-list.scss rename to ui/src/app/cron-workflows/cron-workflow-list.scss diff --git a/ui/src/app/cron-workflows/components/cron-workflow-list/cron-workflow-list.tsx b/ui/src/app/cron-workflows/cron-workflow-list.tsx similarity index 88% rename from ui/src/app/cron-workflows/components/cron-workflow-list/cron-workflow-list.tsx rename to ui/src/app/cron-workflows/cron-workflow-list.tsx index 5b52fa5828b7..3d171ee4b585 100644 --- a/ui/src/app/cron-workflows/components/cron-workflow-list/cron-workflow-list.tsx +++ b/ui/src/app/cron-workflows/cron-workflow-list.tsx @@ -2,26 +2,27 @@ import {Page, SlidingPanel, Ticker} from 'argo-ui'; import * as React from 'react'; import {useContext, useEffect, useState} from 'react'; import {Link, RouteComponentProps} from 'react-router-dom'; -import {CronWorkflow, CronWorkflowSpec} from '../../../../models'; -import {ANNOTATION_DESCRIPTION, ANNOTATION_TITLE} from '../../../shared/annotations'; -import {uiUrl} from '../../../shared/base'; -import {ErrorNotice} from '../../../shared/components/error-notice'; -import {ExampleManifests} from '../../../shared/components/example-manifests'; -import {InfoIcon} from '../../../shared/components/fa-icons'; -import {Loading} from '../../../shared/components/loading'; -import {Timestamp} from '../../../shared/components/timestamp'; -import {useCollectEvent} from '../../../shared/components/use-collect-event'; -import {ZeroState} from '../../../shared/components/zero-state'; -import {Context} from '../../../shared/context'; -import {getNextScheduledTime} from '../../../shared/cron'; -import {Footnote} from '../../../shared/footnote'; -import {historyUrl} from '../../../shared/history'; -import {services} from '../../../shared/services'; -import {useQueryParams} from '../../../shared/use-query-params'; -import {Utils} from '../../../shared/utils'; -import {CronWorkflowCreator} from '../cron-workflow-creator'; -import {CronWorkflowFilters} from '../cron-workflow-filters/cron-workflow-filters'; -import {PrettySchedule} from '../pretty-schedule'; + +import {CronWorkflow, CronWorkflowSpec} from '../../models'; +import {uiUrl} from '../shared/base'; +import {ANNOTATION_DESCRIPTION, ANNOTATION_TITLE} from '../shared/annotations'; +import {ErrorNotice} from '../shared/components/error-notice'; +import {ExampleManifests} from '../shared/components/example-manifests'; +import {InfoIcon} from '../shared/components/fa-icons'; +import {Loading} from '../shared/components/loading'; +import {Timestamp} from '../shared/components/timestamp'; +import {useCollectEvent} from '../shared/use-collect-event'; +import {ZeroState} from '../shared/components/zero-state'; +import {Context} from '../shared/context'; +import {getNextScheduledTime} from '../shared/cron'; +import {Footnote} from '../shared/footnote'; +import {historyUrl} from '../shared/history'; +import {services} from '../shared/services'; +import {useQueryParams} from '../shared/use-query-params'; +import {Utils} from '../shared/utils'; +import {CronWorkflowCreator} from './cron-workflow-creator'; +import {CronWorkflowFilters} from './cron-workflow-filters'; +import {PrettySchedule} from './pretty-schedule'; import './cron-workflow-list.scss'; diff --git a/ui/src/app/cron-workflows/components/cron-workflow-spec-editior.tsx b/ui/src/app/cron-workflows/cron-workflow-spec-editior.tsx similarity index 96% rename from ui/src/app/cron-workflows/components/cron-workflow-spec-editior.tsx rename to ui/src/app/cron-workflows/cron-workflow-spec-editior.tsx index 3b925d739412..9d6ce5b44302 100644 --- a/ui/src/app/cron-workflows/components/cron-workflow-spec-editior.tsx +++ b/ui/src/app/cron-workflows/cron-workflow-spec-editior.tsx @@ -1,8 +1,9 @@ import {Checkbox, Select} from 'argo-ui'; import * as React from 'react'; -import {ConcurrencyPolicy, CronWorkflowSpec} from '../../../models'; -import {NumberInput} from '../../shared/components/number-input'; -import {TextInput} from '../../shared/components/text-input'; + +import {ConcurrencyPolicy, CronWorkflowSpec} from '../../models'; +import {NumberInput} from '../shared/components/number-input'; +import {TextInput} from '../shared/components/text-input'; import {ScheduleValidator} from './schedule-validator'; export function CronWorkflowSpecEditor({onChange, spec}: {spec: CronWorkflowSpec; onChange: (spec: CronWorkflowSpec) => void}) { diff --git a/ui/src/app/cron-workflows/components/cron-workflow-status-viewer.tsx b/ui/src/app/cron-workflows/cron-workflow-status-viewer.tsx similarity index 89% rename from ui/src/app/cron-workflows/components/cron-workflow-status-viewer.tsx rename to ui/src/app/cron-workflows/cron-workflow-status-viewer.tsx index c07576a1a17c..e3a72e9a6242 100644 --- a/ui/src/app/cron-workflows/components/cron-workflow-status-viewer.tsx +++ b/ui/src/app/cron-workflows/cron-workflow-status-viewer.tsx @@ -1,9 +1,10 @@ import * as kubernetes from 'argo-ui/src/models/kubernetes'; import * as React from 'react'; -import {CronWorkflowSpec, CronWorkflowStatus} from '../../../models'; -import {Timestamp} from '../../shared/components/timestamp'; -import {ConditionsPanel} from '../../shared/conditions-panel'; -import {WorkflowLink} from '../../workflows/components/workflow-link'; + +import {CronWorkflowSpec, CronWorkflowStatus} from '../../models'; +import {Timestamp} from '../shared/components/timestamp'; +import {ConditionsPanel} from '../shared/conditions-panel'; +import {WorkflowLink} from '../workflows/components/workflow-link'; import {PrettySchedule} from './pretty-schedule'; export function CronWorkflowStatusViewer({spec, status}: {spec: CronWorkflowSpec; status: CronWorkflowStatus}) { diff --git a/ui/src/app/cron-workflows/index.ts b/ui/src/app/cron-workflows/index.ts index 945686cef823..3fcfb4fc97c5 100644 --- a/ui/src/app/cron-workflows/index.ts +++ b/ui/src/app/cron-workflows/index.ts @@ -1,4 +1,4 @@ -import {CronWorkflowContainer} from './components/cron-workflow-container'; +import {CronWorkflowContainer} from './cron-workflow-container'; export default { component: CronWorkflowContainer diff --git a/ui/src/app/cron-workflows/components/pretty-schedule.tsx b/ui/src/app/cron-workflows/pretty-schedule.tsx similarity index 92% rename from ui/src/app/cron-workflows/components/pretty-schedule.tsx rename to ui/src/app/cron-workflows/pretty-schedule.tsx index f24a46db6e77..48c66cf1c4a3 100644 --- a/ui/src/app/cron-workflows/components/pretty-schedule.tsx +++ b/ui/src/app/cron-workflows/pretty-schedule.tsx @@ -1,7 +1,7 @@ import x from 'cronstrue'; import * as React from 'react'; -import {WarningIcon} from '../../shared/components/fa-icons'; +import {WarningIcon} from '../shared/components/fa-icons'; /* https://github.com/bradymholt/cRonstrue diff --git a/ui/src/app/cron-workflows/components/schedule-validator.tsx b/ui/src/app/cron-workflows/schedule-validator.tsx similarity index 88% rename from ui/src/app/cron-workflows/components/schedule-validator.tsx rename to ui/src/app/cron-workflows/schedule-validator.tsx index 2521c8671d85..587ddbeb520d 100644 --- a/ui/src/app/cron-workflows/components/schedule-validator.tsx +++ b/ui/src/app/cron-workflows/schedule-validator.tsx @@ -1,7 +1,7 @@ import x from 'cronstrue'; import * as React from 'react'; -import {SuccessIcon, WarningIcon} from '../../shared/components/fa-icons'; +import {SuccessIcon, WarningIcon} from '../shared/components/fa-icons'; export function ScheduleValidator({schedule}: {schedule: string}) { try { diff --git a/ui/src/app/event-flow/components/event-flow-details/build-graph.test.ts b/ui/src/app/event-flow/build-graph.test.ts similarity index 89% rename from ui/src/app/event-flow/components/event-flow-details/build-graph.test.ts rename to ui/src/app/event-flow/build-graph.test.ts index 12e1b7f214c1..370d9f666c96 100644 --- a/ui/src/app/event-flow/components/event-flow-details/build-graph.test.ts +++ b/ui/src/app/event-flow/build-graph.test.ts @@ -1,4 +1,4 @@ -import {Node, NodeLabel} from '../../../shared/components/graph/types'; +import {Node, NodeLabel} from '../shared/components/graph/types'; import {buildGraph} from './build-graph'; describe('build graph', () => { diff --git a/ui/src/app/event-flow/components/event-flow-details/build-graph.ts b/ui/src/app/event-flow/build-graph.ts similarity index 94% rename from ui/src/app/event-flow/components/event-flow-details/build-graph.ts rename to ui/src/app/event-flow/build-graph.ts index 455b04219566..805f839116b8 100644 --- a/ui/src/app/event-flow/components/event-flow-details/build-graph.ts +++ b/ui/src/app/event-flow/build-graph.ts @@ -1,8 +1,8 @@ -import {Condition, Workflow} from '../../../../models'; -import {EventSource, EventSourceType} from '../../../../models/event-source'; -import {Sensor, TriggerType} from '../../../../models/sensor'; -import {Graph, Node} from '../../../shared/components/graph/types'; -import {icons as phaseIcons} from '../../../workflows/components/workflow-dag/icons'; +import {Condition, Workflow} from '../../models'; +import {EventSource, EventSourceType} from '../../models/event-source'; +import {Sensor, TriggerType} from '../../models/sensor'; +import {Graph, Node} from '../shared/components/graph/types'; +import {icons as phaseIcons} from '../workflows/components/workflow-dag/icons'; import {icons} from './icons'; import {ID} from './id'; diff --git a/ui/src/app/event-flow/components/event-flow-container.tsx b/ui/src/app/event-flow/event-flow-container.tsx similarity index 80% rename from ui/src/app/event-flow/components/event-flow-container.tsx rename to ui/src/app/event-flow/event-flow-container.tsx index a3f23f0b9140..b2a894cdbf46 100644 --- a/ui/src/app/event-flow/components/event-flow-container.tsx +++ b/ui/src/app/event-flow/event-flow-container.tsx @@ -1,6 +1,7 @@ import * as React from 'react'; import {Route, RouteComponentProps, Switch} from 'react-router'; -import {EventFlowPage} from './event-flow-details/event-flow-page'; + +import {EventFlowPage} from './event-flow-page'; export const EventFlowContainer = (props: RouteComponentProps) => ( diff --git a/ui/src/app/event-flow/components/event-flow-details/event-flow-page.scss b/ui/src/app/event-flow/event-flow-page.scss similarity index 100% rename from ui/src/app/event-flow/components/event-flow-details/event-flow-page.scss rename to ui/src/app/event-flow/event-flow-page.scss diff --git a/ui/src/app/event-flow/components/event-flow-details/event-flow-page.tsx b/ui/src/app/event-flow/event-flow-page.tsx similarity index 90% rename from ui/src/app/event-flow/components/event-flow-details/event-flow-page.tsx rename to ui/src/app/event-flow/event-flow-page.tsx index d147d389458d..96de8c31079c 100644 --- a/ui/src/app/event-flow/components/event-flow-details/event-flow-page.tsx +++ b/ui/src/app/event-flow/event-flow-page.tsx @@ -4,30 +4,31 @@ import * as React from 'react'; import {RouteComponentProps} from 'react-router-dom'; import {Observable} from 'rxjs'; import {filter, map} from 'rxjs/operators'; -import {kubernetes, Workflow} from '../../../../models'; -import {EventSource} from '../../../../models/event-source'; -import {Sensor} from '../../../../models/sensor'; -import {uiUrl} from '../../../shared/base'; -import {Button} from '../../../shared/components/button'; -import {ErrorNotice} from '../../../shared/components/error-notice'; -import {InfoIcon} from '../../../shared/components/fa-icons'; -import {GraphPanel} from '../../../shared/components/graph/graph-panel'; -import {Node} from '../../../shared/components/graph/types'; -import {Links} from '../../../shared/components/links'; -import {NamespaceFilter} from '../../../shared/components/namespace-filter'; -import {ResourceEditor} from '../../../shared/components/resource-editor/resource-editor'; -import {useCollectEvent} from '../../../shared/components/use-collect-event'; -import {ZeroState} from '../../../shared/components/zero-state'; -import {Context} from '../../../shared/context'; -import {Footnote} from '../../../shared/footnote'; -import {historyUrl} from '../../../shared/history'; -import {ListWatch} from '../../../shared/list-watch'; -import {RetryObservable} from '../../../shared/retry-observable'; -import {services} from '../../../shared/services'; -import {useQueryParams} from '../../../shared/use-query-params'; -import {Utils} from '../../../shared/utils'; -import {EventsPanel} from '../../../workflows/components/events-panel'; -import {FullHeightLogsViewer} from '../../../workflows/components/workflow-logs-viewer/full-height-logs-viewer'; + +import {kubernetes, Workflow} from '../../models'; +import {EventSource} from '../../models/event-source'; +import {Sensor} from '../../models/sensor'; +import {uiUrl} from '../shared/base'; +import {Button} from '../shared/components/button'; +import {ErrorNotice} from '../shared/components/error-notice'; +import {InfoIcon} from '../shared/components/fa-icons'; +import {GraphPanel} from '../shared/components/graph/graph-panel'; +import {Node} from '../shared/components/graph/types'; +import {Links} from '../shared/components/links'; +import {NamespaceFilter} from '../shared/components/namespace-filter'; +import {ResourceEditor} from '../shared/components/resource-editor/resource-editor'; +import {useCollectEvent} from '../shared/use-collect-event'; +import {ZeroState} from '../shared/components/zero-state'; +import {Context} from '../shared/context'; +import {Footnote} from '../shared/footnote'; +import {historyUrl} from '../shared/history'; +import {ListWatch} from '../shared/list-watch'; +import {RetryObservable} from '../shared/retry-observable'; +import {services} from '../shared/services'; +import {useQueryParams} from '../shared/use-query-params'; +import {Utils} from '../shared/utils'; +import {EventsPanel} from '../workflows/components/events-panel'; +import {FullHeightLogsViewer} from '../workflows/components/workflow-logs-viewer/full-height-logs-viewer'; import {buildGraph} from './build-graph'; import {genres} from './genres'; import {ID} from './id'; diff --git a/ui/src/app/event-flow/components/event-flow-details/genres.ts b/ui/src/app/event-flow/genres.ts similarity index 67% rename from ui/src/app/event-flow/components/event-flow-details/genres.ts rename to ui/src/app/event-flow/genres.ts index eaa61ab2f10f..16ecf134f690 100644 --- a/ui/src/app/event-flow/components/event-flow-details/genres.ts +++ b/ui/src/app/event-flow/genres.ts @@ -1,5 +1,5 @@ -import {EventSourceTypes} from '../../../../models/event-source'; -import {TriggerTypes} from '../../../../models/sensor'; +import {EventSourceTypes} from '../../models/event-source'; +import {TriggerTypes} from '../../models/sensor'; export const genres = (() => { const v: {[label: string]: boolean} = {sensor: true, conditions: true, workflow: true, collapsed: true}; diff --git a/ui/src/app/event-flow/components/event-flow-details/icons.ts b/ui/src/app/event-flow/icons.ts similarity index 96% rename from ui/src/app/event-flow/components/event-flow-details/icons.ts rename to ui/src/app/event-flow/icons.ts index b29883da3fbb..62b72d9b0f4e 100644 --- a/ui/src/app/event-flow/components/event-flow-details/icons.ts +++ b/ui/src/app/event-flow/icons.ts @@ -1,4 +1,4 @@ -import {Icon} from '../../../shared/components/icon'; +import {Icon} from '../shared/components/icon'; const chat = 'comment'; const compute = 'microchip'; diff --git a/ui/src/app/event-flow/components/event-flow-details/id.ts b/ui/src/app/event-flow/id.ts similarity index 100% rename from ui/src/app/event-flow/components/event-flow-details/id.ts rename to ui/src/app/event-flow/id.ts diff --git a/ui/src/app/event-flow/index.ts b/ui/src/app/event-flow/index.ts index 788840ea16cf..d4a6cbe4e858 100644 --- a/ui/src/app/event-flow/index.ts +++ b/ui/src/app/event-flow/index.ts @@ -1,4 +1,4 @@ -import {EventFlowContainer} from './components/event-flow-container'; +import {EventFlowContainer} from './event-flow-container'; export default { component: EventFlowContainer diff --git a/ui/src/app/event-sources/components/event-source-container.tsx b/ui/src/app/event-sources/event-source-container.tsx similarity index 73% rename from ui/src/app/event-sources/components/event-source-container.tsx rename to ui/src/app/event-sources/event-source-container.tsx index 253dd8457ffe..a61f232afdf2 100644 --- a/ui/src/app/event-sources/components/event-source-container.tsx +++ b/ui/src/app/event-sources/event-source-container.tsx @@ -1,7 +1,8 @@ import * as React from 'react'; import {Route, RouteComponentProps, Switch} from 'react-router'; -import {EventSourceDetails} from './event-source-details/event-source-details'; -import {EventSourceList} from './event-source-list/event-source-list'; + +import {EventSourceDetails} from './event-source-details'; +import {EventSourceList} from './event-source-list'; export const EventSourceContainer = (props: RouteComponentProps) => ( diff --git a/ui/src/app/event-sources/components/event-source-creator.tsx b/ui/src/app/event-sources/event-source-creator.tsx similarity index 79% rename from ui/src/app/event-sources/components/event-source-creator.tsx rename to ui/src/app/event-sources/event-source-creator.tsx index 71f7082dc5be..7ffaae028a3c 100644 --- a/ui/src/app/event-sources/components/event-source-creator.tsx +++ b/ui/src/app/event-sources/event-source-creator.tsx @@ -1,13 +1,13 @@ import * as React from 'react'; import {useState} from 'react'; -import {EventSource} from '../../../models'; -import {Button} from '../../shared/components/button'; -import {ErrorNotice} from '../../shared/components/error-notice'; -import {UploadButton} from '../../shared/components/upload-button'; -import {exampleEventSource} from '../../shared/examples'; -import {services} from '../../shared/services'; -import {Utils} from '../../shared/utils'; +import {EventSource} from '../../models'; +import {Button} from '../shared/components/button'; +import {ErrorNotice} from '../shared/components/error-notice'; +import {UploadButton} from '../shared/components/upload-button'; +import {exampleEventSource} from '../shared/examples'; +import {services} from '../shared/services'; +import {Utils} from '../shared/utils'; import {EventSourceEditor} from './event-source-editor'; export function EventSourceCreator({onCreate, namespace}: {namespace: string; onCreate: (eventSource: EventSource) => void}) { diff --git a/ui/src/app/event-sources/components/event-source-details/event-source-details.tsx b/ui/src/app/event-sources/event-source-details.tsx similarity index 89% rename from ui/src/app/event-sources/components/event-source-details/event-source-details.tsx rename to ui/src/app/event-sources/event-source-details.tsx index 9bc89576d6a0..65383afcb5cf 100644 --- a/ui/src/app/event-sources/components/event-source-details/event-source-details.tsx +++ b/ui/src/app/event-sources/event-source-details.tsx @@ -3,19 +3,20 @@ import {SlidingPanel, Tabs} from 'argo-ui/src/index'; import * as React from 'react'; import {useContext, useEffect, useState} from 'react'; import {RouteComponentProps} from 'react-router'; -import {EventSource} from '../../../../models'; -import {ID} from '../../../event-flow/components/event-flow-details/id'; -import {uiUrl} from '../../../shared/base'; -import {ErrorNotice} from '../../../shared/components/error-notice'; -import {Loading} from '../../../shared/components/loading'; -import {useCollectEvent} from '../../../shared/components/use-collect-event'; -import {Context} from '../../../shared/context'; -import {historyUrl} from '../../../shared/history'; -import {services} from '../../../shared/services'; -import {useQueryParams} from '../../../shared/use-query-params'; -import {EventsPanel} from '../../../workflows/components/events-panel'; -import {EventSourceEditor} from '../event-source-editor'; -import {EventSourceLogsViewer} from '../event-source-log-viewer'; + +import {EventSource} from '../../models'; +import {ID} from '../event-flow/id'; +import {uiUrl} from '../shared/base'; +import {ErrorNotice} from '../shared/components/error-notice'; +import {Loading} from '../shared/components/loading'; +import {useCollectEvent} from '../shared/use-collect-event'; +import {Context} from '../shared/context'; +import {historyUrl} from '../shared/history'; +import {services} from '../shared/services'; +import {useQueryParams} from '../shared/use-query-params'; +import {EventsPanel} from '../workflows/components/events-panel'; +import {EventSourceEditor} from './event-source-editor'; +import {EventSourceLogsViewer} from './event-source-log-viewer'; export function EventSourceDetails({history, location, match}: RouteComponentProps) { // boiler-plate diff --git a/ui/src/app/event-sources/components/event-source-editor.tsx b/ui/src/app/event-sources/event-source-editor.tsx similarity index 84% rename from ui/src/app/event-sources/components/event-source-editor.tsx rename to ui/src/app/event-sources/event-source-editor.tsx index 4630660be1f9..d20fce3d156f 100644 --- a/ui/src/app/event-sources/components/event-source-editor.tsx +++ b/ui/src/app/event-sources/event-source-editor.tsx @@ -1,9 +1,9 @@ import * as React from 'react'; - import {Tabs} from 'argo-ui'; -import {EventSource} from '../../../models'; -import {MetadataEditor} from '../../shared/components/editors/metadata-editor'; -import {ObjectEditor} from '../../shared/components/object-editor/object-editor'; + +import {EventSource} from '../../models'; +import {MetadataEditor} from '../shared/components/editors/metadata-editor'; +import {ObjectEditor} from '../shared/components/object-editor'; export function EventSourceEditor({ onChange, diff --git a/ui/src/app/event-sources/components/event-source-list/event-source-list.scss b/ui/src/app/event-sources/event-source-list.scss similarity index 100% rename from ui/src/app/event-sources/components/event-source-list/event-source-list.scss rename to ui/src/app/event-sources/event-source-list.scss diff --git a/ui/src/app/event-sources/components/event-source-list/event-source-list.tsx b/ui/src/app/event-sources/event-source-list.tsx similarity index 86% rename from ui/src/app/event-sources/components/event-source-list/event-source-list.tsx rename to ui/src/app/event-sources/event-source-list.tsx index d71a61ffee5d..b626be613e71 100644 --- a/ui/src/app/event-sources/components/event-source-list/event-source-list.tsx +++ b/ui/src/app/event-sources/event-source-list.tsx @@ -3,26 +3,27 @@ import classNames from 'classnames'; import * as React from 'react'; import {useContext, useEffect, useState} from 'react'; import {Link, RouteComponentProps} from 'react-router-dom'; -import {EventSource, kubernetes} from '../../../../models'; -import {ID} from '../../../event-flow/components/event-flow-details/id'; -import {Utils as EventsUtils} from '../../../sensors/components/utils'; -import {uiUrl} from '../../../shared/base'; -import {ErrorNotice} from '../../../shared/components/error-notice'; -import {Node} from '../../../shared/components/graph/types'; -import {Loading} from '../../../shared/components/loading'; -import {NamespaceFilter} from '../../../shared/components/namespace-filter'; -import {Timestamp} from '../../../shared/components/timestamp'; -import {useCollectEvent} from '../../../shared/components/use-collect-event'; -import {ZeroState} from '../../../shared/components/zero-state'; -import {Context} from '../../../shared/context'; -import {Footnote} from '../../../shared/footnote'; -import {historyUrl} from '../../../shared/history'; -import {services} from '../../../shared/services'; -import {useQueryParams} from '../../../shared/use-query-params'; -import {Utils} from '../../../shared/utils'; -import {EventsPanel} from '../../../workflows/components/events-panel'; -import {EventSourceCreator} from '../event-source-creator'; -import {EventSourceLogsViewer} from '../event-source-log-viewer'; + +import {EventSource, kubernetes} from '../../models'; +import {ID} from '../event-flow/id'; +import {Utils as EventsUtils} from '../sensors/utils'; +import {uiUrl} from '../shared/base'; +import {ErrorNotice} from '../shared/components/error-notice'; +import {Node} from '../shared/components/graph/types'; +import {Loading} from '../shared/components/loading'; +import {NamespaceFilter} from '../shared/components/namespace-filter'; +import {Timestamp} from '../shared/components/timestamp'; +import {useCollectEvent} from '../shared/use-collect-event'; +import {ZeroState} from '../shared/components/zero-state'; +import {Context} from '../shared/context'; +import {Footnote} from '../shared/footnote'; +import {historyUrl} from '../shared/history'; +import {services} from '../shared/services'; +import {useQueryParams} from '../shared/use-query-params'; +import {Utils} from '../shared/utils'; +import {EventsPanel} from '../workflows/components/events-panel'; +import {EventSourceCreator} from './event-source-creator'; +import {EventSourceLogsViewer} from './event-source-log-viewer'; const learnMore = Learn more; diff --git a/ui/src/app/event-sources/components/event-source-log-viewer.tsx b/ui/src/app/event-sources/event-source-log-viewer.tsx similarity index 93% rename from ui/src/app/event-sources/components/event-source-log-viewer.tsx rename to ui/src/app/event-sources/event-source-log-viewer.tsx index 1a5d2f1bb9da..7bfe4b3431eb 100644 --- a/ui/src/app/event-sources/components/event-source-log-viewer.tsx +++ b/ui/src/app/event-sources/event-source-log-viewer.tsx @@ -2,11 +2,12 @@ import * as React from 'react'; import {useEffect, useState} from 'react'; import {Observable} from 'rxjs'; import {filter, map} from 'rxjs/operators'; -import {EventSource} from '../../../models'; -import {ErrorNotice} from '../../shared/components/error-notice'; -import {Links} from '../../shared/components/links'; -import {services} from '../../shared/services'; -import {FullHeightLogsViewer} from '../../workflows/components/workflow-logs-viewer/full-height-logs-viewer'; + +import {EventSource} from '../../models'; +import {ErrorNotice} from '../shared/components/error-notice'; +import {Links} from '../shared/components/links'; +import {services} from '../shared/services'; +import {FullHeightLogsViewer} from '../workflows/components/workflow-logs-viewer/full-height-logs-viewer'; function identity(value: T) { return () => value; diff --git a/ui/src/app/event-sources/index.ts b/ui/src/app/event-sources/index.ts index 73e5587e8867..61934bb46a72 100644 --- a/ui/src/app/event-sources/index.ts +++ b/ui/src/app/event-sources/index.ts @@ -1,4 +1,4 @@ -import {EventSourceContainer} from './components/event-source-container'; +import {EventSourceContainer} from './event-source-container'; export default { component: EventSourceContainer diff --git a/ui/src/app/help/components/help.scss b/ui/src/app/help/help.scss similarity index 100% rename from ui/src/app/help/components/help.scss rename to ui/src/app/help/help.scss diff --git a/ui/src/app/help/components/help.tsx b/ui/src/app/help/help.tsx similarity index 94% rename from ui/src/app/help/components/help.tsx rename to ui/src/app/help/help.tsx index 6c8efe75cfae..77c89ceb7b9f 100644 --- a/ui/src/app/help/components/help.tsx +++ b/ui/src/app/help/help.tsx @@ -1,8 +1,8 @@ import {Page} from 'argo-ui'; import * as React from 'react'; -import {uiUrl} from '../../shared/base'; -import {useCollectEvent} from '../../shared/components/use-collect-event'; +import {uiUrl} from '../shared/base'; +import {useCollectEvent} from '../shared/use-collect-event'; import './help.scss'; diff --git a/ui/src/app/help/index.tsx b/ui/src/app/help/index.ts similarity index 50% rename from ui/src/app/help/index.tsx rename to ui/src/app/help/index.ts index 528655e48bd0..24393e937fdb 100644 --- a/ui/src/app/help/index.tsx +++ b/ui/src/app/help/index.ts @@ -1,4 +1,4 @@ -import {Help} from './components/help'; +import {Help} from './help'; export default { component: Help diff --git a/ui/src/app/login/index.tsx b/ui/src/app/login/index.ts similarity index 50% rename from ui/src/app/login/index.tsx rename to ui/src/app/login/index.ts index 19f298b2c65a..5235adb462a8 100644 --- a/ui/src/app/login/index.tsx +++ b/ui/src/app/login/index.ts @@ -1,4 +1,4 @@ -import {Login} from './components/login'; +import {Login} from './login'; export default { component: Login diff --git a/ui/src/app/login/components/login.scss b/ui/src/app/login/login.scss similarity index 100% rename from ui/src/app/login/components/login.scss rename to ui/src/app/login/login.scss diff --git a/ui/src/app/login/components/login.tsx b/ui/src/app/login/login.tsx similarity index 96% rename from ui/src/app/login/components/login.tsx rename to ui/src/app/login/login.tsx index 93ff29899d04..a932609f6478 100644 --- a/ui/src/app/login/components/login.tsx +++ b/ui/src/app/login/login.tsx @@ -1,8 +1,8 @@ import {Page} from 'argo-ui'; import * as React from 'react'; -import {uiUrl, uiUrlWithParams} from '../../shared/base'; -import {useCollectEvent} from '../../shared/components/use-collect-event'; +import {uiUrl, uiUrlWithParams} from '../shared/base'; +import {useCollectEvent} from '../shared/use-collect-event'; import './login.scss'; diff --git a/ui/src/app/modals/feedback/feedback-modal.tsx b/ui/src/app/modals/feedback-modal.tsx similarity index 80% rename from ui/src/app/modals/feedback/feedback-modal.tsx rename to ui/src/app/modals/feedback-modal.tsx index cb19f05a2291..d0844b813e80 100644 --- a/ui/src/app/modals/feedback/feedback-modal.tsx +++ b/ui/src/app/modals/feedback-modal.tsx @@ -1,8 +1,8 @@ import * as React from 'react'; import {useState} from 'react'; -import {BigButton} from '../../shared/components/big-button'; -import {Modal} from '../../shared/components/modal/modal'; -import {SurveyButton} from '../../shared/components/survey-button'; +import {BigButton} from '../shared/components/big-button'; +import {Modal} from '../shared/components/modal/modal'; +import {SurveyButton} from '../shared/components/survey-button'; export function FeedbackModal({dismiss}: {dismiss: () => void}) { const [choice, setChoice] = useState(0); diff --git a/ui/src/app/modals/first-time-user/first-time-user-modal.tsx b/ui/src/app/modals/first-time-user-modal.tsx similarity index 84% rename from ui/src/app/modals/first-time-user/first-time-user-modal.tsx rename to ui/src/app/modals/first-time-user-modal.tsx index 53299370475d..58e99671bab4 100644 --- a/ui/src/app/modals/first-time-user/first-time-user-modal.tsx +++ b/ui/src/app/modals/first-time-user-modal.tsx @@ -1,8 +1,9 @@ import * as React from 'react'; -import {BigButton} from '../../shared/components/big-button'; -import {Icon} from '../../shared/components/icon'; -import {Modal} from '../../shared/components/modal/modal'; -import {SurveyButton} from '../../shared/components/survey-button'; + +import {BigButton} from '../shared/components/big-button'; +import {Icon} from '../shared/components/icon'; +import {Modal} from '../shared/components/modal/modal'; +import {SurveyButton} from '../shared/components/survey-button'; /** * The intention of this modal is to: diff --git a/ui/src/app/modals/modal-switch.tsx b/ui/src/app/modals/modal-switch.tsx index 3a132e6d0cb1..77a9e01f3e52 100644 --- a/ui/src/app/modals/modal-switch.tsx +++ b/ui/src/app/modals/modal-switch.tsx @@ -1,9 +1,10 @@ import * as React from 'react'; import {useEffect, useState} from 'react'; + import {ScopedLocalStorage} from '../shared/scoped-local-storage'; -import {FeedbackModal} from './feedback/feedback-modal'; -import {FirstTimeUserModal} from './first-time-user/first-time-user-modal'; -import {NewVersionModal} from './new-version/new-version-modal'; +import {FeedbackModal} from './feedback-modal'; +import {FirstTimeUserModal} from './first-time-user-modal'; +import {NewVersionModal} from './new-version-modal'; import {majorMinor} from './version'; export function ModalSwitch({version, modals}: {version: string; modals: {[key: string]: boolean}}) { diff --git a/ui/src/app/modals/new-version/new-version-modal.scss b/ui/src/app/modals/new-version-modal.scss similarity index 100% rename from ui/src/app/modals/new-version/new-version-modal.scss rename to ui/src/app/modals/new-version-modal.scss diff --git a/ui/src/app/modals/new-version/new-version-modal.tsx b/ui/src/app/modals/new-version-modal.tsx similarity index 96% rename from ui/src/app/modals/new-version/new-version-modal.tsx rename to ui/src/app/modals/new-version-modal.tsx index 79c4fe379bbe..445de8b92ac5 100644 --- a/ui/src/app/modals/new-version/new-version-modal.tsx +++ b/ui/src/app/modals/new-version-modal.tsx @@ -1,14 +1,14 @@ import * as React from 'react'; -import {Modal} from '../../shared/components/modal/modal'; -import {SurveyButton} from '../../shared/components/survey-button'; +import {Modal} from '../shared/components/modal/modal'; +import {SurveyButton} from '../shared/components/survey-button'; import './new-version-modal.scss'; /** * The intention of this modal is to encourage update of new features. */ -export const NewVersionModal = ({version, dismiss}: {version: string; dismiss: () => void}) => { +export function NewVersionModal({version, dismiss}: {version: string; dismiss: () => void}) { return (
@@ -139,4 +139,4 @@ export const NewVersionModal = ({version, dismiss}: {version: string; dismiss: (

); -}; +} diff --git a/ui/src/app/modals/version.ts b/ui/src/app/modals/version.ts new file mode 100644 index 000000000000..9e12c68d8a90 --- /dev/null +++ b/ui/src/app/modals/version.ts @@ -0,0 +1,6 @@ +export function majorMinor(version: string) { + if (version.includes('.')) { + return version.substring(0, version.lastIndexOf('.')); + } + return version; +} diff --git a/ui/src/app/modals/version.tsx b/ui/src/app/modals/version.tsx deleted file mode 100644 index 009f61129d32..000000000000 --- a/ui/src/app/modals/version.tsx +++ /dev/null @@ -1 +0,0 @@ -export const majorMinor = (version: string) => (version.includes('.') ? version.substr(0, version.lastIndexOf('.')) : version); diff --git a/ui/src/app/plugins/index.ts b/ui/src/app/plugins/index.ts index 0781f70bf032..f6580d6e8878 100644 --- a/ui/src/app/plugins/index.ts +++ b/ui/src/app/plugins/index.ts @@ -1,4 +1,4 @@ -import {PluginsContainer} from './components/plugins-container'; +import {PluginsContainer} from './plugins-container'; export default { component: PluginsContainer diff --git a/ui/src/app/plugins/components/plugin-list/plugin-list.tsx b/ui/src/app/plugins/plugin-list.tsx similarity index 81% rename from ui/src/app/plugins/components/plugin-list/plugin-list.tsx rename to ui/src/app/plugins/plugin-list.tsx index a08618de2a98..1941d1a7c5c5 100644 --- a/ui/src/app/plugins/components/plugin-list/plugin-list.tsx +++ b/ui/src/app/plugins/plugin-list.tsx @@ -2,11 +2,12 @@ import {Page} from 'argo-ui'; import * as React from 'react'; import {useEffect, useState} from 'react'; import {RouteComponentProps} from 'react-router-dom'; -import {uiUrl} from '../../../shared/base'; -import {useCollectEvent} from '../../../shared/components/use-collect-event'; -import {ZeroState} from '../../../shared/components/zero-state'; -import {historyUrl} from '../../../shared/history'; -import {Utils} from '../../../shared/utils'; + +import {uiUrl} from '../shared/base'; +import {useCollectEvent} from '../shared/use-collect-event'; +import {ZeroState} from '../shared/components/zero-state'; +import {historyUrl} from '../shared/history'; +import {Utils} from '../shared/utils'; export function PluginList({match, history}: RouteComponentProps) { // state for URL and query parameters diff --git a/ui/src/app/plugins/components/plugins-container.tsx b/ui/src/app/plugins/plugins-container.tsx similarity index 84% rename from ui/src/app/plugins/components/plugins-container.tsx rename to ui/src/app/plugins/plugins-container.tsx index 7d463c1d6ab7..4cf7a0a405ac 100644 --- a/ui/src/app/plugins/components/plugins-container.tsx +++ b/ui/src/app/plugins/plugins-container.tsx @@ -1,6 +1,7 @@ import * as React from 'react'; import {Route, RouteComponentProps, Switch} from 'react-router'; -import {PluginList} from './plugin-list/plugin-list'; + +import {PluginList} from './plugin-list'; export const PluginsContainer = (props: RouteComponentProps) => ( diff --git a/ui/src/app/reports/index.ts b/ui/src/app/reports/index.ts index dc4bddb32659..bf7183e7ca23 100644 --- a/ui/src/app/reports/index.ts +++ b/ui/src/app/reports/index.ts @@ -1,4 +1,4 @@ -import {ReportsContainer} from './components/report-container'; +import {ReportsContainer} from './report-container'; export default { component: ReportsContainer diff --git a/ui/src/app/reports/components/report-container.tsx b/ui/src/app/reports/report-container.tsx similarity index 92% rename from ui/src/app/reports/components/report-container.tsx rename to ui/src/app/reports/report-container.tsx index 1bd13a631105..2d399d4accf7 100644 --- a/ui/src/app/reports/components/report-container.tsx +++ b/ui/src/app/reports/report-container.tsx @@ -1,6 +1,7 @@ import * as React from 'react'; import {Route, RouteComponentProps, Switch} from 'react-router'; -import {Loading} from '../../shared/components/loading'; + +import {Loading} from '../shared/components/loading'; export const ReportsContainer = (props: RouteComponentProps) => ( diff --git a/ui/src/app/reports/components/reports-filters.scss b/ui/src/app/reports/reports-filters.scss similarity index 100% rename from ui/src/app/reports/components/reports-filters.scss rename to ui/src/app/reports/reports-filters.scss diff --git a/ui/src/app/reports/components/reports-filters.tsx b/ui/src/app/reports/reports-filters.tsx similarity index 92% rename from ui/src/app/reports/components/reports-filters.tsx rename to ui/src/app/reports/reports-filters.tsx index 06f1094bb156..f5035f1705a4 100644 --- a/ui/src/app/reports/components/reports-filters.tsx +++ b/ui/src/app/reports/reports-filters.tsx @@ -1,10 +1,10 @@ import * as React from 'react'; -import {NODE_PHASE} from '../../../models'; -import {DataLoaderDropdown} from '../../shared/components/data-loader-dropdown'; -import {NamespaceFilter} from '../../shared/components/namespace-filter'; -import {TagsInput} from '../../shared/components/tags-input/tags-input'; -import {services} from '../../shared/services'; +import {NODE_PHASE} from '../../models'; +import {DataLoaderDropdown} from '../shared/components/data-loader-dropdown'; +import {NamespaceFilter} from '../shared/components/namespace-filter'; +import {TagsInput} from '../shared/components/tags-input/tags-input'; +import {services} from '../shared/services'; import './reports-filters.scss'; diff --git a/ui/src/app/reports/components/reports.tsx b/ui/src/app/reports/reports.tsx similarity index 91% rename from ui/src/app/reports/components/reports.tsx rename to ui/src/app/reports/reports.tsx index 2e7244bb8e68..d686347a7c5e 100644 --- a/ui/src/app/reports/components/reports.tsx +++ b/ui/src/app/reports/reports.tsx @@ -5,16 +5,17 @@ import * as React from 'react'; import {useContext, useEffect, useState} from 'react'; import {Bar, ChartData} from 'react-chartjs-2'; import {RouteComponentProps} from 'react-router-dom'; -import {uiUrl} from '../../shared/base'; -import {ErrorNotice} from '../../shared/components/error-notice'; -import {InfoIcon} from '../../shared/components/fa-icons'; -import {useCollectEvent} from '../../shared/components/use-collect-event'; -import {ZeroState} from '../../shared/components/zero-state'; -import {Context} from '../../shared/context'; -import {Footnote} from '../../shared/footnote'; -import {historyUrl} from '../../shared/history'; -import {services} from '../../shared/services'; -import {Utils} from '../../shared/utils'; + +import {uiUrl} from '../shared/base'; +import {ErrorNotice} from '../shared/components/error-notice'; +import {InfoIcon} from '../shared/components/fa-icons'; +import {useCollectEvent} from '../shared/use-collect-event'; +import {ZeroState} from '../shared/components/zero-state'; +import {Context} from '../shared/context'; +import {Footnote} from '../shared/footnote'; +import {historyUrl} from '../shared/history'; +import {services} from '../shared/services'; +import {Utils} from '../shared/utils'; import {ReportFilters} from './reports-filters'; import {workflowsToChartData} from './workflows-to-chart-data'; diff --git a/ui/src/app/reports/components/workflows-to-chart-data.ts b/ui/src/app/reports/workflows-to-chart-data.ts similarity index 97% rename from ui/src/app/reports/components/workflows-to-chart-data.ts rename to ui/src/app/reports/workflows-to-chart-data.ts index a8c2efae9479..2cf6b67f17ce 100644 --- a/ui/src/app/reports/components/workflows-to-chart-data.ts +++ b/ui/src/app/reports/workflows-to-chart-data.ts @@ -1,5 +1,5 @@ -import {getColorForNodePhase, Workflow} from '../../../models'; -import {denominator} from '../../shared/duration'; +import {getColorForNodePhase, Workflow} from '../../models'; +import {denominator} from '../shared/duration'; export function workflowsToChartData(workflows: Workflow[], limit: number) { const filteredWorkflows = workflows diff --git a/ui/src/app/sensors/index.ts b/ui/src/app/sensors/index.ts index 6eec6b77b63c..fa5e2eef55c9 100644 --- a/ui/src/app/sensors/index.ts +++ b/ui/src/app/sensors/index.ts @@ -1,4 +1,4 @@ -import {SensorsContainer} from './components/sensors-container'; +import {SensorsContainer} from './sensors-container'; export default { component: SensorsContainer diff --git a/ui/src/app/sensors/components/sensor-creator.tsx b/ui/src/app/sensors/sensor-creator.tsx similarity index 78% rename from ui/src/app/sensors/components/sensor-creator.tsx rename to ui/src/app/sensors/sensor-creator.tsx index 0edb6d80261e..04a98020046a 100644 --- a/ui/src/app/sensors/components/sensor-creator.tsx +++ b/ui/src/app/sensors/sensor-creator.tsx @@ -1,13 +1,13 @@ import * as React from 'react'; import {useState} from 'react'; -import {Sensor} from '../../../models'; -import {Button} from '../../shared/components/button'; -import {ErrorNotice} from '../../shared/components/error-notice'; -import {UploadButton} from '../../shared/components/upload-button'; -import {exampleSensor} from '../../shared/examples'; -import {services} from '../../shared/services'; -import {Utils} from '../../shared/utils'; +import {Sensor} from '../../models'; +import {Button} from '../shared/components/button'; +import {ErrorNotice} from '../shared/components/error-notice'; +import {UploadButton} from '../shared/components/upload-button'; +import {exampleSensor} from '../shared/examples'; +import {services} from '../shared/services'; +import {Utils} from '../shared/utils'; import {SensorEditor} from './sensor-editor'; export function SensorCreator({namespace, onCreate}: {namespace: string; onCreate: (sensor: Sensor) => void}) { diff --git a/ui/src/app/sensors/components/sensor-details/sensor-details.tsx b/ui/src/app/sensors/sensor-details.tsx similarity index 85% rename from ui/src/app/sensors/components/sensor-details/sensor-details.tsx rename to ui/src/app/sensors/sensor-details.tsx index 1e69de361186..52d262961a3f 100644 --- a/ui/src/app/sensors/components/sensor-details/sensor-details.tsx +++ b/ui/src/app/sensors/sensor-details.tsx @@ -3,21 +3,21 @@ import * as React from 'react'; import {useContext, useEffect, useState} from 'react'; import {RouteComponentProps} from 'react-router'; -import {Sensor} from '../../../../models'; -import {ID} from '../../../event-flow/components/event-flow-details/id'; -import {uiUrl} from '../../../shared/base'; -import {ErrorNotice} from '../../../shared/components/error-notice'; -import {Node} from '../../../shared/components/graph/types'; -import {Loading} from '../../../shared/components/loading'; -import {useCollectEvent} from '../../../shared/components/use-collect-event'; -import {Context} from '../../../shared/context'; -import {historyUrl} from '../../../shared/history'; -import {services} from '../../../shared/services'; -import {useQueryParams} from '../../../shared/use-query-params'; -import {SensorEditor} from '../sensor-editor'; -import {SensorSidePanel} from '../sensor-side-panel'; +import {Sensor} from '../../models'; +import {ID} from '../event-flow/id'; +import {uiUrl} from '../shared/base'; +import {ErrorNotice} from '../shared/components/error-notice'; +import {Node} from '../shared/components/graph/types'; +import {Loading} from '../shared/components/loading'; +import {useCollectEvent} from '../shared/use-collect-event'; +import {Context} from '../shared/context'; +import {historyUrl} from '../shared/history'; +import {services} from '../shared/services'; +import {useQueryParams} from '../shared/use-query-params'; +import {SensorEditor} from './sensor-editor'; +import {SensorSidePanel} from './sensor-side-panel'; -import '../../../workflows/components/workflow-details/workflow-details.scss'; +import '../workflows/components/workflow-details/workflow-details.scss'; export function SensorDetails({match, location, history}: RouteComponentProps) { // boiler-plate diff --git a/ui/src/app/sensors/components/sensor-editor.tsx b/ui/src/app/sensors/sensor-editor.tsx similarity index 80% rename from ui/src/app/sensors/components/sensor-editor.tsx rename to ui/src/app/sensors/sensor-editor.tsx index c75eb8dc2d78..b2a676a659e0 100644 --- a/ui/src/app/sensors/components/sensor-editor.tsx +++ b/ui/src/app/sensors/sensor-editor.tsx @@ -1,11 +1,11 @@ import * as React from 'react'; - import {Tabs} from 'argo-ui'; -import {Sensor} from '../../../models'; -import {MetadataEditor} from '../../shared/components/editors/metadata-editor'; -import {ObjectEditor} from '../../shared/components/object-editor/object-editor'; -export const SensorEditor = ({ +import {Sensor} from '../../models'; +import {MetadataEditor} from '../shared/components/editors/metadata-editor'; +import {ObjectEditor} from '../shared/components/object-editor'; + +export function SensorEditor({ onChange, onTabSelected, selectedTabKey, @@ -16,7 +16,7 @@ export const SensorEditor = ({ onError: (error: Error) => void; onTabSelected?: (tab: string) => void; selectedTabKey?: string; -}) => { +}) { return ( ); -}; +} diff --git a/ui/src/app/sensors/components/sensor-list/sensor-list.tsx b/ui/src/app/sensors/sensor-list.tsx similarity index 85% rename from ui/src/app/sensors/components/sensor-list/sensor-list.tsx rename to ui/src/app/sensors/sensor-list.tsx index 8bb4d32a40cc..b8240c572598 100644 --- a/ui/src/app/sensors/components/sensor-list/sensor-list.tsx +++ b/ui/src/app/sensors/sensor-list.tsx @@ -3,29 +3,30 @@ import classNames from 'classnames'; import * as React from 'react'; import {useContext, useEffect, useState} from 'react'; import {Link, RouteComponentProps} from 'react-router-dom'; -import {kubernetes, Sensor} from '../../../../models'; -import {ID} from '../../../event-flow/components/event-flow-details/id'; -import {uiUrl} from '../../../shared/base'; -import {ErrorNotice} from '../../../shared/components/error-notice'; -import {Node} from '../../../shared/components/graph/types'; -import {Loading} from '../../../shared/components/loading'; -import {NamespaceFilter} from '../../../shared/components/namespace-filter'; -import {Timestamp} from '../../../shared/components/timestamp'; -import {useCollectEvent} from '../../../shared/components/use-collect-event'; -import {ZeroState} from '../../../shared/components/zero-state'; -import {Context} from '../../../shared/context'; -import {Footnote} from '../../../shared/footnote'; -import {historyUrl} from '../../../shared/history'; -import {services} from '../../../shared/services'; -import {useQueryParams} from '../../../shared/use-query-params'; -import {Utils} from '../../../shared/utils'; -import {SensorCreator} from '../sensor-creator'; -import {SensorSidePanel} from '../sensor-side-panel'; -import {Utils as EventsUtils} from '../utils'; + +import {kubernetes, Sensor} from '../../models'; +import {ID} from '../event-flow/id'; +import {uiUrl} from '../shared/base'; +import {ErrorNotice} from '../shared/components/error-notice'; +import {Node} from '../shared/components/graph/types'; +import {Loading} from '../shared/components/loading'; +import {NamespaceFilter} from '../shared/components/namespace-filter'; +import {Timestamp} from '../shared/components/timestamp'; +import {useCollectEvent} from '../shared/use-collect-event'; +import {ZeroState} from '../shared/components/zero-state'; +import {Context} from '../shared/context'; +import {Footnote} from '../shared/footnote'; +import {historyUrl} from '../shared/history'; +import {services} from '../shared/services'; +import {useQueryParams} from '../shared/use-query-params'; +import {Utils} from '../shared/utils'; +import {SensorCreator} from './sensor-creator'; +import {SensorSidePanel} from './sensor-side-panel'; +import {Utils as EventsUtils} from './utils'; const learnMore = Learn more; -export const SensorList = ({match, location, history}: RouteComponentProps) => { +export function SensorList({match, location, history}: RouteComponentProps) { // boiler-plate const queryParams = new URLSearchParams(location.search); const {navigation} = useContext(Context); @@ -170,4 +171,4 @@ export const SensorList = ({match, location, history}: RouteComponentProps) )} ); -}; +} diff --git a/ui/src/app/sensors/components/sensor-logs-viewer.tsx b/ui/src/app/sensors/sensor-logs-viewer.tsx similarity index 91% rename from ui/src/app/sensors/components/sensor-logs-viewer.tsx rename to ui/src/app/sensors/sensor-logs-viewer.tsx index 84bf19ffb2b7..039fe4560d6b 100644 --- a/ui/src/app/sensors/components/sensor-logs-viewer.tsx +++ b/ui/src/app/sensors/sensor-logs-viewer.tsx @@ -2,17 +2,18 @@ import * as React from 'react'; import {useEffect, useState} from 'react'; import {Observable} from 'rxjs'; import {filter, map, publishReplay, refCount} from 'rxjs/operators'; -import {Sensor} from '../../../models'; -import {ErrorNotice} from '../../shared/components/error-notice'; -import {Links} from '../../shared/components/links'; -import {services} from '../../shared/services'; -import {FullHeightLogsViewer} from '../../workflows/components/workflow-logs-viewer/full-height-logs-viewer'; + +import {Sensor} from '../../models'; +import {ErrorNotice} from '../shared/components/error-notice'; +import {Links} from '../shared/components/links'; +import {services} from '../shared/services'; +import {FullHeightLogsViewer} from '../workflows/components/workflow-logs-viewer/full-height-logs-viewer'; function identity(value: T) { return () => value; } -export const SensorLogsViewer = ({ +export function SensorLogsViewer({ namespace, selectedTrigger, sensor, @@ -22,7 +23,7 @@ export const SensorLogsViewer = ({ selectedTrigger: string; sensor: Sensor; onClick: (selectedNode: string) => void; -}) => { +}) { const [error, setError] = useState(); const [logsObservable, setLogsObservable] = useState>(); const [logLoaded, setLogLoaded] = useState(false); @@ -102,4 +103,4 @@ export const SensorLogsViewer = ({
); -}; +} diff --git a/ui/src/app/sensors/components/sensor-side-panel.tsx b/ui/src/app/sensors/sensor-side-panel.tsx similarity index 89% rename from ui/src/app/sensors/components/sensor-side-panel.tsx rename to ui/src/app/sensors/sensor-side-panel.tsx index abb7c8d414d4..76ce67c5aace 100644 --- a/ui/src/app/sensors/components/sensor-side-panel.tsx +++ b/ui/src/app/sensors/sensor-side-panel.tsx @@ -1,12 +1,12 @@ import {SlidingPanel, Tabs} from 'argo-ui'; import * as React from 'react'; import {useState} from 'react'; -import {Sensor} from '../../../models'; -import {Node} from '../../shared/components/graph/types'; -import {EventsPanel} from '../../workflows/components/events-panel'; +import {Sensor} from '../../models'; +import {Node} from '../shared/components/graph/types'; +import {EventsPanel} from '../workflows/components/events-panel'; import {SensorLogsViewer} from './sensor-logs-viewer'; -export const SensorSidePanel = ({ +export function SensorSidePanel({ isShown, namespace, sensor, @@ -20,7 +20,7 @@ export const SensorSidePanel = ({ selectedTrigger: string; onTriggerClicked: (selectedNode: string) => void; onClose: () => void; -}) => { +}) { const queryParams = new URLSearchParams(location.search); const [logTab, setLogTab] = useState(queryParams.get('logTab')); @@ -53,4 +53,4 @@ export const SensorSidePanel = ({ )} ); -}; +} diff --git a/ui/src/app/sensors/components/sensors-container.tsx b/ui/src/app/sensors/sensors-container.tsx similarity index 77% rename from ui/src/app/sensors/components/sensors-container.tsx rename to ui/src/app/sensors/sensors-container.tsx index f7d6c9c239a9..c701615391a5 100644 --- a/ui/src/app/sensors/components/sensors-container.tsx +++ b/ui/src/app/sensors/sensors-container.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import {Route, RouteComponentProps, Switch} from 'react-router'; -import {SensorDetails} from './sensor-details/sensor-details'; -import {SensorList} from './sensor-list/sensor-list'; +import {SensorDetails} from './sensor-details'; +import {SensorList} from './sensor-list'; export const SensorsContainer = (props: RouteComponentProps) => ( diff --git a/ui/src/app/sensors/components/utils.ts b/ui/src/app/sensors/utils.ts similarity index 95% rename from ui/src/app/sensors/components/utils.ts rename to ui/src/app/sensors/utils.ts index e79e539f7bb4..833a80a207fb 100644 --- a/ui/src/app/sensors/components/utils.ts +++ b/ui/src/app/sensors/utils.ts @@ -1,4 +1,4 @@ -import {Condition} from '../../../models'; +import {Condition} from '../../models'; export const Utils = { statusIconClasses(conditions: Condition[], icon: string): string { diff --git a/ui/src/app/shared/artifacts.ts b/ui/src/app/shared/artifacts.ts index 5de5d662a0c0..e07e6c2f0051 100644 --- a/ui/src/app/shared/artifacts.ts +++ b/ui/src/app/shared/artifacts.ts @@ -19,7 +19,7 @@ export const nodeArtifacts = (node: NodeStatus, ar: ArtifactRepository) => filename: a.key.replace(/\/$/, '').split('/').pop() })); -export const artifactURN = (a: A, ar: ArtifactRepository) => { +export function artifactURN(a: A, ar: ArtifactRepository) { if (a.gcs) { return 'artifact:gcs:' + (a.gcs.endpoint || ar?.gcs?.endpoint) + ':' + (a.gcs.bucket || ar?.gcs?.bucket) + ':' + a.gcs.key; } else if (a.git) { @@ -36,9 +36,9 @@ export const artifactURN = (a: A, ar: ArtifactRepository) => return 'artifact:azure:' + (a.azure.endpoint || ar?.azure?.endpoint) + ':' + (a.azure.container || ar?.azure?.container) + ':' + a.azure.blob; } return 'artifact:unknown'; -}; +} -export const artifactRepoHasLocation = (ar: ArtifactRepository) => { +export function artifactRepoHasLocation(ar: ArtifactRepository) { if (ar.gcs) { return ar.gcs.bucket !== '' && ar.gcs.key !== ''; } else if (ar.git) { @@ -54,9 +54,9 @@ export const artifactRepoHasLocation = (ar: ArtifactRepository) => { } else if (ar.azure) { return ar.azure.container !== '' && ar.azure.blob !== ''; } -}; +} -export const artifactKey = (a: A) => { +export function artifactKey(a: A) { if (a.gcs) { return a.gcs.key; } else if (a.git) { @@ -73,9 +73,9 @@ export const artifactKey = (a: A) => { return a.azure.blob; } return 'unknown'; -}; +} -export const findArtifact = (status: WorkflowStatus, urn: string) => { +export function findArtifact(status: WorkflowStatus, urn: string) { const artifacts: (Artifact & {nodeId: string; artifactNameDiscriminator: string})[] = []; Object.values(status.nodes || {}).map(node => { @@ -85,4 +85,4 @@ export const findArtifact = (status: WorkflowStatus, urn: string) => { }); return artifacts.length >= 0 && artifacts[artifacts.length - 1]; -}; +} diff --git a/ui/src/app/shared/components/big-button.tsx b/ui/src/app/shared/components/big-button.tsx index 82131f43d799..39de6e95cbf9 100644 --- a/ui/src/app/shared/components/big-button.tsx +++ b/ui/src/app/shared/components/big-button.tsx @@ -1,7 +1,8 @@ import * as React from 'react'; + import {Icon} from './icon'; -export const BigButton = ({icon, title, onClick, href}: {icon: Icon; title: string; onClick?: () => void; href?: string}) => { +export function BigButton({icon, title, onClick, href}: {icon: Icon; title: string; onClick?: () => void; href?: string}) { return ( {title} ); -}; +} diff --git a/ui/src/app/shared/components/drop-down-button.tsx b/ui/src/app/shared/components/drop-down-button.tsx index 6130c096c723..53a1b3cf46e4 100644 --- a/ui/src/app/shared/components/drop-down-button.tsx +++ b/ui/src/app/shared/components/drop-down-button.tsx @@ -5,7 +5,7 @@ import {Button} from './button'; import './drop-down-button.scss'; -export const DropDownButton = ({onClick, items, children}: {onClick: () => void; children: ReactNode; items: {value: string; onClick: () => void}[]}) => { +export function DropDownButton({onClick, items, children}: {onClick: () => void; children: ReactNode; items: {value: string; onClick: () => void}[]}) { const [dropped, setDropped] = useState(false); return (
setDropped(true)} onMouseLeave={() => setDropped(false)}> @@ -23,4 +23,4 @@ export const DropDownButton = ({onClick, items, children}: {onClick: () => void;
); -}; +} diff --git a/ui/src/app/shared/components/duration-panel.tsx b/ui/src/app/shared/components/duration-panel.tsx index ff0cde517e44..54b2f0679d7f 100644 --- a/ui/src/app/shared/components/duration-panel.tsx +++ b/ui/src/app/shared/components/duration-panel.tsx @@ -1,10 +1,11 @@ import * as React from 'react'; + import {NODE_PHASE, NodePhase} from '../../../models'; import {formatDuration} from '../duration'; import {ProgressLine} from './progress-line'; // duration panel in seconds -export const DurationPanel = (props: {phase: NodePhase; duration: number; estimatedDuration?: number}) => { +export function DurationPanel(props: {phase: NodePhase; duration: number; estimatedDuration?: number}) { if (props.phase === NODE_PHASE.RUNNING && props.estimatedDuration) { return ( <> @@ -16,4 +17,4 @@ export const DurationPanel = (props: {phase: NodePhase; duration: number; estima ); } return <>{formatDuration(props.duration)}; -}; +} diff --git a/ui/src/app/shared/components/editors/labels-and-annotations-editor.tsx b/ui/src/app/shared/components/editors/labels-and-annotations-editor.tsx index 7c734a6b17b4..4f1977af21b6 100644 --- a/ui/src/app/shared/components/editors/labels-and-annotations-editor.tsx +++ b/ui/src/app/shared/components/editors/labels-and-annotations-editor.tsx @@ -1,8 +1,9 @@ import * as React from 'react'; + import {kubernetes} from '../../../../models'; import {KeyValueEditor} from './key-value-editor'; -export const LabelsAndAnnotationsEditor = ({value, onChange}: {value: kubernetes.ObjectMeta; onChange: (value: kubernetes.ObjectMeta) => void}) => { +export function LabelsAndAnnotationsEditor({value, onChange}: {value: kubernetes.ObjectMeta; onChange: (value: kubernetes.ObjectMeta) => void}) { return ( <>
@@ -19,4 +20,4 @@ export const LabelsAndAnnotationsEditor = ({value, onChange}: {value: kubernetes
); -}; +} diff --git a/ui/src/app/shared/components/editors/metadata-editor.tsx b/ui/src/app/shared/components/editors/metadata-editor.tsx index 2ed00b2deb06..8559ead12393 100644 --- a/ui/src/app/shared/components/editors/metadata-editor.tsx +++ b/ui/src/app/shared/components/editors/metadata-editor.tsx @@ -1,9 +1,10 @@ import * as React from 'react'; + import {kubernetes} from '../../../../models'; import {TextInput} from '../text-input'; import {LabelsAndAnnotationsEditor} from './labels-and-annotations-editor'; -export const MetadataEditor = ({onChange, value}: {value: kubernetes.ObjectMeta; onChange: (value: kubernetes.ObjectMeta) => void}) => { +export function MetadataEditor({onChange, value}: {value: kubernetes.ObjectMeta; onChange: (value: kubernetes.ObjectMeta) => void}) { return ( <>
@@ -29,4 +30,4 @@ export const MetadataEditor = ({onChange, value}: {value: kubernetes.ObjectMeta; ); -}; +} diff --git a/ui/src/app/shared/components/editors/workflow-parameters-editor.tsx b/ui/src/app/shared/components/editors/workflow-parameters-editor.tsx index acc182acf888..6049cf1add6b 100644 --- a/ui/src/app/shared/components/editors/workflow-parameters-editor.tsx +++ b/ui/src/app/shared/components/editors/workflow-parameters-editor.tsx @@ -1,8 +1,9 @@ import * as React from 'react'; + import {Arguments, Parameter, WorkflowSpec} from '../../../../models'; import {KeyValueEditor} from './key-value-editor'; -export const WorkflowParametersEditor = (props: {value: T; onChange: (value: T) => void; onError: (error: Error) => void}) => { +export function WorkflowParametersEditor(props: {value: T; onChange: (value: T) => void; onError: (error: Error) => void}) { const parameterKeyValues = props.value && props.value.arguments && @@ -40,4 +41,4 @@ export const WorkflowParametersEditor = (props: {value:
); -}; +} diff --git a/ui/src/app/shared/components/error-notice.tsx b/ui/src/app/shared/components/error-notice.tsx index 7efc17b0f0de..7332ee2c0c73 100644 --- a/ui/src/app/shared/components/error-notice.tsx +++ b/ui/src/app/shared/components/error-notice.tsx @@ -1,12 +1,13 @@ import * as React from 'react'; import {CSSProperties, useEffect, useState} from 'react'; + import {Notice} from './notice'; import {PhaseIcon} from './phase-icon'; // Display an error notice. // If the error was a HTTP error (i.e. from super-agent), rather than just an unhelpful "Internal Server Error", // it will display any message in the body. -export const ErrorNotice = (props: {style?: CSSProperties; error: Error & {response?: {body: {message?: string}}}; onReload?: () => void; reloadAfterSeconds?: number}) => { +export function ErrorNotice(props: {style?: CSSProperties; error: Error & {response?: {body: {message?: string}}}; onReload?: () => void; reloadAfterSeconds?: number}) { if (!props.error) { return null; } @@ -60,4 +61,4 @@ export const ErrorNotice = (props: {style?: CSSProperties; error: Error & {respo ); -}; +} diff --git a/ui/src/app/shared/components/filter-drop-down.tsx b/ui/src/app/shared/components/filter-drop-down.tsx index c2a95293bfc3..2ed833e5181e 100644 --- a/ui/src/app/shared/components/filter-drop-down.tsx +++ b/ui/src/app/shared/components/filter-drop-down.tsx @@ -1,6 +1,7 @@ import {Checkbox} from 'argo-ui'; import classNames from 'classnames'; import * as React from 'react'; + import {DropDown} from './dropdown/dropdown'; interface FilterDropDownProps { @@ -13,7 +14,7 @@ export interface FilterDropSection { onChange: (label: string, checked: boolean) => void; } -export const FilterDropDown = (props: FilterDropDownProps) => { +export function FilterDropDown(props: FilterDropDownProps) { return ( { ); -}; +} diff --git a/ui/src/app/shared/components/graph/fast-layout.ts b/ui/src/app/shared/components/graph/fast-layout.ts index 82ce670c4ef8..c6ad5626ea32 100644 --- a/ui/src/app/shared/components/graph/fast-layout.ts +++ b/ui/src/app/shared/components/graph/fast-layout.ts @@ -2,7 +2,7 @@ import {CoffmanGrahamSorter} from './coffman-graham-sorter'; import {Edge, Graph, Node} from './types'; const minSize = 1; -export const layoutGraphFast = (graph: Graph, nodeSize: number, horizontal: boolean, hidden: (id: Node) => boolean) => { +export function layoutGraphFast(graph: Graph, nodeSize: number, horizontal: boolean, hidden: (id: Node) => boolean) { const gap = nodeSize * 1.25; const layers = new CoffmanGrahamSorter(graph).sort(); @@ -36,9 +36,9 @@ export const layoutGraphFast = (graph: Graph, nodeSize: number, horizontal: bool label.points = generateEdge(graph, e, nodeSize, horizontal, hidden); } }); -}; +} -const generateEdge = (graph: Graph, edge: Edge, nodeSize: number, horizontal: boolean, hiddenNode: (id: Node) => boolean) => { +function generateEdge(graph: Graph, edge: Edge, nodeSize: number, horizontal: boolean, hiddenNode: (id: Node) => boolean) { // `h` and `v` move the arrow heads to next to the node, otherwise they would be behind it const h = horizontal ? nodeSize / 2 : 0; const v = !horizontal ? nodeSize / 2 : 0; @@ -53,4 +53,4 @@ const generateEdge = (graph: Graph, edge: Edge, nodeSize: number, horizontal: bo y: graph.nodes.get(edge.w).y - (hiddenNode(edge.w) ? minSize : v) } ]; -}; +} diff --git a/ui/src/app/shared/components/graph/icon.tsx b/ui/src/app/shared/components/graph/icon.tsx index 40467c8fa782..db60877bebac 100644 --- a/ui/src/app/shared/components/graph/icon.tsx +++ b/ui/src/app/shared/components/graph/icon.tsx @@ -1,8 +1,9 @@ import * as React from 'react'; + import {Icon} from '../icon'; import {icons} from '../icons'; -export const GraphIcon = ({nodeSize, progress, icon}: {icon: Icon; progress?: number; nodeSize: number}) => { +export function GraphIcon({nodeSize, progress, icon}: {icon: Icon; progress?: number; nodeSize: number}) { if (!progress) { return ( @@ -21,4 +22,4 @@ export const GraphIcon = ({nodeSize, progress, icon}: {icon: Icon; progress?: nu const largeArcFlag = theta > Math.PI ? 1 : 0; const sweepFlag = 1; return ; -}; +} diff --git a/ui/src/app/shared/components/graph/layout.ts b/ui/src/app/shared/components/graph/layout.ts index bb5cd34f8d15..12108c62b49e 100644 --- a/ui/src/app/shared/components/graph/layout.ts +++ b/ui/src/app/shared/components/graph/layout.ts @@ -2,9 +2,9 @@ import {layoutGraphFast} from './fast-layout'; import {layoutGraphPretty} from './pretty-layout'; import {Graph, Node} from './types'; -export const layout = (graph: Graph, nodeSize: number, horizontal: boolean, hidden: (id: Node) => boolean, fast: boolean) => { +export function layout(graph: Graph, nodeSize: number, horizontal: boolean, hidden: (id: Node) => boolean, fast: boolean) { // TODO - we should not re-layout the graph if options have not changed // if (Array.from(graph.nodes).find(([, l]) => l.x === undefined)) { (fast ? layoutGraphFast : layoutGraphPretty)(graph, nodeSize, horizontal, hidden); // } -}; +} diff --git a/ui/src/app/shared/components/object-editor/object-editor.tsx b/ui/src/app/shared/components/object-editor.tsx similarity index 95% rename from ui/src/app/shared/components/object-editor/object-editor.tsx rename to ui/src/app/shared/components/object-editor.tsx index 0bfa9ad8de58..4929d4802fb1 100644 --- a/ui/src/app/shared/components/object-editor/object-editor.tsx +++ b/ui/src/app/shared/components/object-editor.tsx @@ -2,12 +2,12 @@ import * as React from 'react'; import {useEffect, useRef, useState} from 'react'; import MonacoEditor from 'react-monaco-editor'; -import {uiUrl} from '../../base'; -import {ScopedLocalStorage} from '../../scoped-local-storage'; -import {Button} from '../button'; -import {parse, stringify} from '../object-parser'; -import {PhaseIcon} from '../phase-icon'; -import {SuspenseMonacoEditor} from '../suspense-monaco-editor'; +import {uiUrl} from '../base'; +import {ScopedLocalStorage} from '../scoped-local-storage'; +import {Button} from './button'; +import {parse, stringify} from './object-parser'; +import {PhaseIcon} from './phase-icon'; +import {SuspenseMonacoEditor} from './suspense-monaco-editor'; interface Props { type?: string; diff --git a/ui/src/app/shared/components/parameters-input/parameters-input.tsx b/ui/src/app/shared/components/parameters-input.tsx similarity index 95% rename from ui/src/app/shared/components/parameters-input/parameters-input.tsx rename to ui/src/app/shared/components/parameters-input.tsx index 593879198cb7..56c4eddaf612 100644 --- a/ui/src/app/shared/components/parameters-input/parameters-input.tsx +++ b/ui/src/app/shared/components/parameters-input.tsx @@ -1,7 +1,8 @@ import {Select, Tooltip} from 'argo-ui'; import React from 'react'; -import {Parameter} from '../../../../models'; -import {Utils} from '../../utils'; + +import {Parameter} from '../../../models'; +import {Utils} from '../utils'; interface ParametersInputProps { parameters: Parameter[]; diff --git a/ui/src/app/shared/components/phase-icon.tsx b/ui/src/app/shared/components/phase-icon.tsx index 0c36b7a47f6c..bda44adf18f0 100644 --- a/ui/src/app/shared/components/phase-icon.tsx +++ b/ui/src/app/shared/components/phase-icon.tsx @@ -1,7 +1,8 @@ import classNames from 'classnames'; + import * as React from 'react'; import {Utils} from '../utils'; -export const PhaseIcon = ({value}: {value: string}) => { +export function PhaseIcon({value}: {value: string}) { return