Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { UMB_DOCUMENT_TYPE_WORKSPACE_CONTEXT } from '../../document-type-workspace.context-token.js';
import { css, html, customElement, state, when } from '@umbraco-cms/backoffice/external/lit';
import { css, html, customElement, state, when, nothing } from '@umbraco-cms/backoffice/external/lit';
import { UmbTextStyles } from '@umbraco-cms/backoffice/style';
import type { UUIBooleanInputEvent, UUIToggleElement } from '@umbraco-cms/backoffice/external/uui';
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
Expand Down Expand Up @@ -103,23 +103,29 @@
label=${this.localize.term('contentTypeEditor_cultureVariantLabel')}></uui-toggle>
</div>
</umb-property-layout>
<umb-property-layout
alias="VaryBySegments"
label=${this.localize.term('contentTypeEditor_segmentVariantHeading')}>
<div slot="description">
<umb-localize key="contentTypeEditor_segmentVariantDescription"
>Allow editors to segment their content.</umb-localize
>
</div>
<div slot="editor">
<uui-toggle
?checked=${this._variesBySegment}
@change=${(e: CustomEvent) => {
this.#workspaceContext?.setVariesBySegment((e.target as UUIToggleElement).checked);
}}
label=${this.localize.term('contentTypeEditor_segmentVariantLabel')}></uui-toggle>
</div>
</umb-property-layout>

${this._isElement
? nothing
: html`
<umb-property-layout
alias="VaryBySegments"
label=${this.localize.term('contentTypeEditor_segmentVariantHeading')}>
<div slot="description">
<umb-localize key="contentTypeEditor_segmentVariantDescription"
>Allow editors to segment their content.</umb-localize
>
</div>
<div slot="editor">
<uui-toggle
?checked=${this._variesBySegment}
@change=${(e: CustomEvent) => {
this.#workspaceContext?.setVariesBySegment((e.target as UUIToggleElement).checked);
}}
label=${this.localize.term('contentTypeEditor_segmentVariantLabel')}></uui-toggle>
</div>
</umb-property-layout>
`}

Check warning on line 128 in src/Umbraco.Web.UI.Client/src/packages/documents/document-types/workspace/document-type/views/settings/document-type-workspace-view-settings.element.ts

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (v15/dev)

❌ Getting worse: Large Method

UmbDocumentTypeWorkspaceViewSettingsElement.render increases from 108 to 112 lines of code, threshold = 70. Large functions with many lines of code are generally harder to understand and lower the code health. Avoid adding more lines to this function.
<umb-property-layout alias="ElementType" label=${this.localize.term('contentTypeEditor_elementHeading')}>
<div slot="description">
<umb-localize key="contentTypeEditor_elementDescription"
Expand Down
Loading