TSK-1527: Modify how badge messages are displayed
This commit is contained in:
parent
a4b6dc464f
commit
e8e976de0c
|
@ -4,8 +4,16 @@
|
||||||
|
|
||||||
<!-- TITLE + ACTION BUTTONS -->
|
<!-- TITLE + ACTION BUTTONS -->
|
||||||
<mat-toolbar class="action-toolbar">
|
<mat-toolbar class="action-toolbar">
|
||||||
<h4 class="action-toolbar__headline">{{classification.name}} [{{classification.type}}]
|
<h4 class="action-toolbar__headline">
|
||||||
<span *ngIf="isCreatingNewClassification" class="action-toolbar__badge-message"> {{badgeMessage$ | async}}</span>
|
<span
|
||||||
|
class="{{isCreatingNewClassification? 'action-toolbar__title-badge' : 'action-toolbar__title'}}"
|
||||||
|
matTooltip="{{classification.name}} [{{classification.type}}]">
|
||||||
|
{{classification.name}} [{{classification.type}}]
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
*ngIf="isCreatingNewClassification" class="action-toolbar__badge-message" matTooltip="{{badgeMessage$ | async}}">
|
||||||
|
{{badgeMessage$ | async}}
|
||||||
|
</span>
|
||||||
</h4>
|
</h4>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -21,15 +21,36 @@
|
||||||
|
|
||||||
&__headline {
|
&__headline {
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
padding: 0.5rem;
|
padding: 0 0.5rem 0.5rem 0.5rem;
|
||||||
max-width: calc(100% - 350px);
|
max-width: calc(100% - 350px) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__title {
|
||||||
|
display: block;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
|
||||||
|
position: relative;
|
||||||
|
top: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__title-badge {
|
||||||
|
display: block;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__badge-message {
|
&__badge-message {
|
||||||
font-size: 13px;
|
display: block;
|
||||||
|
text-align: center;
|
||||||
|
vertical-align: middle;
|
||||||
|
line-height: 20px;
|
||||||
|
font-size: 1rem;
|
||||||
background-color: $transparent-grey;
|
background-color: $transparent-grey;
|
||||||
|
border-radius: 4px;
|
||||||
|
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__button {
|
&__button {
|
||||||
|
|
|
@ -32,6 +32,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
||||||
import { MatToolbarModule } from '@angular/material/toolbar';
|
import { MatToolbarModule } from '@angular/material/toolbar';
|
||||||
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||||
|
|
||||||
@Component({ selector: 'taskana-shared-field-error-display', template: '' })
|
@Component({ selector: 'taskana-shared-field-error-display', template: '' })
|
||||||
class FieldErrorDisplayStub {
|
class FieldErrorDisplayStub {
|
||||||
|
@ -129,6 +130,7 @@ describe('ClassificationDetailsComponent', () => {
|
||||||
MatSelectModule,
|
MatSelectModule,
|
||||||
MatProgressBarModule,
|
MatProgressBarModule,
|
||||||
MatMenuModule,
|
MatMenuModule,
|
||||||
|
MatTooltipModule,
|
||||||
BrowserAnimationsModule
|
BrowserAnimationsModule
|
||||||
],
|
],
|
||||||
declarations: [ClassificationDetailsComponent, InputStub, FieldErrorDisplayStub, SvgIconStub, TextareaStub],
|
declarations: [ClassificationDetailsComponent, InputStub, FieldErrorDisplayStub, SvgIconStub, TextareaStub],
|
||||||
|
@ -274,7 +276,7 @@ describe('ClassificationDetailsComponent', () => {
|
||||||
expect(headline).toBeTruthy();
|
expect(headline).toBeTruthy();
|
||||||
expect(headline.textContent).toContain('Recommendation');
|
expect(headline.textContent).toContain('Recommendation');
|
||||||
expect(headline.textContent).toContain('DOCUMENT');
|
expect(headline.textContent).toContain('DOCUMENT');
|
||||||
const badgeMessage = headline.children[0];
|
const badgeMessage = headline.children[1];
|
||||||
expect(badgeMessage).toBeTruthy();
|
expect(badgeMessage).toBeTruthy();
|
||||||
expect(badgeMessage.textContent.trim()).toBe('Creating new classification');
|
expect(badgeMessage.textContent.trim()).toBe('Creating new classification');
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<div class="workbasket-details">
|
<div class="workbasket-details">
|
||||||
<mat-toolbar class="workbasket-details__toolbar">
|
<mat-toolbar class="workbasket-details__toolbar">
|
||||||
<h4 class="workbasket-details__title">
|
<h4 class="workbasket-details__title">
|
||||||
<span class="workbasket-details__title-name">{{workbasket.name}}</span>
|
<span class="workbasket-details__title-name" matTooltip="{{workbasket.name}}">{{workbasket.name}}</span>
|
||||||
<span class="workbasket-details__title-badge"> {{ badgeMessage$ | async }}</span>
|
<span class="workbasket-details__title-badge" matTooltip="{{ badgeMessage$ | async }}"> {{ badgeMessage$ | async }}</span>
|
||||||
</h4>
|
</h4>
|
||||||
<span class="workbasket-details__spacer"></span>
|
<span class="workbasket-details__spacer"></span>
|
||||||
<button mat-button class="workbasket-details__button workbasket-details__save-button"
|
<button mat-button class="workbasket-details__button workbasket-details__save-button"
|
||||||
|
|
|
@ -9,18 +9,24 @@
|
||||||
&__title {
|
&__title {
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
|
max-width: 392px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__title-name {
|
&__title-name {
|
||||||
display: block;
|
display: block;
|
||||||
max-width: 392px;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__title-badge {
|
&__title-badge {
|
||||||
background-color: $brown;
|
font-size: 1.1rem;
|
||||||
|
background-color: $transparent-grey;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
|
|
||||||
|
display: block;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__spacer {
|
&__spacer {
|
||||||
|
|
|
@ -27,6 +27,7 @@ import { MatToolbarModule } from '@angular/material/toolbar';
|
||||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
import { CopyWorkbasket, CreateWorkbasket } from '../../../shared/store/workbasket-store/workbasket.actions';
|
import { CopyWorkbasket, CreateWorkbasket } from '../../../shared/store/workbasket-store/workbasket.actions';
|
||||||
import { take } from 'rxjs/operators';
|
import { take } from 'rxjs/operators';
|
||||||
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||||
|
|
||||||
@Component({ selector: 'taskana-administration-workbasket-information', template: '<div>i</div>' })
|
@Component({ selector: 'taskana-administration-workbasket-information', template: '<div>i</div>' })
|
||||||
class WorkbasketInformationStub {
|
class WorkbasketInformationStub {
|
||||||
|
@ -91,6 +92,7 @@ describe('WorkbasketDetailsComponent', () => {
|
||||||
MatTabsModule,
|
MatTabsModule,
|
||||||
MatMenuModule,
|
MatMenuModule,
|
||||||
MatToolbarModule,
|
MatToolbarModule,
|
||||||
|
MatTooltipModule,
|
||||||
BrowserAnimationsModule
|
BrowserAnimationsModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
|
|
Loading…
Reference in New Issue