Skip to content

Commit

Permalink
remove attr with the ifDefined directive
Browse files Browse the repository at this point in the history
  • Loading branch information
madsrasmussen committed Jan 15, 2025
1 parent 67cf35a commit e4babf5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ export class UmbDocumentWorkspaceViewInfoElement extends UmbLitElement {
<strong><umb-localize key="content_documentType">Document Type</umb-localize></strong>
<uui-ref-node-document-type
standalone
href=${this._hasSettingsAccess ? editDocumentTypePath + 'edit/' + this._documentTypeUnique : nothing}
href=${ifDefined(
this._hasSettingsAccess ? editDocumentTypePath + 'edit/' + this._documentTypeUnique : undefined,
)}
?readonly=${!this._hasSettingsAccess}
name=${ifDefined(this.localize.string(this._documentTypeName ?? ''))}>
<umb-icon slot="icon" name=${ifDefined(this._documentTypeIcon)}></umb-icon>
Expand All @@ -233,7 +235,9 @@ export class UmbDocumentWorkspaceViewInfoElement extends UmbLitElement {
<uui-ref-node
standalone
name=${ifDefined(this._templateName)}
href=${this._hasSettingsAccess ? editTemplatePath + 'edit/' + this._templateUnique : nothing}
href=${ifDefined(
this._hasSettingsAccess ? editTemplatePath + 'edit/' + this._templateUnique : undefined,
)}
?readonly=${!this._hasSettingsAccess}>
<uui-icon slot="icon" name="icon-document-html"></uui-icon>
<uui-action-bar slot="actions">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ export class UmbMediaWorkspaceViewInfoElement extends UmbLitElement {
<strong><umb-localize key="content_mediaType">Media Type</umb-localize></strong>
<uui-ref-node-document-type
standalone
href=${this._hasSettingsAccess ? this._editMediaTypePath + 'edit/' + this._mediaTypeUnique : nothing}
href=${ifDefined(
this._hasSettingsAccess ? this._editMediaTypePath + 'edit/' + this._mediaTypeUnique : undefined,
)}
?readonly=${!this._hasSettingsAccess}
name=${ifDefined(this._mediaTypeName)}>
${this._mediaTypeIcon ? html`<umb-icon slot="icon" name=${this._mediaTypeIcon}></umb-icon>` : nothing}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { UMB_MEMBER_WORKSPACE_CONTEXT } from '../../member-workspace.context-tok
import { UmbMemberKind, type UmbMemberKindType } from '../../../../utils/index.js';
import { TimeFormatOptions } from './utils.js';
import { UmbTextStyles } from '@umbraco-cms/backoffice/style';
import { css, html, customElement, state, nothing } from '@umbraco-cms/backoffice/external/lit';
import { css, html, customElement, state, ifDefined } from '@umbraco-cms/backoffice/external/lit';
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
import type { UmbWorkspaceViewElement } from '@umbraco-cms/backoffice/workspace';
import { UMB_WORKSPACE_MODAL } from '@umbraco-cms/backoffice/workspace';
Expand Down Expand Up @@ -108,7 +108,9 @@ export class UmbMemberWorkspaceViewMemberInfoElement extends UmbLitElement imple
<uui-ref-node
standalone
.name=${this._memberTypeName}
href=${this._hasSettingsAccess ? this._editMemberTypePath + 'edit/' + this._memberTypeUnique : nothing}
href=${ifDefined(
this._hasSettingsAccess ? this._editMemberTypePath + 'edit/' + this._memberTypeUnique : undefined,
)}
?readonly=${!this._hasSettingsAccess}>
<umb-icon slot="icon" .name=${this._memberTypeIcon}></umb-icon>
</uui-ref-node>
Expand Down

0 comments on commit e4babf5

Please sign in to comment.