refactor(kubernetes): move react codebase [EE-3349] (#7953)

pull/8017/head
Chaim Lev-Ari 2022-11-07 08:03:11 +02:00 committed by GitHub
parent 2868da296a
commit 77c29ff87e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
33 changed files with 18 additions and 21 deletions

View File

@ -1,7 +1,7 @@
import { KubernetesService, KubernetesServicePort, KubernetesServiceTypes } from 'Kubernetes/models/service/models';
import { KubernetesApplicationPublishingTypes } from 'Kubernetes/models/application/models/constants';
import { getServices } from 'Kubernetes/react/views/networks/services/service';
import { KubernetesService, KubernetesServicePort, KubernetesServiceTypes } from '@/kubernetes/models/service/models';
import { KubernetesApplicationPublishingTypes } from '@/kubernetes/models/application/models/constants';
import { notifyError } from '@/portainer/services/notifications';
import { getServices } from '@/react/kubernetes/networks/services/service';
export default class KubeServicesViewController {
/* @ngInject */

View File

@ -1,11 +1,11 @@
import angular from 'angular';
import { r2a } from '@/react-tools/react2angular';
import { IngressesDatatableView } from '@/kubernetes/react/views/networks/ingresses/IngressDatatable';
import { CreateIngressView } from '@/kubernetes/react/views/networks/ingresses/CreateIngressView';
import { withCurrentUser } from '@/react-tools/withCurrentUser';
import { withReactQuery } from '@/react-tools/withReactQuery';
import { withUIRouter } from '@/react-tools/withUIRouter';
import { IngressesDatatableView } from '@/react/kubernetes/ingresses/IngressDatatable';
import { CreateIngressView } from '@/react/kubernetes/ingresses/CreateIngressView';
export const viewsModule = angular
.module('portainer.kubernetes.react.views', [])

View File

@ -32,7 +32,7 @@ import KubernetesApplicationHelper from 'Kubernetes/helpers/application/index';
import KubernetesVolumeHelper from 'Kubernetes/helpers/volumeHelper';
import KubernetesNamespaceHelper from 'Kubernetes/helpers/namespaceHelper';
import { KubernetesNodeHelper } from 'Kubernetes/node/helper';
import { updateIngress, getIngresses } from '@/kubernetes/react/views/networks/ingresses/service';
import { updateIngress, getIngresses } from '@/react/kubernetes/ingresses/service';
import { confirmUpdateAppIngress } from '@/portainer/services/modal.service/prompt';
class KubernetesCreateApplicationController {

View File

@ -3,7 +3,7 @@ import clsx from 'clsx';
import { useState } from 'react';
import { DialogOverlay } from '@reach/dialog';
import * as kcService from '@/kubernetes/services/kubeconfig.service';
import { downloadKubeconfigFile } from '@/react/kubernetes/services/kubeconfig.service';
import * as notifications from '@/portainer/services/notifications';
import { EnvironmentType } from '@/react/portainer/environments/types';
import { usePaginationLimitState } from '@/portainer/hooks/usePaginationLimitState';
@ -144,9 +144,7 @@ export function KubeconfigPrompt({
return;
}
try {
await kcService.downloadKubeconfigFile(
Object.keys(selection).map(Number)
);
await downloadKubeconfigFile(Object.keys(selection).map(Number));
onClose();
} catch (e) {
notifications.error('Failed downloading kubeconfig file', e as Error);

View File

@ -3,7 +3,7 @@ import { EnvironmentId } from '@/react/portainer/environments/types';
import {
KubernetesApiListResponse,
V1IngressClass,
} from '@/react/kubernetes/services/kubernetes/types';
} from '@/react/kubernetes/services/types';
export async function getAllIngressClasses(environmentId: EnvironmentId) {
try {

View File

@ -5,8 +5,7 @@ import { v4 as uuidv4 } from 'uuid';
import { useEnvironmentId } from '@/portainer/hooks/useEnvironmentId';
import { useConfigurations } from '@/react/kubernetes/configs/queries';
import { useNamespaces } from '@/react/kubernetes/namespaces/queries';
import { Annotation } from '@/kubernetes/react/views/networks/ingresses/components/annotations/types';
import { useServices } from '@/kubernetes/react/views/networks/services/queries';
import { useServices } from '@/react/kubernetes/networks/services/queries';
import { notifySuccess } from '@/portainer/services/notifications';
import { Link } from '@@/Link';
@ -22,6 +21,7 @@ import {
useIngressControllers,
} from '../queries';
import { Annotation } from './Annotations/types';
import { Rule, Path, Host } from './types';
import { IngressForm } from './IngressForm';
import {

View File

@ -1,8 +1,6 @@
import { ChangeEvent, ReactNode } from 'react';
import { Plus, RefreshCw, Trash2 } from 'react-feather';
import { Annotations } from '@/kubernetes/react/views/networks/ingresses/components/annotations';
import { Link } from '@@/Link';
import { Icon } from '@@/Icon';
import { Select, Option } from '@@/form-components/Input/Select';
@ -11,6 +9,7 @@ import { Widget, WidgetBody, WidgetTitle } from '@@/Widget';
import { Tooltip } from '@@/Tip/Tooltip';
import { Button } from '@@/buttons';
import { Annotations } from './Annotations';
import { Rule, ServicePorts } from './types';
import '../style.css';

View File

@ -1,7 +1,7 @@
import { Annotation } from '@/kubernetes/react/views/networks/ingresses/components/annotations/types';
import { Option } from '@@/form-components/Input/Select';
import { Annotation } from './Annotations/types';
export interface Path {
Key: string;
Route: string;

View File

@ -1,10 +1,10 @@
import { v4 as uuidv4 } from 'uuid';
import { Annotation } from '@/kubernetes/react/views/networks/ingresses/components/annotations/types';
import { SupportedIngControllerTypes } from '@/react/kubernetes/cluster/ingressClass/types';
import { TLS, Ingress } from '../types';
import { Annotation } from './Annotations/types';
import { Host, Rule } from './types';
const ignoreAnnotationsForEdit = [

View File

@ -6,8 +6,7 @@ import {
withError,
withInvalidate,
} from '@/react-tools/react-query';
import { getServices } from '../services/service';
import { getServices } from '@/react/kubernetes/networks/services/service';
import {
getIngresses,

View File

@ -2,7 +2,8 @@ import { useQuery } from 'react-query';
import { EnvironmentId } from '@/react/portainer/environments/types';
import { error as notifyError } from '@/portainer/services/notifications';
import { getIngresses } from '@/kubernetes/react/views/networks/ingresses/service';
import { getIngresses } from '../ingresses/service';
import { getNamespaces, getNamespace } from './service';
import { Namespaces } from './types';