1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-08 23:35:31 +02:00

refactor(settings): migrate view to react [EE-5509] (#9179)

This commit is contained in:
Chaim Lev-Ari 2023-07-13 10:46:12 +03:00 committed by GitHub
parent b93624fa1f
commit 0e9902fee9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 548 additions and 281 deletions

View file

@ -364,8 +364,7 @@ angular
url: '/settings',
views: {
'content@': {
templateUrl: './views/settings/settings.html',
controller: 'SettingsController',
component: 'settingsView',
},
},
};

View file

@ -11,6 +11,7 @@ import { withI18nSuspense } from '@/react-tools/withI18nSuspense';
import { EdgeAutoCreateScriptView } from '@/react/portainer/environments/EdgeAutoCreateScriptView';
import { ListView as EnvironmentsListView } from '@/react/portainer/environments/ListView';
import { BackupSettingsPanel } from '@/react/portainer/settings/SettingsView/BackupSettingsView/BackupSettingsPanel';
import { SettingsView } from '@/react/portainer/settings/SettingsView/SettingsView';
import { wizardModule } from './wizard';
import { teamsModule } from './teams';
@ -54,4 +55,8 @@ export const viewsModule = angular
.component(
'backupSettingsPanel',
r2a(withUIRouter(withReactQuery(withCurrentUser(BackupSettingsPanel))), [])
)
.component(
'settingsView',
r2a(withUIRouter(withReactQuery(withCurrentUser(SettingsView))), [])
).name;

View file

@ -2,6 +2,9 @@ import { Environment } from '@/react/portainer/environments/types';
export interface StateManager {
updateEndpointState(endpoint: Environment): Promise<void>;
updateLogo(logo: string): void;
updateSnapshotInterval(interval: string): void;
updateEnableTelemetry(enable: boolean): void;
}
export interface IAuthenticationService {

View file

@ -1,14 +0,0 @@
<page-header title="'Settings'" breadcrumbs="['Settings']"> </page-header>
<application-settings-panel on-success="(handleSuccess)"></application-settings-panel>
<kube-settings-panel></kube-settings-panel>
<helm-cert-panel></helm-cert-panel>
<ssl-settings-panel></ssl-settings-panel>
<hidden-containers-panel></hidden-containers-panel>
<!-- backup -->
<backup-settings-panel></backup-settings-panel>

View file

@ -1,20 +0,0 @@
import angular from 'angular';
angular.module('portainer.app').controller('SettingsController', SettingsController);
/* @ngInject */
function SettingsController($scope, StateManager) {
$scope.handleSuccess = handleSuccess;
$scope.state = {
showHTTPS: !window.ddExtension,
};
function handleSuccess(settings) {
if (settings) {
StateManager.updateLogo(settings.LogoURL);
StateManager.updateSnapshotInterval(settings.SnapshotInterval);
StateManager.updateEnableTelemetry(settings.EnableTelemetry);
}
}
}