Skip to content

Commit

Permalink
Merge branch 'release/15.0' into v15/hotfix/create-options-extension-…
Browse files Browse the repository at this point in the history
…point
  • Loading branch information
nielslyngsoe authored Nov 4, 2024
2 parents 66b6441 + d53bafc commit 2613f3e
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import { html, customElement, property, state, ifDefined } from '@umbraco-cms/ba
import { UmbRepositoryItemsManager } from '@umbraco-cms/backoffice/repository';
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
import { UMB_APP_CONTEXT } from '@umbraco-cms/backoffice/app';
import { removeLastSlashFromPath, transformServerPathToClientPath } from '@umbraco-cms/backoffice/utils';
import { transformServerPathToClientPath } from '@umbraco-cms/backoffice/utils';
import { UUICardEvent } from '@umbraco-cms/backoffice/external/uui';

@customElement('umb-block-type-card')
export class UmbBlockTypeCardElement extends UmbLitElement {
//
#init: Promise<void>;
#appUrl: string = '';
#serverUrl: string = '';

#itemManager = new UmbRepositoryItemsManager<UmbDocumentTypeItemModel>(
this,
Expand All @@ -29,7 +29,8 @@ export class UmbBlockTypeCardElement extends UmbLitElement {
value = transformServerPathToClientPath(value);
if (value) {
this.#init.then(() => {
this._iconFile = removeLastSlashFromPath(this.#appUrl) + value;
const url = new URL(value, this.#serverUrl);
this._iconFile = url.href;
});
} else {
this._iconFile = undefined;
Expand Down Expand Up @@ -77,7 +78,7 @@ export class UmbBlockTypeCardElement extends UmbLitElement {
super();

this.#init = this.getContext(UMB_APP_CONTEXT).then((appContext) => {
this.#appUrl = appContext.getServerUrl() + appContext.getBackofficePath();
this.#serverUrl = appContext.getServerUrl();
});

this.observe(this.#itemManager.items, (items) => {
Expand Down

0 comments on commit 2613f3e

Please sign in to comment.