remove query
This commit is contained in:
@@ -205,7 +205,6 @@ export const data: Array<DataTypeResponseModel | FolderTreeItemResponseModel> =
|
||||
alias: 'startNode',
|
||||
value: {
|
||||
type: 'content',
|
||||
query: '',
|
||||
id: null,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -640,101 +640,6 @@ export const data: Array<DocumentTypeResponseModel> = [
|
||||
labelOnTop: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
containerId: 'all-properties-group-key',
|
||||
alias: 'contentPicker',
|
||||
name: 'Content Picker',
|
||||
description: '',
|
||||
dataTypeId: 'dt-contentPicker',
|
||||
variesByCulture: false,
|
||||
variesBySegment: false,
|
||||
validation: {
|
||||
mandatory: true,
|
||||
mandatoryMessage: null,
|
||||
regEx: null,
|
||||
regExMessage: null,
|
||||
},
|
||||
appearance: {
|
||||
labelOnTop: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
id: '19',
|
||||
containerId: 'all-properties-group-key',
|
||||
alias: 'mediaPicker',
|
||||
name: 'Media Picker',
|
||||
description: '',
|
||||
dataTypeId: 'dt-mediaPicker',
|
||||
variesByCulture: false,
|
||||
variesBySegment: false,
|
||||
validation: {
|
||||
mandatory: true,
|
||||
mandatoryMessage: null,
|
||||
regEx: null,
|
||||
regExMessage: null,
|
||||
},
|
||||
appearance: {
|
||||
labelOnTop: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
id: '30',
|
||||
containerId: 'all-properties-group-key',
|
||||
alias: 'memberPicker',
|
||||
name: 'Member Picker',
|
||||
description: '',
|
||||
dataTypeId: 'dt-memberPicker',
|
||||
variesByCulture: false,
|
||||
variesBySegment: false,
|
||||
validation: {
|
||||
mandatory: true,
|
||||
mandatoryMessage: null,
|
||||
regEx: null,
|
||||
regExMessage: null,
|
||||
},
|
||||
appearance: {
|
||||
labelOnTop: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
id: '31',
|
||||
containerId: 'all-properties-group-key',
|
||||
alias: 'memberGroupPicker',
|
||||
name: 'Member Group Picker',
|
||||
description: '',
|
||||
dataTypeId: 'dt-memberGroupPicker',
|
||||
variesByCulture: false,
|
||||
variesBySegment: false,
|
||||
validation: {
|
||||
mandatory: true,
|
||||
mandatoryMessage: null,
|
||||
regEx: null,
|
||||
regExMessage: null,
|
||||
},
|
||||
appearance: {
|
||||
labelOnTop: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
id: '32',
|
||||
containerId: 'all-properties-group-key',
|
||||
alias: 'userPicker',
|
||||
name: 'User Picker',
|
||||
description: '',
|
||||
dataTypeId: 'dt-userPicker',
|
||||
variesByCulture: false,
|
||||
variesBySegment: false,
|
||||
validation: {
|
||||
mandatory: true,
|
||||
mandatoryMessage: null,
|
||||
regEx: null,
|
||||
regExMessage: null,
|
||||
},
|
||||
appearance: {
|
||||
labelOnTop: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
containers: [
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { UmbInputDocumentElement } from '@umbraco-cms/backoffice/document';
|
||||
import { html, customElement, property, state, css, ifDefined, query } from '@umbraco-cms/backoffice/external/lit';
|
||||
import { FormControlMixin, UUIInputElement, UUIInputEvent, UUISelectEvent } from '@umbraco-cms/backoffice/external/uui';
|
||||
import { html, customElement, property, css } from '@umbraco-cms/backoffice/external/lit';
|
||||
import { FormControlMixin, UUISelectEvent } from '@umbraco-cms/backoffice/external/uui';
|
||||
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';
|
||||
import { UmbInputMediaElement } from '@umbraco-cms/backoffice/media';
|
||||
import { StartNode } from '@umbraco-cms/backoffice/components';
|
||||
@@ -10,10 +10,6 @@ export class UmbInputStartNodeElement extends FormControlMixin(UmbLitElement) {
|
||||
protected getFormElement() {
|
||||
return undefined;
|
||||
}
|
||||
private _startNodeQuery = '';
|
||||
|
||||
@state()
|
||||
private queryTyping?: boolean;
|
||||
|
||||
@property()
|
||||
startNodeType?: StartNode['type'];
|
||||
@@ -21,26 +17,13 @@ export class UmbInputStartNodeElement extends FormControlMixin(UmbLitElement) {
|
||||
@property({ attribute: 'start-node-id' })
|
||||
startNodeId?: string;
|
||||
|
||||
@property()
|
||||
public get startNodeQuery(): string {
|
||||
return this._startNodeQuery;
|
||||
}
|
||||
public set startNodeQuery(query: string) {
|
||||
this._startNodeQuery = query;
|
||||
query ? (this.queryTyping = true) : (this.queryTyping = false);
|
||||
}
|
||||
|
||||
@property({ type: Array })
|
||||
options: Array<Option> = [];
|
||||
|
||||
@query('#query')
|
||||
queryInput!: UUIInputElement;
|
||||
|
||||
#onTypeChange(event: UUISelectEvent) {
|
||||
this.startNodeType = event.target.value as StartNode['type'];
|
||||
|
||||
// Clear others
|
||||
this.startNodeQuery = '';
|
||||
this.startNodeId = '';
|
||||
this.dispatchEvent(new CustomEvent('change'));
|
||||
}
|
||||
@@ -50,20 +33,6 @@ export class UmbInputStartNodeElement extends FormControlMixin(UmbLitElement) {
|
||||
this.dispatchEvent(new CustomEvent('change'));
|
||||
}
|
||||
|
||||
#onQueryChange(event: UUIInputEvent) {
|
||||
this.startNodeQuery = event.target.value as string;
|
||||
this.dispatchEvent(new CustomEvent('change'));
|
||||
}
|
||||
|
||||
#onQueryCancel() {
|
||||
this.queryTyping = false;
|
||||
this.queryInput.value = '';
|
||||
if (this.startNodeQuery) {
|
||||
this.startNodeQuery = '';
|
||||
this.dispatchEvent(new CustomEvent('change'));
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
return html`<umb-input-dropdown-list
|
||||
.options=${this.options}
|
||||
@@ -86,42 +55,11 @@ export class UmbInputStartNodeElement extends FormControlMixin(UmbLitElement) {
|
||||
|
||||
renderTypeContent() {
|
||||
const startNodeId = this.startNodeId ? [this.startNodeId] : [];
|
||||
|
||||
if (this.startNodeQuery || this.queryTyping) {
|
||||
return html`<uui-input
|
||||
id="query"
|
||||
label="query"
|
||||
placeholder="Enter XPath query"
|
||||
@change=${this.#onQueryChange}
|
||||
value=${ifDefined(this.startNodeQuery)}>
|
||||
</uui-input>
|
||||
<uui-button label="Show XPath query help">
|
||||
<uui-icon name="umb:info" title="Show XPath query help"></uui-icon>Show XPath query help
|
||||
</uui-button>
|
||||
<uui-button label="Cancel and clear query" @click=${this.#onQueryCancel}>
|
||||
<uui-icon name="umb:backspace"></uui-icon>
|
||||
Clear & Cancel
|
||||
</uui-button>`;
|
||||
}
|
||||
|
||||
return html`
|
||||
<umb-input-document
|
||||
@change=${this.#onIdChange}
|
||||
.selectedIds=${startNodeId}
|
||||
.query=${this.startNodeQuery}
|
||||
max="1"></umb-input-document>
|
||||
${!startNodeId.length ? this.renderQueryButton() : ''}
|
||||
<umb-input-document @change=${this.#onIdChange} .selectedIds=${startNodeId} max="1"></umb-input-document>
|
||||
`;
|
||||
}
|
||||
|
||||
renderQueryButton() {
|
||||
return html`<uui-button
|
||||
label="Query for root node with XPath"
|
||||
@click=${() => (this.queryTyping = !this.queryTyping)}>
|
||||
<uui-icon name="umb:search"></uui-icon>Query for root node with XPath
|
||||
</uui-button>`;
|
||||
}
|
||||
|
||||
renderTypeMedia() {
|
||||
const startNodeId = this.startNodeId ? [this.startNodeId] : [];
|
||||
//TODO => MediaTypes
|
||||
|
||||
@@ -6,7 +6,6 @@ import { UmbInputDocumentElement } from '@umbraco-cms/backoffice/document';
|
||||
type NodeType = 'content' | 'member' | 'media';
|
||||
export type StartNode = {
|
||||
type?: NodeType;
|
||||
query?: string | null;
|
||||
id?: string | null;
|
||||
};
|
||||
|
||||
@@ -19,7 +18,7 @@ export class UmbInputTreeElement extends FormControlMixin(UmbLitElement) {
|
||||
private _type: StartNode['type'] = undefined;
|
||||
@property()
|
||||
public set type(newType: StartNode['type']) {
|
||||
if (newType !== this._type) {
|
||||
if (newType?.toLowerCase() !== this._type) {
|
||||
this._type = newType?.toLowerCase() as StartNode['type'];
|
||||
}
|
||||
}
|
||||
@@ -27,9 +26,6 @@ export class UmbInputTreeElement extends FormControlMixin(UmbLitElement) {
|
||||
return this._type;
|
||||
}
|
||||
|
||||
@property()
|
||||
query?: string;
|
||||
|
||||
@property({ type: String })
|
||||
startNodeId?: string;
|
||||
|
||||
@@ -83,7 +79,6 @@ export class UmbInputTreeElement extends FormControlMixin(UmbLitElement) {
|
||||
case 'content':
|
||||
return html`<umb-input-document
|
||||
.selectedIds=${this.selectedIds}
|
||||
.query=${this.query}
|
||||
.startNodeId=${this.startNodeId}
|
||||
.filter=${this.filter}
|
||||
.min=${this.min}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { StartNode, UmbInputStartNodeElement } from '@umbraco-cms/backoffice/components';
|
||||
import { html, customElement, property, state, css } from '@umbraco-cms/backoffice/external/lit';
|
||||
import { html, customElement, property, state } from '@umbraco-cms/backoffice/external/lit';
|
||||
import { UmbPropertyEditorConfigCollection } from '@umbraco-cms/backoffice/property-editor';
|
||||
import { UmbTextStyles } from '@umbraco-cms/backoffice/style';
|
||||
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';
|
||||
@@ -39,7 +39,6 @@ export class UmbPropertyEditorUITreePickerStartNodeElement extends UmbLitElement
|
||||
this.value = {
|
||||
type: target.startNodeType,
|
||||
id: target.startNodeId,
|
||||
query: target.startNodeQuery,
|
||||
};
|
||||
|
||||
this.dispatchEvent(new CustomEvent('property-value-change'));
|
||||
|
||||
@@ -17,9 +17,6 @@ export class UmbPropertyEditorUITreePickerElement extends UmbLitElement implemen
|
||||
@state()
|
||||
type?: StartNode['type'];
|
||||
|
||||
@state()
|
||||
query?: string | null;
|
||||
|
||||
@state()
|
||||
startNodeId?: string | null;
|
||||
|
||||
@@ -43,7 +40,6 @@ export class UmbPropertyEditorUITreePickerElement extends UmbLitElement implemen
|
||||
const startNode: StartNode | undefined = config?.getValueByAlias('startNode');
|
||||
if (startNode) {
|
||||
this.type = startNode.type;
|
||||
this.query = startNode.query;
|
||||
this.startNodeId = startNode.id;
|
||||
}
|
||||
|
||||
@@ -64,7 +60,6 @@ export class UmbPropertyEditorUITreePickerElement extends UmbLitElement implemen
|
||||
return html`${this.value}<umb-input-tree
|
||||
.value=${this.value}
|
||||
.type=${this.type}
|
||||
.query=${this.query ?? ''}
|
||||
.startNodeId=${this.startNodeId ?? ''}
|
||||
.min=${this.min}
|
||||
.max=${this.max}
|
||||
|
||||
Reference in New Issue
Block a user