From 57713dbe6e9ae96be08aff16fa0316a31d3b3bf0 Mon Sep 17 00:00:00 2001
From: AleksanderSklorz <115619721+AleksanderSklorz@users.noreply.github.com>
Date: Tue, 1 Jul 2025 08:01:20 +0200
Subject: [PATCH] [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
---
.../card-view-selectitem.component.html | 3 ++-
.../card-view-selectitem.component.scss | 11 +++++++++++
.../card-view-selectitem.component.spec.ts | 17 ++++++++++++++---
3 files changed, 27 insertions(+), 4 deletions(-)
diff --git a/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.html b/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.html
index a81e25609b..617952bf48 100644
--- a/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.html
+++ b/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.html
@@ -3,7 +3,7 @@
{{ property.label | translate }}
@@ -12,6 +12,7 @@
class="adf-property-value adf-property-read-only"
[attr.data-automation-id]="'select-readonly-value-' + property.key"
data-automation-class="read-only-value"
+ [title]="property.displayValue | async | translate"
>
{{ property.displayValue | async | translate }}
diff --git a/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.scss b/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.scss
index 1ad1b29e64..e433dc7ec0 100644
--- a/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.scss
+++ b/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.scss
@@ -49,6 +49,10 @@
}
.adf-property-read-only {
+ text-overflow: ellipsis;
+ overflow: hidden;
+ white-space: nowrap;
+ cursor: default;
padding: 6px 0;
border-bottom: 1px solid var(--adf-metadata-property-panel-border-color);
color: var(--adf-metadata-property-panel-title-color);
@@ -61,4 +65,11 @@
.adf-property-readonly-value {
color: var(--adf-metadata-property-panel-label-color);
}
+
+ .adf-property-label {
+ &-non-editable {
+ cursor: default;
+ font-size: 10px;
+ }
+ }
}
diff --git a/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.spec.ts b/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.spec.ts
index df05d022a5..fb7d8fbfb3 100644
--- a/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.spec.ts
+++ b/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.spec.ts
@@ -27,6 +27,7 @@ import { MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';
import { NoopTranslateModule } from '../../../testing/noop-translate.module';
import { UnitTestingUtils } from '../../../testing/unit-testing-utils';
import { CardViewUpdateService } from '../../services/card-view-update.service';
+import { DebugElement } from '@angular/core';
describe('CardViewSelectItemComponent', () => {
let loader: HarnessLoader;
@@ -78,6 +79,8 @@ describe('CardViewSelectItemComponent', () => {
});
describe('Rendering', () => {
+ const getReadOnlyElement = (): DebugElement => testingUtils.getByDataAutomationClass('read-only-value');
+
it('should render custom label when editable is set to false', () => {
component.property = new CardViewSelectItemModel({
...mockDefaultProps,
@@ -95,14 +98,22 @@ describe('CardViewSelectItemComponent', () => {
component.ngOnChanges({});
fixture.detectChanges();
-
- const readOnly = testingUtils.getByDataAutomationClass('read-only-value');
const selectBox = testingUtils.getByDataAutomationClass('select-box');
- expect(readOnly).not.toBeNull();
+ expect(getReadOnlyElement()).not.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 () => {
component.property = new CardViewSelectItemModel({
...mockDefaultProps,