mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[MNT-25175] configured scripts to execute are listed by node id and not by script name (#10969)
* [MNT-25175] Styles and title for non editable property * [MNT-25175] Unit test
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
<div *ngSwitchDefault>
|
<div *ngSwitchDefault>
|
||||||
<div *ngIf="!isEditable"
|
<div *ngIf="!isEditable"
|
||||||
[attr.data-automation-id]="'card-select-label-' + property.key"
|
[attr.data-automation-id]="'card-select-label-' + property.key"
|
||||||
class="adf-property-label"
|
class="adf-property-label adf-property-label-non-editable"
|
||||||
>{{ property.label | translate }}
|
>{{ property.label | translate }}
|
||||||
</div>
|
</div>
|
||||||
<div class="adf-property-field">
|
<div class="adf-property-field">
|
||||||
@@ -12,6 +12,7 @@
|
|||||||
class="adf-property-value adf-property-read-only"
|
class="adf-property-value adf-property-read-only"
|
||||||
[attr.data-automation-id]="'select-readonly-value-' + property.key"
|
[attr.data-automation-id]="'select-readonly-value-' + property.key"
|
||||||
data-automation-class="read-only-value"
|
data-automation-class="read-only-value"
|
||||||
|
[title]="property.displayValue | async | translate"
|
||||||
>
|
>
|
||||||
{{ property.displayValue | async | translate }}
|
{{ property.displayValue | async | translate }}
|
||||||
</div>
|
</div>
|
||||||
|
@@ -49,6 +49,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.adf-property-read-only {
|
.adf-property-read-only {
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
cursor: default;
|
||||||
padding: 6px 0;
|
padding: 6px 0;
|
||||||
border-bottom: 1px solid var(--adf-metadata-property-panel-border-color);
|
border-bottom: 1px solid var(--adf-metadata-property-panel-border-color);
|
||||||
color: var(--adf-metadata-property-panel-title-color);
|
color: var(--adf-metadata-property-panel-title-color);
|
||||||
@@ -61,4 +65,11 @@
|
|||||||
.adf-property-readonly-value {
|
.adf-property-readonly-value {
|
||||||
color: var(--adf-metadata-property-panel-label-color);
|
color: var(--adf-metadata-property-panel-label-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.adf-property-label {
|
||||||
|
&-non-editable {
|
||||||
|
cursor: default;
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -27,6 +27,7 @@ import { MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';
|
|||||||
import { NoopTranslateModule } from '../../../testing/noop-translate.module';
|
import { NoopTranslateModule } from '../../../testing/noop-translate.module';
|
||||||
import { UnitTestingUtils } from '../../../testing/unit-testing-utils';
|
import { UnitTestingUtils } from '../../../testing/unit-testing-utils';
|
||||||
import { CardViewUpdateService } from '../../services/card-view-update.service';
|
import { CardViewUpdateService } from '../../services/card-view-update.service';
|
||||||
|
import { DebugElement } from '@angular/core';
|
||||||
|
|
||||||
describe('CardViewSelectItemComponent', () => {
|
describe('CardViewSelectItemComponent', () => {
|
||||||
let loader: HarnessLoader;
|
let loader: HarnessLoader;
|
||||||
@@ -78,6 +79,8 @@ describe('CardViewSelectItemComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('Rendering', () => {
|
describe('Rendering', () => {
|
||||||
|
const getReadOnlyElement = (): DebugElement => testingUtils.getByDataAutomationClass('read-only-value');
|
||||||
|
|
||||||
it('should render custom label when editable is set to false', () => {
|
it('should render custom label when editable is set to false', () => {
|
||||||
component.property = new CardViewSelectItemModel({
|
component.property = new CardViewSelectItemModel({
|
||||||
...mockDefaultProps,
|
...mockDefaultProps,
|
||||||
@@ -95,14 +98,22 @@ describe('CardViewSelectItemComponent', () => {
|
|||||||
|
|
||||||
component.ngOnChanges({});
|
component.ngOnChanges({});
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
|
|
||||||
const readOnly = testingUtils.getByDataAutomationClass('read-only-value');
|
|
||||||
const selectBox = testingUtils.getByDataAutomationClass('select-box');
|
const selectBox = testingUtils.getByDataAutomationClass('select-box');
|
||||||
|
|
||||||
expect(readOnly).not.toBeNull();
|
expect(getReadOnlyElement()).not.toBeNull();
|
||||||
expect(selectBox).toBeNull();
|
expect(selectBox).toBeNull();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should read only value have title', () => {
|
||||||
|
component.property = new CardViewSelectItemModel({
|
||||||
|
...mockDefaultProps,
|
||||||
|
editable: false
|
||||||
|
});
|
||||||
|
|
||||||
|
fixture.detectChanges();
|
||||||
|
expect(getReadOnlyElement().nativeElement.title).toBe('Two');
|
||||||
|
});
|
||||||
|
|
||||||
it('should be possible edit selectBox item', async () => {
|
it('should be possible edit selectBox item', async () => {
|
||||||
component.property = new CardViewSelectItemModel({
|
component.property = new CardViewSelectItemModel({
|
||||||
...mockDefaultProps,
|
...mockDefaultProps,
|
||||||
|
Reference in New Issue
Block a user