mirror of
https://github.com/portainer/portainer.git
synced 2025-08-07 14:55:27 +02:00
feat(demo): remove demo mode EE-6769 (#11841)
Some checks failed
Test / test-server (map[arch:arm64 platform:linux]) (push) Has been cancelled
Test / test-client (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:linux]) (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:windows version:1809]) (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:windows version:ltsc2022]) (push) Has been cancelled
ci / build_images (map[arch:amd64 platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:amd64 platform:windows version:1809]) (push) Has been cancelled
ci / build_images (map[arch:amd64 platform:windows version:ltsc2022]) (push) Has been cancelled
ci / build_images (map[arch:arm platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:arm64 platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:ppc64le platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:s390x platform:linux version:]) (push) Has been cancelled
/ triage (push) Has been cancelled
Lint / Run linters (push) Has been cancelled
ci / build_manifests (push) Has been cancelled
Some checks failed
Test / test-server (map[arch:arm64 platform:linux]) (push) Has been cancelled
Test / test-client (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:linux]) (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:windows version:1809]) (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:windows version:ltsc2022]) (push) Has been cancelled
ci / build_images (map[arch:amd64 platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:amd64 platform:windows version:1809]) (push) Has been cancelled
ci / build_images (map[arch:amd64 platform:windows version:ltsc2022]) (push) Has been cancelled
ci / build_images (map[arch:arm platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:arm64 platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:ppc64le platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:s390x platform:linux version:]) (push) Has been cancelled
/ triage (push) Has been cancelled
Lint / Run linters (push) Has been cancelled
ci / build_manifests (push) Has been cancelled
This commit is contained in:
parent
fbbf550730
commit
2b01136d03
45 changed files with 27 additions and 481 deletions
|
@ -1,16 +0,0 @@
|
|||
class DemoFeatureIndicatorController {
|
||||
/* @ngInject */
|
||||
constructor(StateManager) {
|
||||
Object.assign(this, { StateManager });
|
||||
|
||||
this.isDemo = false;
|
||||
}
|
||||
|
||||
$onInit() {
|
||||
const state = this.StateManager.getState();
|
||||
|
||||
this.isDemo = state.application.demoEnvironment.enabled;
|
||||
}
|
||||
}
|
||||
|
||||
export default DemoFeatureIndicatorController;
|
|
@ -1,10 +0,0 @@
|
|||
<div class="row" ng-if="$ctrl.isDemo">
|
||||
<div class="col-lg-12 col-md-12 col-xs-12">
|
||||
<rd-widget>
|
||||
<rd-widget-header icon="alert-triangle" title-text="Feature not available"> </rd-widget-header>
|
||||
<rd-widget-body>
|
||||
<span class="small text-muted">{{ $ctrl.content }}</span>
|
||||
</rd-widget-body>
|
||||
</rd-widget>
|
||||
</div>
|
||||
</div>
|
|
@ -1,12 +0,0 @@
|
|||
import angular from 'angular';
|
||||
import controller from './demo-feature-indicator.controller.js';
|
||||
|
||||
export const demoFeatureIndicator = {
|
||||
templateUrl: './demo-feature-indicator.html',
|
||||
controller,
|
||||
bindings: {
|
||||
content: '<',
|
||||
},
|
||||
};
|
||||
|
||||
angular.module('portainer.app').component('demoFeatureIndicator', demoFeatureIndicator);
|
|
@ -30,10 +30,8 @@ export default class ThemeSettingsController {
|
|||
|
||||
async updateThemeSettings(theme) {
|
||||
try {
|
||||
if (!this.state.isDemo) {
|
||||
await this.UserService.updateUserTheme(this.state.userId, theme);
|
||||
await queryClient.invalidateQueries(userQueryKeys.user(this.state.userId));
|
||||
}
|
||||
await this.UserService.updateUserTheme(this.state.userId, theme);
|
||||
await queryClient.invalidateQueries(userQueryKeys.user(this.state.userId));
|
||||
|
||||
notifySuccess('Success', 'User theme settings successfully updated');
|
||||
} catch (err) {
|
||||
|
@ -43,12 +41,9 @@ export default class ThemeSettingsController {
|
|||
|
||||
$onInit() {
|
||||
return this.$async(async () => {
|
||||
const state = this.StateManager.getState();
|
||||
|
||||
this.state = {
|
||||
userId: null,
|
||||
themeColor: 'auto',
|
||||
isDemo: state.application.demoEnvironment.enabled,
|
||||
};
|
||||
|
||||
this.state.availableThemes = options;
|
||||
|
|
|
@ -4,7 +4,6 @@ export function StatusViewModel(data) {
|
|||
this.Version = data.Version;
|
||||
this.Edition = data.Edition;
|
||||
this.InstanceID = data.InstanceID;
|
||||
this.DemoEnvironment = data.DemoEnvironment;
|
||||
}
|
||||
|
||||
export function StatusVersionViewModel(data) {
|
||||
|
|
|
@ -109,7 +109,6 @@ function StateManagerFactory(
|
|||
state.application.version = status.Version;
|
||||
state.application.edition = status.Edition;
|
||||
state.application.instanceId = status.InstanceID;
|
||||
state.application.demoEnvironment = status.DemoEnvironment;
|
||||
|
||||
state.application.enableTelemetry = settings.EnableTelemetry;
|
||||
state.application.logo = settings.LogoURL;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<page-header title="'User settings'" breadcrumbs="['User settings']" reload="true"> </page-header>
|
||||
|
||||
<demo-feature-indicator ng-if="isDemoUser" content="'You cannot change the password of this account in the demo version of Portainer.'"> </demo-feature-indicator>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-xs-12">
|
||||
<theme-settings></theme-settings>
|
||||
|
@ -56,7 +54,7 @@
|
|||
<button
|
||||
type="submit"
|
||||
class="btn btn-primary btn-sm"
|
||||
ng-disabled="isDemoUser || (AuthenticationMethod !== 1 && !isInitialAdmin) || !formValues.currentPassword || !formValues.newPassword || form.$invalid || formValues.newPassword !== formValues.confirmPassword"
|
||||
ng-disabled="(AuthenticationMethod !== 1 && !isInitialAdmin) || !formValues.currentPassword || !formValues.newPassword || form.$invalid || formValues.newPassword !== formValues.confirmPassword"
|
||||
ng-click="updatePassword()"
|
||||
>
|
||||
Update password
|
||||
|
|
|
@ -76,10 +76,6 @@ angular.module('portainer.app').controller('AccountController', [
|
|||
$scope.forceChangePassword = userDetails.forceChangePassword;
|
||||
$scope.isInitialAdmin = userDetails.ID === 1;
|
||||
|
||||
if (state.application.demoEnvironment.enabled) {
|
||||
$scope.isDemoUser = state.application.demoEnvironment.users.includes($scope.userID);
|
||||
}
|
||||
|
||||
SettingsService.publicSettings()
|
||||
.then(function success(data) {
|
||||
$scope.AuthenticationMethod = data.AuthenticationMethod;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue