Skip to content

Commit

Permalink
refactor(ui): flatten directory structures (argoproj#12539)
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Gilgur <[email protected]>
  • Loading branch information
agilgur5 authored Feb 20, 2024
1 parent 986b069 commit d3433c6
Show file tree
Hide file tree
Showing 131 changed files with 556 additions and 502 deletions.
Original file line number Diff line number Diff line change
@@ -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 (
<Page title='Swagger'>
Expand All @@ -13,7 +14,7 @@ export const ApiDocs = () => {
</div>
</Page>
);
};
}

// 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(() => {
Expand Down
5 changes: 5 additions & 0 deletions ui/src/app/api-docs/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import {ApiDocs} from './api-docs';

export default {
component: ApiDocs
};
5 changes: 0 additions & 5 deletions ui/src/app/apidocs/index.tsx

This file was deleted.

4 changes: 2 additions & 2 deletions ui/src/app/app-router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -172,7 +172,7 @@ export function AppRouter({popupManager, history, notificationsManager}: {popupM
<Route path={reportsUrl} component={reports.component} />
<Route path={pluginsUrl} component={plugins.component} />
<Route exact={true} strict={true} path={helpUrl} component={help.component} />
<Route exact={true} strict={true} path={apiDocsUrl} component={apidocs.component} />
<Route exact={true} strict={true} path={apiDocsUrl} component={apiDocs.component} />
<Route exact={true} strict={true} path={userInfoUrl} component={userinfo.component} />
<Route exact={true} strict={true} path={loginUrl} component={login.component} />
{Utils.managedNamespace && <Redirect to={workflowsUrl} />}
Expand Down
Original file line number Diff line number Diff line change
@@ -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<any>) => (
<Switch>
Expand Down
Original file line number Diff line number Diff line change
@@ -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}) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<any>) {
// boiler-plate
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -19,7 +19,7 @@ export const ClusterWorkflowTemplateEditor = ({
onError: (error: Error) => void;
onTabSelected?: (tab: string) => void;
selectedTabKey?: string;
}) => {
}) {
return (
<Tabs
key='tabs'
Expand Down Expand Up @@ -55,4 +55,4 @@ export const ClusterWorkflowTemplateEditor = ({
]}
/>
);
};
}
Original file line number Diff line number Diff line change
@@ -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}) => (
<LinkButton to={uiUrl('cluster-workflow-templates/' + props.name)}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/cluster-workflow-templates/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ClusterWorkflowTemplateContainer} from './components/cluster-workflow-template-container';
import {ClusterWorkflowTemplateContainer} from './cluster-workflow-template-container';

export default {
component: ClusterWorkflowTemplateContainer
Expand Down
Original file line number Diff line number Diff line change
@@ -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<any>) => (
<Switch>
Expand Down
Original file line number Diff line number Diff line change
@@ -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}) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<any>) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
Original file line number Diff line number Diff line change
@@ -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}) => (
<LinkButton to={uiUrl('cron-workflows/' + props.namespace + '/' + props.name)}>
Expand Down
Loading

0 comments on commit d3433c6

Please sign in to comment.