V16 RC: getOpenApiConfiguration().token does not work (#19217)

This commit is contained in:
Jacob Overgaard
2025-05-06 09:43:10 +02:00
committed by GitHub
parent 6518a261f0
commit 95bfee7c63
4 changed files with 26 additions and 28 deletions

View File

@@ -7,29 +7,25 @@ import {
} from "@umbraco-cms/backoffice/external/lit";
import { UmbElementMixin } from "@umbraco-cms/backoffice/element-api";
import { UUIButtonElement } from "@umbraco-cms/backoffice/external/uui";
import {
UMB_NOTIFICATION_CONTEXT,
UmbNotificationContext,
} from "@umbraco-cms/backoffice/notification";
import {
UMB_CURRENT_USER_CONTEXT,
UmbCurrentUserModel,
} from "@umbraco-cms/backoffice/current-user";
import { UMB_NOTIFICATION_CONTEXT } from "@umbraco-cms/backoffice/notification";
import { UMB_CURRENT_USER_CONTEXT } from "@umbraco-cms/backoffice/current-user";
import { UmbracoExtensionService, UserModel } from "../api/index.js";
@customElement("example-dashboard")
export class ExampleDashboardElement extends UmbElementMixin(LitElement) {
@state()
private _yourName: string | undefined = "Press the button!";
private _yourName?: string = "Press the button!";
@state()
private _timeFromMrWolf: Date | undefined;
private _timeFromMrWolf?: Date;
@state()
private _serverUserData: UserModel | undefined = undefined;
private _serverUserData?: UserModel;
@state()
private _contextCurrentUser: UmbCurrentUserModel | undefined = undefined;
private _contextCurrentUser?: typeof UMB_CURRENT_USER_CONTEXT.TYPE;
#notificationContext?: typeof UMB_NOTIFICATION_CONTEXT.TYPE;
constructor() {
super();
@@ -42,14 +38,16 @@ export class ExampleDashboardElement extends UmbElementMixin(LitElement) {
// When we have the current user context
// We can observe properties from it, such as the current user or perhaps just individual properties
// When the currentUser object changes we will get notified and can reset the @state properrty
this.observe(currentUserContext.currentUser, (currentUser) => {
this._contextCurrentUser = currentUser;
});
this.observe(
currentUserContext.currentUser,
(currentUser) => {
this._contextCurrentUser = currentUser;
},
"_contextCurrentUser"
);
});
}
#notificationContext: UmbNotificationContext | undefined = undefined;
#onClickWhoAmI = async (ev: Event) => {
const buttonElement = ev.target as UUIButtonElement;
buttonElement.state = "waiting";