mirror of
https://github.com/portainer/portainer.git
synced 2025-08-05 05:45:22 +02:00
refactor(kube/registries): migrate access table to react [EE-4706] (#10688)
This commit is contained in:
parent
f584bf3830
commit
a00cb951bc
8 changed files with 74 additions and 142 deletions
|
@ -66,6 +66,7 @@ import { applicationsModule } from './applications';
|
|||
import { volumesModule } from './volumes';
|
||||
import { namespacesModule } from './namespaces';
|
||||
import { clusterManagementModule } from './clusterManagement';
|
||||
import { registriesModule } from './registries';
|
||||
|
||||
export const ngModule = angular
|
||||
.module('portainer.kubernetes.react.components', [
|
||||
|
@ -73,6 +74,7 @@ export const ngModule = angular
|
|||
volumesModule,
|
||||
namespacesModule,
|
||||
clusterManagementModule,
|
||||
registriesModule,
|
||||
])
|
||||
.component(
|
||||
'ingressClassDatatable',
|
||||
|
|
11
app/kubernetes/react/components/registries.tsx
Normal file
11
app/kubernetes/react/components/registries.tsx
Normal file
|
@ -0,0 +1,11 @@
|
|||
import angular from 'angular';
|
||||
|
||||
import { r2a } from '@/react-tools/react2angular';
|
||||
import { AccessTable } from '@/react/kubernetes/cluster/RegistryAccessView/AccessTable';
|
||||
|
||||
export const registriesModule = angular
|
||||
.module('portainer.kubernetes.react.components.registries', [])
|
||||
.component(
|
||||
'kubeRegistryAccessTable',
|
||||
r2a(AccessTable, ['dataset', 'onRemove'])
|
||||
).name;
|
|
@ -1,5 +1,4 @@
|
|||
import KubernetesNamespaceHelper from 'Kubernetes/helpers/namespaceHelper';
|
||||
import { confirmDeleteAccess } from '@/react/kubernetes/cluster/RegistryAccessView/ConfirmDeleteAccess';
|
||||
|
||||
export default class KubernetesRegistryAccessController {
|
||||
/* @ngInject */
|
||||
|
@ -32,11 +31,7 @@ export default class KubernetesRegistryAccessController {
|
|||
const removeNamespaces = namespaces.map(({ value }) => value);
|
||||
const nsToUpdate = this.savedResourcePools.map(({ value }) => value).filter((value) => !removeNamespaces.includes(value));
|
||||
|
||||
confirmDeleteAccess().then((confirmed) => {
|
||||
if (confirmed) {
|
||||
return this.updateNamespaces(nsToUpdate);
|
||||
}
|
||||
});
|
||||
return this.updateNamespaces(nsToUpdate);
|
||||
}
|
||||
|
||||
updateNamespaces(namespaces) {
|
||||
|
|
|
@ -48,17 +48,5 @@
|
|||
</rd-widget>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<strings-datatable
|
||||
title-text="Access"
|
||||
title-icon="user-x"
|
||||
table-key="access_registry_resourcepools"
|
||||
dataset="$ctrl.savedResourcePools"
|
||||
empty-dataset-message="No namespace has been authorized yet."
|
||||
on-remove="($ctrl.handleRemove)"
|
||||
column-header="Namespace"
|
||||
>
|
||||
</strings-datatable>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<kube-registry-access-table dataset="$ctrl.savedResourcePools" on-remove="($ctrl.handleRemove)"></kube-registry-access-table>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue