fix imports, change text

This commit is contained in:
Julia Gru
2023-05-09 13:16:56 +02:00
parent aeb8dfc6a2
commit ee12b1cba7
8 changed files with 17 additions and 14 deletions

View File

@@ -6,7 +6,7 @@ export interface UmbDictionaryItemPickerModalData {
}
export interface UmbDictionaryItemPickerModalResult {
selection: string[];
selection: Array<string | null>;
}
export const UMB_DICTIONARY_ITEM_PICKER_MODAL_ALIAS = 'Umb.Modal.DictionaryItemPicker';

View File

@@ -70,7 +70,9 @@ export class UmbTemplatingInsertMenuElement extends UmbLitElement {
}
#getDictionaryItemSnippet = async (modalResult: UmbDictionaryItemPickerModalResult) => {
const { data } = await this.#dictionaryRepository.requestById(modalResult.selection[0]);
const id = modalResult.selection[0];
if (id === null) return;
const { data } = await this.#dictionaryRepository.requestById(id);
this.value = getInsertDictionarySnippet(data?.name ?? '');
};

View File

@@ -77,8 +77,8 @@ export default class UmbInsertValueSidebarElement extends UmbModalBaseElement<ob
>Add default value</uui-button
>`}
<uui-form-layout-item>
<uui-label slot="label" for="default-value">Recursive</uui-label>
<uui-checkbox @change=${() => (this.recursive = !this.recursive)}>Yes, make it recursive</uui-checkbox>
<uui-label slot="label" for="default-value">Fallback</uui-label>
<uui-checkbox @change=${() => (this.recursive = !this.recursive)}>From ancestors</uui-checkbox>
</uui-form-layout-item>
<uui-form-layout-item>
<uui-label slot="label">Output sample</uui-label>

View File

@@ -27,7 +27,7 @@ const modals: Array<ManifestModal> = [
{
type: 'modal',
alias: UMB_MODAL_TEMPLATING_INSERT_SECTION_SIDEBAR_ALIAS,
name: 'Partial View Picker Modal',
name: 'Partial Insert Section Picker Modal',
loader: () => import('./insert-section-modal/insert-section-modal.element'),
},
];

View File

@@ -0,0 +1 @@
//TODO: move tokens here nad import this file somewhere

View File

@@ -2,7 +2,7 @@ import { UUITextStyles } from '@umbraco-ui/uui-css/lib';
import { css, html } from 'lit';
import { customElement, query, state } from 'lit/decorators.js';
import { UUIInputElement } from '@umbraco-ui/uui';
import { UmbCodeEditorElement } from '../../../shared/components/code-editor/code-editor.element';
import { UmbCodeEditorElement } from '../../../core/components/code-editor';
import { UmbPartialViewsWorkspaceContext } from './partial-views-workspace.context';
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';
@@ -33,10 +33,10 @@ export class UmbPartialViewsWorkspaceEditElement extends UmbLitElement {
this._content = content;
});
this.observe(this.#partialViewsWorkspaceContext.isNew, (isNew) => {
this.#isNew = !!isNew;
console.log(this.#isNew);
});
// this.observe(this.#partialViewsWorkspaceContext.isNew, (isNew) => {
// this.#isNew = !!isNew;
// console.log(this.#isNew);
// });
});
}

View File

@@ -6,7 +6,7 @@ import { UmbRouterSlotInitEvent } from '@umbraco-cms/internal/router';
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';
import './partial-views-workspace-edit.element';
import { IRoute, IRoutingInfo, PageComponent } from '@umbraco-cms/backoffice/router';
import { UmbRoute, IRoutingInfo, PageComponent } from '@umbraco-cms/backoffice/router';
@customElement('umb-partial-views-workspace')
export class UmbPartialViewsWorkspaceElement extends UmbLitElement {
@@ -18,7 +18,7 @@ export class UmbPartialViewsWorkspaceElement extends UmbLitElement {
#key = '';
@state()
_routes: IRoute[] = [
_routes: UmbRoute[] = [
{
path: 'create/:parentKey',
component: () => this.#element,

View File

@@ -1,7 +1,7 @@
import { UUITextStyles } from '@umbraco-ui/uui-css';
import { css, html } from 'lit';
import { customElement, state } from 'lit/decorators.js';
import { UmbTreeElement } from '../../../shared/components/tree/tree.element';
import { UmbTreeElement } from '../../../core/components/tree/tree.element';
import { UmbModalBaseElement } from '@umbraco-cms/internal/modal';
import { UmbDictionaryItemPickerModalData, UmbDictionaryItemPickerModalResult } from '@umbraco-cms/backoffice/modal';
@@ -11,7 +11,7 @@ export default class UmbDictionaryItemPickerModalElement extends UmbModalBaseEle
UmbDictionaryItemPickerModalResult
> {
@state()
_selection: Array<string> = [];
_selection: Array<string | null> = [];
@state()
_multiple = false;