Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: move change password token #2333

Merged
merged 9 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
"./tiny-mce": "./dist-cms/packages/tiny-mce/index.js",
"./tree": "./dist-cms/packages/core/tree/index.js",
"./ufm": "./dist-cms/packages/ufm/index.js",
"./user-change-password": "./dist-cms/packages/user/change-password/index.js",
"./user-group": "./dist-cms/packages/user/user-group/index.js",
"./user-permission": "./dist-cms/packages/user/user-permission/index.js",
"./user": "./dist-cms/packages/user/user/index.js",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import '../confirm/confirm-modal.element.js';

import type { UmbCodeEditorModalData } from './code-editor-modal.token.js';
import type { Meta, Story } from '@storybook/web-components';
import { html } from '@umbraco-cms/backoffice/external/lit';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import '../../../components/body-layout/body-layout.element.js';
import './icon-picker-modal.element.js';

import type { UmbIconPickerModalElement } from './icon-picker-modal.element.js';
Expand Down
1 change: 0 additions & 1 deletion src/packages/core/modal/token/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from './change-password-modal.token.js';
export * from './modal-token.js';
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import '../../../components/body-layout/body-layout.element.js';
import './embedded-media-modal.element.js';

import type { UmbEmbeddedMediaModalData } from './embedded-media-modal.token.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { UMB_CHANGE_PASSWORD_MODAL } from '../modal/index.js';
import { UmbChangeUserPasswordRepository } from '@umbraco-cms/backoffice/user';
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
import type { UmbEntityActionArgs } from '@umbraco-cms/backoffice/entity-action';
import { UmbEntityActionBase } from '@umbraco-cms/backoffice/entity-action';
import { UMB_MODAL_MANAGER_CONTEXT, UMB_CHANGE_PASSWORD_MODAL } from '@umbraco-cms/backoffice/modal';
import { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal';
import { UMB_CURRENT_USER_CONTEXT, UmbCurrentUserRepository } from '@umbraco-cms/backoffice/current-user';

export class UmbChangeUserPasswordEntityAction extends UmbEntityActionBase<never> {
Expand Down
22 changes: 22 additions & 0 deletions src/packages/user/change-password/entity-action/manifests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { UMB_USER_ENTITY_TYPE } from '@umbraco-cms/backoffice/user';

export const manifests: Array<UmbExtensionManifest> = [
{
type: 'entityAction',
kind: 'default',
alias: 'Umb.EntityAction.User.ChangePassword',
name: 'Change User Password Entity Action',
weight: 600,
api: () => import('./change-user-password.action.js'),
forEntityTypes: [UMB_USER_ENTITY_TYPE],
meta: {
icon: 'icon-key',
label: '#user_changePassword',
},
conditions: [
{
alias: 'Umb.Condition.User.AllowChangePassword',
},
],
},
];
1 change: 1 addition & 0 deletions src/packages/user/change-password/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './modal/index.js';
30 changes: 3 additions & 27 deletions src/packages/user/change-password/manifests.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,4 @@
import { UMB_USER_ENTITY_TYPE } from '@umbraco-cms/backoffice/user';
import { manifests as entityActionManifests } from './entity-action/manifests.js';
import { manifests as modalManifests } from './modal/manifests.js';

export const manifests: Array<UmbExtensionManifest> = [
{
type: 'entityAction',
kind: 'default',
alias: 'Umb.EntityAction.User.ChangePassword',
name: 'Change User Password Entity Action',
weight: 600,
api: () => import('./change-user-password.action.js'),
forEntityTypes: [UMB_USER_ENTITY_TYPE],
meta: {
icon: 'icon-key',
label: '#user_changePassword',
},
conditions: [
{
alias: 'Umb.Condition.User.AllowChangePassword',
},
],
},
{
type: 'modal',
alias: 'Umb.Modal.ChangePassword',
name: 'Change Password Modal',
js: () => import('./change-password-modal.element.js'),
},
];
export const manifests: Array<UmbExtensionManifest> = [...entityActionManifests, ...modalManifests];
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { UmbChangePasswordModalData, UmbChangePasswordModalValue } from './change-password-modal.token.js';
import { UMB_CURRENT_USER_CONTEXT } from '@umbraco-cms/backoffice/current-user';
import { UmbUserItemRepository } from '@umbraco-cms/backoffice/user';
import { UmbTextStyles } from '@umbraco-cms/backoffice/style';
import type { CSSResultGroup } from '@umbraco-cms/backoffice/external/lit';
import { css, html, nothing, customElement, state } from '@umbraco-cms/backoffice/external/lit';
import type { UmbChangePasswordModalData, UmbChangePasswordModalValue } from '@umbraco-cms/backoffice/modal';
import { UmbModalBaseElement } from '@umbraco-cms/backoffice/modal';

@customElement('umb-change-password-modal')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UmbModalToken } from './modal-token.js';
import { UmbModalToken } from '@umbraco-cms/backoffice/modal';

export interface UmbChangePasswordModalData {
user: {
Expand Down
1 change: 1 addition & 0 deletions src/packages/user/change-password/modal/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './change-password-modal.token.js';
8 changes: 8 additions & 0 deletions src/packages/user/change-password/modal/manifests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export const manifests: Array<UmbExtensionManifest> = [
{
type: 'modal',
alias: 'Umb.Modal.ChangePassword',
name: 'Change Password Modal',
js: () => import('./change-password-modal.element.js'),
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { UmbCurrentUserRepository } from '../repository/index.js';
import { UmbActionBase } from '@umbraco-cms/backoffice/action';
import type { UmbCurrentUserAction, UmbCurrentUserActionArgs } from '@umbraco-cms/backoffice/extension-registry';
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
import { UMB_CHANGE_PASSWORD_MODAL, UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal';
import { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal';
import { UMB_CHANGE_PASSWORD_MODAL } from '@umbraco-cms/backoffice/user-change-password';
export class UmbChangePasswordCurrentUserAction<ArgsMetaType = never>
extends UmbActionBase<UmbCurrentUserActionArgs<ArgsMetaType>>
implements UmbCurrentUserAction<ArgsMetaType>
Expand Down
5 changes: 3 additions & 2 deletions src/packages/user/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ export default defineConfig({
...getDefaultConfig({
dist,
entry: {
'current-user/index': 'current-user/index.ts',
'umbraco-package': 'umbraco-package.ts',
'change-password/index': 'change-password/index.ts',
'user-group/index': 'user-group/index.ts',
'user-permission/index': 'user-permission/index.ts',
'user/index': 'user/index.ts',
'current-user/index': 'current-user/index.ts',
manifests: 'manifests.ts',
'umbraco-package': 'umbraco-package.ts',
},
}),
});
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ DON'T EDIT THIS FILE DIRECTLY. It is generated by /devops/tsconfig/index.js
"@umbraco-cms/backoffice/tiny-mce": ["./src/packages/tiny-mce/index.ts"],
"@umbraco-cms/backoffice/tree": ["./src/packages/core/tree/index.ts"],
"@umbraco-cms/backoffice/ufm": ["./src/packages/ufm/index.ts"],
"@umbraco-cms/backoffice/user-change-password": ["./src/packages/user/change-password/index.ts"],
"@umbraco-cms/backoffice/user-group": ["./src/packages/user/user-group/index.ts"],
"@umbraco-cms/backoffice/user-permission": ["./src/packages/user/user-permission/index.ts"],
"@umbraco-cms/backoffice/user": ["./src/packages/user/user/index.ts"],
Expand Down
Loading