Move UMB_CHANGE_PASSWORD_MODAL
This commit is contained in:
9
src/Umbraco.Web.UI.Client/libs/modal/token/index.ts
Normal file
9
src/Umbraco.Web.UI.Client/libs/modal/token/index.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { UmbModalToken } from '@umbraco-cms/backoffice/modal';
|
||||
|
||||
export interface UmbChangePasswordModalData {
|
||||
requireOldPassword: boolean;
|
||||
}
|
||||
|
||||
export const UMB_CHANGE_PASSWORD_MODAL = new UmbModalToken<UmbChangePasswordModalData>('Umb.Modal.ChangePassword', {
|
||||
type: 'dialog',
|
||||
});
|
||||
@@ -1,7 +1,7 @@
|
||||
import { UUITextStyles } from '@umbraco-ui/uui-css/lib';
|
||||
import { css, CSSResultGroup, html, nothing } from 'lit';
|
||||
import { customElement, property } from 'lit/decorators.js';
|
||||
import { UmbChangePasswordModalData } from '.';
|
||||
import { UmbChangePasswordModalData } from '../../../../../../libs/modal/token';
|
||||
import { UmbModalHandler } from '@umbraco-cms/backoffice/modal';
|
||||
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';
|
||||
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
import { UmbModalToken } from '@umbraco-cms/backoffice/modal';
|
||||
|
||||
export interface UmbChangePasswordModalData {
|
||||
requireOldPassword: boolean;
|
||||
}
|
||||
|
||||
export const UMB_CHANGE_PASSWORD_MODAL_TOKEN = new UmbModalToken<UmbChangePasswordModalData>(
|
||||
'Umb.Modal.ChangePassword',
|
||||
{
|
||||
type: 'dialog',
|
||||
}
|
||||
);
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
UMB_CURRENT_USER_HISTORY_STORE_CONTEXT_TOKEN,
|
||||
} from '../../current-user-history.store';
|
||||
import { UmbCurrentUserStore, UMB_CURRENT_USER_STORE_CONTEXT_TOKEN } from '../../current-user.store';
|
||||
import { UMB_CHANGE_PASSWORD_MODAL_TOKEN } from '../change-password';
|
||||
import { UMB_CHANGE_PASSWORD_MODAL } from '../../../../../../libs/modal/token';
|
||||
import { UmbModalHandler, UmbModalContext, UMB_MODAL_CONTEXT_TOKEN } from '@umbraco-cms/backoffice/modal';
|
||||
import type { UserDetails } from '@umbraco-cms/backoffice/models';
|
||||
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';
|
||||
@@ -139,7 +139,7 @@ export class UmbCurrentUserModalElement extends UmbLitElement {
|
||||
private _changePassword() {
|
||||
if (!this._modalContext) return;
|
||||
|
||||
this._modalContext.open(UMB_CHANGE_PASSWORD_MODAL_TOKEN, {
|
||||
this._modalContext.open(UMB_CHANGE_PASSWORD_MODAL, {
|
||||
requireOldPassword: this._currentUserStore?.isAdmin || false,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import { ifDefined } from 'lit/directives/if-defined.js';
|
||||
import { repeat } from 'lit/directives/repeat.js';
|
||||
|
||||
import { UmbCurrentUserStore, UMB_CURRENT_USER_STORE_CONTEXT_TOKEN } from '../../current-user/current-user.store';
|
||||
import { UMB_CHANGE_PASSWORD_MODAL_TOKEN } from '../../current-user/modals/change-password';
|
||||
import { UMB_CHANGE_PASSWORD_MODAL } from '../../../../../libs/modal/token';
|
||||
import { UmbUserWorkspaceContext } from './user-workspace.context';
|
||||
import type { UmbModalContext } from '@umbraco-cms/backoffice/modal';
|
||||
import { getLookAndColorFromUserStatus } from '@umbraco-cms/backoffice/utils';
|
||||
@@ -181,7 +181,7 @@ export class UmbUserWorkspaceEditElement extends UmbLitElement {
|
||||
}
|
||||
|
||||
private _changePassword() {
|
||||
this._modalContext?.open(UMB_CHANGE_PASSWORD_MODAL_TOKEN, {
|
||||
this._modalContext?.open(UMB_CHANGE_PASSWORD_MODAL, {
|
||||
requireOldPassword: this._currentUserStore?.isAdmin === false,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user