Skip to content

Commit c0f820a

Browse files
remove segment toggle for elements (#18949)
1 parent f6d93ef commit c0f820a

File tree

1 file changed

+24
-18
lines changed

1 file changed

+24
-18
lines changed

src/Umbraco.Web.UI.Client/src/packages/documents/document-types/workspace/document-type/views/settings/document-type-workspace-view-settings.element.ts

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { UMB_DOCUMENT_TYPE_WORKSPACE_CONTEXT } from '../../document-type-workspace.context-token.js';
2-
import { css, html, customElement, state, when } from '@umbraco-cms/backoffice/external/lit';
2+
import { css, html, customElement, state, when, nothing } from '@umbraco-cms/backoffice/external/lit';
33
import { UmbTextStyles } from '@umbraco-cms/backoffice/style';
44
import type { UUIBooleanInputEvent, UUIToggleElement } from '@umbraco-cms/backoffice/external/uui';
55
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
@@ -103,23 +103,29 @@ export class UmbDocumentTypeWorkspaceViewSettingsElement extends UmbLitElement i
103103
label=${this.localize.term('contentTypeEditor_cultureVariantLabel')}></uui-toggle>
104104
</div>
105105
</umb-property-layout>
106-
<umb-property-layout
107-
alias="VaryBySegments"
108-
label=${this.localize.term('contentTypeEditor_segmentVariantHeading')}>
109-
<div slot="description">
110-
<umb-localize key="contentTypeEditor_segmentVariantDescription"
111-
>Allow editors to segment their content.</umb-localize
112-
>
113-
</div>
114-
<div slot="editor">
115-
<uui-toggle
116-
?checked=${this._variesBySegment}
117-
@change=${(e: CustomEvent) => {
118-
this.#workspaceContext?.setVariesBySegment((e.target as UUIToggleElement).checked);
119-
}}
120-
label=${this.localize.term('contentTypeEditor_segmentVariantLabel')}></uui-toggle>
121-
</div>
122-
</umb-property-layout>
106+
107+
${this._isElement
108+
? nothing
109+
: html`
110+
<umb-property-layout
111+
alias="VaryBySegments"
112+
label=${this.localize.term('contentTypeEditor_segmentVariantHeading')}>
113+
<div slot="description">
114+
<umb-localize key="contentTypeEditor_segmentVariantDescription"
115+
>Allow editors to segment their content.</umb-localize
116+
>
117+
</div>
118+
<div slot="editor">
119+
<uui-toggle
120+
?checked=${this._variesBySegment}
121+
@change=${(e: CustomEvent) => {
122+
this.#workspaceContext?.setVariesBySegment((e.target as UUIToggleElement).checked);
123+
}}
124+
label=${this.localize.term('contentTypeEditor_segmentVariantLabel')}></uui-toggle>
125+
</div>
126+
</umb-property-layout>
127+
`}
128+
123129
<umb-property-layout alias="ElementType" label=${this.localize.term('contentTypeEditor_elementHeading')}>
124130
<div slot="description">
125131
<umb-localize key="contentTypeEditor_elementDescription"

0 commit comments

Comments
 (0)