mirror of
https://github.com/portainer/portainer.git
synced 2025-07-22 06:49:40 +02:00
refactor(ui): replace ng selectors with react-select [EE-3608] (#7203)
Co-authored-by: LP B <xAt0mZ@users.noreply.github.com>
This commit is contained in:
parent
1e21961e6a
commit
ceaee4e175
66 changed files with 1188 additions and 625 deletions
|
@ -2,8 +2,9 @@ import KubernetesNamespaceHelper from 'Kubernetes/helpers/namespaceHelper';
|
|||
|
||||
export default class KubernetesRegistryAccessController {
|
||||
/* @ngInject */
|
||||
constructor($async, $state, ModalService, EndpointService, Notifications, RegistryService, KubernetesResourcePoolService) {
|
||||
constructor($async, $scope, $state, ModalService, EndpointService, Notifications, RegistryService, KubernetesResourcePoolService) {
|
||||
this.$async = $async;
|
||||
this.$scope = $scope;
|
||||
this.$state = $state;
|
||||
this.ModalService = ModalService;
|
||||
this.Notifications = Notifications;
|
||||
|
@ -20,10 +21,11 @@ export default class KubernetesRegistryAccessController {
|
|||
this.savedResourcePools = [];
|
||||
|
||||
this.handleRemove = this.handleRemove.bind(this);
|
||||
this.onChangeResourcePools = this.onChangeResourcePools.bind(this);
|
||||
}
|
||||
|
||||
async submit() {
|
||||
return this.updateNamespaces([...this.savedResourcePools.map(({ value }) => value), ...this.selectedResourcePools.map((pool) => pool.name)]);
|
||||
return this.updateNamespaces([...this.savedResourcePools.map(({ value }) => value), ...this.selectedResourcePools]);
|
||||
}
|
||||
|
||||
handleRemove(namespaces) {
|
||||
|
@ -52,6 +54,12 @@ export default class KubernetesRegistryAccessController {
|
|||
});
|
||||
}
|
||||
|
||||
onChangeResourcePools(resourcePools) {
|
||||
return this.$scope.$evalAsync(() => {
|
||||
this.selectedResourcePools = resourcePools;
|
||||
});
|
||||
}
|
||||
|
||||
$onInit() {
|
||||
return this.$async(async () => {
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue