Skip to content

Commit

Permalink
[ACS-6245] remove mat-card and internal styling from demo shell (#9050)
Browse files Browse the repository at this point in the history
* remove mat-card from properties demo

* remove mat-card from demo shell viewer (versions)

* cleanup host settings component in demo shell

* cleanup cloud settings
  • Loading branch information
DenysVuika committed Oct 31, 2023
1 parent e8ea75d commit 5d72597
Show file tree
Hide file tree
Showing 8 changed files with 165 additions and 170 deletions.
18 changes: 8 additions & 10 deletions demo-shell/src/app/components/card-view/card-view.component.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
<div class="app-main-content">
<h1>CardView Component</h1>

<mat-card class="app-card-view">
<adf-card-view
[properties]="properties"
[editable]="isEditable"
[displayClearAction]="showClearDateAction"
[displayNoneOption]="showNoneOption"
[displayLabelForChips]="showLabelForChips">
</adf-card-view>
</mat-card>
<adf-card-view
[properties]="properties"
[editable]="isEditable"
[displayClearAction]="showClearDateAction"
[displayNoneOption]="showNoneOption"
[displayLabelForChips]="showLabelForChips">
</adf-card-view>

<div class="app-console" #console>
<div class="app-console">
<h3>Changes log:</h3>
<p *ngFor="let log of logs">{{ log }}</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
padding: 0 15px;
}

.app-card-view {
adf-card-view {
width: 30%;
display: inline-block;
}
Expand Down
28 changes: 15 additions & 13 deletions demo-shell/src/app/components/card-view/card-view.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { Component, OnInit, ElementRef, ViewChild, OnDestroy } from '@angular/core';
import { Component, OnInit, OnDestroy } from '@angular/core';
import {
CardViewTextItemModel,
CardViewDateItemModel,
Expand All @@ -39,9 +39,6 @@ import { takeUntil } from 'rxjs/operators';
styleUrls: ['./card-view.component.scss']
})
export class CardViewComponent implements OnInit, OnDestroy {

@ViewChild('console', { static: true }) console: ElementRef;

isEditable = true;
properties: any;
logs: string[];
Expand All @@ -51,8 +48,7 @@ export class CardViewComponent implements OnInit, OnDestroy {

private onDestroy$ = new Subject<boolean>();

constructor(private cardViewUpdateService: CardViewUpdateService,
private decimalNumberPipe: DecimalNumberPipe) {
constructor(private cardViewUpdateService: CardViewUpdateService, private decimalNumberPipe: DecimalNumberPipe) {
this.logs = [];
this.createCard();
}
Expand All @@ -62,9 +58,7 @@ export class CardViewComponent implements OnInit, OnDestroy {
}

ngOnInit() {
this.cardViewUpdateService.itemUpdated$
.pipe(takeUntil(this.onDestroy$))
.subscribe(this.onItemChange.bind(this));
this.cardViewUpdateService.itemUpdated$.pipe(takeUntil(this.onDestroy$)).subscribe(this.onItemChange.bind(this));
}

ngOnDestroy() {
Expand Down Expand Up @@ -192,20 +186,29 @@ export class CardViewComponent implements OnInit, OnDestroy {
}),
new CardViewKeyValuePairsItemModel({
label: 'CardView Key-Value Pairs Item',
value: [{ name: 'hey', value: 'you' }, { name: 'hey', value: 'you' }],
value: [
{ name: 'hey', value: 'you' },
{ name: 'hey', value: 'you' }
],
key: 'key-value-pairs',
editable: this.isEditable
}),
new CardViewKeyValuePairsItemModel({
label: 'CardView Key-Value Pairs Item',
value: [{ name: 'hey', value: 'you' }, { name: 'hey', value: 'you' }],
value: [
{ name: 'hey', value: 'you' },
{ name: 'hey', value: 'you' }
],
key: 'key-value-pairs',
editable: false
}),
new CardViewSelectItemModel({
label: 'CardView Select Item',
value: 'one',
options$: of([{ key: 'one', label: 'One' }, { key: 'two', label: 'Two' }]),
options$: of([
{ key: 'one', label: 'One' },
{ key: 'two', label: 'Two' }
]),
key: 'select',
editable: this.isEditable
}),
Expand Down Expand Up @@ -253,7 +256,6 @@ export class CardViewComponent implements OnInit, OnDestroy {
}

this.logs.push(`[${notification.target.label}] - ${value}`);
this.console.nativeElement.scrollTop = this.console.nativeElement.scrollHeight;
}

toggleEditable() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,40 +16,38 @@
<mat-slide-toggle [checked]="processDetailsRedirection" (change)="toggleProcessDetailsRedirection()" data-automation-id="processDetailsRedirection">
Display process details on process click
</mat-slide-toggle>
<mat-form-field data-automation-id="selectionMode">

<mat-form-field data-automation-id="selectionMode" class="adf-cloud-settings-selection-mode">
<mat-label>Selection Mode</mat-label>
<mat-select [(ngModel)]="selectionMode" (selectionChange)="onSelectionModeChange()">
<mat-option *ngFor="let option of selectionModeOptions" [value]="option.value">
{{ option.title }}
</mat-option>
</mat-select>
</mat-form-field>
<mat-card *ngIf="actionMenu || contextMenu">
<mat-card-header>
<mat-card-title>Add Action</mat-card-title>
</mat-card-header>
<mat-card-content>
<form class="app-cloud-settings-form" [formGroup]="actionMenuForm">
<mat-form-field>
<input matInput formControlName="key" placeholder="Key">
</mat-form-field>
<mat-form-field>
<input matInput formControlName="title" placeholder="Title">
</mat-form-field>
<mat-form-field>
<input matInput formControlName="icon" placeholder="Icon">
</mat-form-field>
<mat-checkbox formControlName="visible">Visible</mat-checkbox>
<mat-checkbox formControlName="disabled">Disable</mat-checkbox>
<button mat-raised-button (click)="addAction()">Add</button>
</form>
<div *ngIf="actions.length > 0">
<mat-chip-list>
<mat-chip *ngFor="let action of actions" [removable]="true">
{{action.title}}
<mat-icon matChipRemove (click)="removeAction(action)">cancel</mat-icon>
</mat-chip>
</mat-chip-list>
</div>
</mat-card-content>
</mat-card>

<div class="app-cloud-actions" *ngIf="actionMenu || contextMenu">
<h2>Add Action</h2>
<form class="app-cloud-settings-form" [formGroup]="actionMenuForm">
<mat-form-field class="app-cloud-settings-form-input">
<input matInput formControlName="key" placeholder="Key">
</mat-form-field>
<mat-form-field class="app-cloud-settings-form-input">
<input matInput formControlName="title" placeholder="Title">
</mat-form-field>
<mat-form-field class="app-cloud-settings-form-input">
<input matInput formControlName="icon" placeholder="Icon">
</mat-form-field>
<mat-checkbox formControlName="visible">Visible</mat-checkbox>
<mat-checkbox formControlName="disabled">Disable</mat-checkbox>
<button mat-raised-button (click)="addAction()">Add</button>
</form>
<div *ngIf="actions.length > 0">
<mat-chip-list>
<mat-chip *ngFor="let action of actions" [removable]="true">
{{action.title}}
<mat-icon matChipRemove (click)="removeAction(action)">cancel</mat-icon>
</mat-chip>
</mat-chip-list>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ app-cloud-settings {
display: flex;
flex: 1;

mat-form-field {
.app-cloud-actions {
background-color: white;
}

.adf-cloud-settings-selection-mode {
max-width: 200px;
}

Expand All @@ -13,13 +17,9 @@ app-cloud-settings {
place-content: center space-around;
align-items: center;

mat-form-field {
.app-cloud-settings-form-input {
flex: 1 1 100%;
max-width: 23%;
}

mat-form-field, mat-checkbox {
margin-right: 20px;
}
}
}
12 changes: 4 additions & 8 deletions demo-shell/src/app/components/file-view/file-view.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,10 @@
</adf-info-drawer-tab>

<adf-info-drawer-tab label="Versions">
<mat-card>
<mat-card-content>
<adf-version-manager [node]="node"
(uploadError)="onUploadError($event)"
(viewVersion)="onViewVersion($event)">
</adf-version-manager>
</mat-card-content>
</mat-card>
<adf-version-manager [node]="node"
(uploadError)="onUploadError($event)"
(viewVersion)="onViewVersion($event)">
</adf-version-manager>
</adf-info-drawer-tab>
</adf-info-drawer>
</ng-template>

0 comments on commit 5d72597

Please sign in to comment.