-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(edit-contentlet): Implement new design in the edit content scree…
…n sidebar #27908 (#28175) * styles: update content sidebar style v1 * chore: code cleanup * chore: update placeholders with real data * chore: apply i18n * dev: show right tooltips * dev: i18n and lazyload for workflow status * refactor * test v1 * fix tests * test DotContentAsideWorkflow Component * feat: add loading state * fix tests * chore: code cleanup * feedback * Style: improve message in * chore: code cleanup
- Loading branch information
Showing
37 changed files
with
1,065 additions
and
286 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
core-web/libs/dotcms-scss/angular/dotcms-theme/components/_skeleton.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
@use "variables" as *; | ||
|
||
.p-skeleton { | ||
background-color: $color-palette-gray-100; | ||
background-color: $color-palette-gray-300; | ||
border-radius: 3px; | ||
} | ||
.p-skeleton:after { | ||
background: linear-gradient(90deg, $white, $color-palette-white-op-40, $white); | ||
background: linear-gradient(90deg, $white, $color-palette-white-op-60, $white); | ||
} |
20 changes: 10 additions & 10 deletions
20
core-web/libs/dotcms-scss/angular/dotcms-theme/components/_tooltip.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
@use "variables" as *; | ||
|
||
.p-tooltip .p-tooltip-text { | ||
background: $color-palette-gray-900; | ||
color: $white; | ||
padding: $spacing-2 $spacing-3; | ||
font-size: 1rem; | ||
box-shadow: none; | ||
border-radius: $border-radius-xs; | ||
background: $white; | ||
box-shadow: $shadow-m; | ||
padding: $spacing-1 $spacing-3; | ||
font-size: $font-size-sm; | ||
line-height: 140%; | ||
border-radius: $border-radius-md; | ||
} | ||
|
||
.p-tooltip.p-tooltip-right .p-tooltip-arrow { | ||
border-right-color: $color-palette-gray-900; | ||
border-right-color: $white; | ||
} | ||
.p-tooltip.p-tooltip-left .p-tooltip-arrow { | ||
border-left-color: $color-palette-gray-900; | ||
border-left-color: $white; | ||
} | ||
.p-tooltip.p-tooltip-top .p-tooltip-arrow { | ||
border-top-color: $color-palette-gray-900; | ||
border-top-color: $white; | ||
} | ||
.p-tooltip.p-tooltip-bottom .p-tooltip-arrow { | ||
border-bottom-color: $color-palette-gray-900; | ||
border-bottom-color: $white; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
...ide/components/dot-content-aside-information/dot-content-aside-information.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<div class="content-aside__information"> | ||
<div class="content-aside__status"> | ||
<p-chip | ||
*ngIf="contentlet | contentletStatus as status" | ||
[styleClass]="'p-chip-sm ' + status.classes" | ||
[label]="status.label" /> | ||
<dot-copy-button | ||
*ngIf="contentlet?.inode as inode" | ||
[copy]="inode" | ||
[tooltipText]="'ID: ' + inode" | ||
[label]="'ID: ' + (inode | slice : -10)" | ||
data-testId="inode" | ||
aria-label="Copy ID" /> | ||
</div> | ||
<div class="content-aside__metadata"> | ||
<div | ||
class="sidebar-card" | ||
[routerLink]="'/content-types-angular/edit/' + contentTypeName" | ||
data-testId="content-type-link"> | ||
<div class="sidebar-card__header"> | ||
<span>{{ 'Content-Type' | dm }}</span> | ||
</div> | ||
<label class="sidebar-card__label">{{ contentTypeName }}</label> | ||
</div> | ||
<div class="sidebar-card" data-testId="references-button"> | ||
<div class="sidebar-card__header"> | ||
<span>{{ 'References' | dm }}</span> | ||
<i class="pi pi-eye"></i> | ||
</div> | ||
</div> | ||
<div class="content-history__container" data-testId="history-container"> | ||
@if(loading) { @for(title of ['Published','Modified','Created'] ; track $index) { | ||
<div class="content-history"> | ||
<label class="content-history__title">{{ title | dm }}</label> | ||
<p-skeleton class="content-history__author" width="89.33px" height="14px" /> | ||
<p-skeleton class="content-history__date" width="89.33px" height="14px" /> | ||
</div> | ||
} } @else { @if(contentlet?.publishDate) { | ||
<div | ||
class="content-history" | ||
[pTooltip]="contentlet?.publishDate | date : 'MMM dd, yyyy'" | ||
tooltipPosition="bottom" | ||
data-testId="publish-history"> | ||
<label class="content-history__title">{{ 'Published' | dm }}</label> | ||
<label class="content-history__author" *ngIf="contentlet?.publishUserName">{{ | ||
contentlet?.publishUserName | ||
}}</label> | ||
<label class="content-history__date">{{ | ||
contentlet?.publishDate | dotRelativeDate : 'MM/dd/yyyy' : null | ||
}}</label> | ||
</div> | ||
} @if(contentlet?.modDate) { | ||
<div | ||
class="content-history" | ||
[pTooltip]="contentlet?.modDate | date : 'MMM dd, yyyy'" | ||
tooltipPosition="bottom" | ||
data-testId="mod-history"> | ||
<label class="content-history__title">{{ 'Modified' | dm }}</label> | ||
<label class="content-history__author">{{ contentlet?.modUserName }}</label> | ||
<label class="content-history__date">{{ | ||
contentlet?.modDate | dotRelativeDate : 'MM/dd/yyyy' : null | ||
}}</label> | ||
</div> | ||
} | ||
<div | ||
class="content-history" | ||
[pTooltip]="contentlet?.createDate | date : 'MMM dd, yyyy'" | ||
tooltipPosition="bottom" | ||
data-testId="create-history"> | ||
<label class="content-history__title">{{ 'Created' | dm }}</label> | ||
<label class="content-history__author">{{ contentlet?.ownerName || 'You' }}</label> | ||
<label class="content-history__date">{{ | ||
contentlet?.createDate | dotRelativeDate : 'MM/dd/yyyy' : null | ||
}}</label> | ||
</div> | ||
} | ||
</div> | ||
</div> | ||
</div> |
133 changes: 133 additions & 0 deletions
133
...ide/components/dot-content-aside-information/dot-content-aside-information.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
@use "variables" as *; | ||
@import "mixins"; | ||
|
||
.content-aside__information { | ||
display: flex; | ||
padding: $spacing-3; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: flex-start; | ||
gap: $spacing-1; | ||
|
||
.content-aside__status { | ||
width: 100%; | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
} | ||
} | ||
|
||
.content-aside__metadata { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
gap: $spacing-1; | ||
width: 100%; | ||
|
||
.sidebar-card { | ||
display: flex; | ||
flex-direction: column; | ||
background: $white; | ||
padding: $spacing-1; | ||
border-radius: $border-radius-lg; | ||
gap: $spacing-0; | ||
|
||
&, | ||
label { | ||
user-select: none; | ||
cursor: pointer; | ||
} | ||
|
||
&:hover { | ||
background: $color-palette-primary-100; | ||
} | ||
} | ||
|
||
.sidebar-card__header { | ||
display: flex; | ||
justify-content: space-between; | ||
color: $black; | ||
font-size: $font-size-smd; | ||
font-weight: $font-weight-medium-bold; | ||
line-height: $line-height-relative; | ||
|
||
i { | ||
color: $color-palette-primary-500; | ||
} | ||
} | ||
|
||
.sidebar-card__label { | ||
color: $color-palette-gray-800; | ||
font-size: $font-size-smd; | ||
font-weight: $font-weight-regular-bold; | ||
line-height: $line-height-relative; | ||
} | ||
} | ||
|
||
.content-history__container { | ||
display: flex; | ||
align-items: center; | ||
flex: 1 0 0; | ||
align-self: stretch; | ||
border-radius: $border-radius-lg; | ||
background: $white; | ||
|
||
.content-history { | ||
display: flex; | ||
height: 100%; | ||
padding: $spacing-1; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
gap: $spacing-0; | ||
flex: 1 0 0; | ||
position: relative; | ||
user-select: none; | ||
min-height: 5rem; | ||
@include truncate-text; | ||
|
||
&, | ||
& > * { | ||
cursor: pointer; | ||
} | ||
|
||
&:hover { | ||
background: $color-palette-primary-100; | ||
} | ||
|
||
label { | ||
width: 100%; | ||
} | ||
|
||
&:not(:first-child)::before { | ||
content: ""; | ||
position: absolute; | ||
height: 39px; | ||
border-left: 1px solid $color-palette-gray-300; | ||
left: 0; | ||
top: 0; | ||
bottom: 0; | ||
margin: auto; | ||
} | ||
} | ||
|
||
.content-history__title { | ||
color: $black; | ||
font-size: $font-size-smd; | ||
font-weight: $font-weight-medium-bold; | ||
line-height: $line-height-relative; | ||
} | ||
|
||
.content-history__author { | ||
color: $color-palette-gray-800; | ||
font-size: $font-size-smd; | ||
font-weight: $font-weight-regular-bold; | ||
line-height: $line-height-relative; | ||
} | ||
|
||
.content-history__date { | ||
color: $color-palette-gray-700; | ||
font-size: $font-size-xsm; | ||
font-weight: $font-weight-regular-bold; | ||
line-height: $line-height-relative; | ||
} | ||
} |
Oops, something went wrong.