Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ACS-7351] ng15 Manage rules fixes #3751

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
z-index: 1;
display: flex;
flex-direction: row;
align-items: center;
align-items: flex-start;
overflow-x: auto;
justify-content: space-between;
padding: 12px 20px;
Expand All @@ -75,7 +75,7 @@
}
}

&__buttons {
.aca-manage-rules__container__rule-details__header__buttons {
display: flex;
flex-direction: row;
align-items: stretch;
Expand All @@ -86,7 +86,16 @@

&#delete-rule-btn {
padding: 0 8px;
margin: 0;
min-width: unset;

mat-icon {
margin: 0;
padding: 0;
width: 24px;
height: 24px;
font-size: 24px;
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,13 @@ export class RuleActionUiComponent implements ControlValueAccessor, OnInit, OnCh
ngOnChanges(changes: SimpleChanges): void {
const readOnly = changes['readOnly']?.currentValue;
if (readOnly !== undefined && readOnly !== null) {
this.readOnly = readOnly;
this.setDisabledState(readOnly);
if (readOnly) {
this.readOnly = true;
this.form.disable();
} else {
this.readOnly = false;
this.form.enable();
}
}
}

Expand Down Expand Up @@ -297,16 +302,6 @@ export class RuleActionUiComponent implements ControlValueAccessor, OnInit, OnCh
});
}

setDisabledState(isDisabled: boolean) {
if (isDisabled) {
this.readOnly = true;
this.form.disable();
} else {
this.readOnly = false;
this.form.enable();
}
}

private parseConstraintsToSelectOptions(constraints: ConstraintValue[]): CardViewSelectItemOption<unknown>[] {
return constraints
.sort((a, b) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
flex-direction: column;
}

&.aca-read-only &__checkbox label > span:first-child {
&.aca-read-only &__checkbox > div > div:first-child {
display: none;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@
.mat-mdc-select-disabled .mat-mdc-select-value {
color: inherit;
}

.mat-mdc-select-arrow-wrapper {
display: none;
}
}
}
}
38 changes: 9 additions & 29 deletions projects/aca-content/src/lib/ui/overrides/ay11.scss
Original file line number Diff line number Diff line change
Expand Up @@ -101,50 +101,30 @@
}
}

// TODO investigate after app is run
.mat-mdc-slide-toggle {
/* TODO(mdc-migration): The following rule targets internal classes of slide-toggle that may no longer apply for the MDC version. */
.mat-slide-toggle-thumb {
.mat-mdc-slide-toggle .mdc-form-field {
.mdc-switch .mdc-switch__handle {
width: 15px;
height: 15px;
transform: translate(20%, 50%);
background-color: #484a4d;
}

/* TODO(mdc-migration): The following rule targets internal classes of slide-toggle that may no longer apply for the MDC version. */
.mat-slide-toggle-bar {
.mdc-switch .mdc-switch__track {
border-radius: 15px;
height: 20px;
}

/* TODO(mdc-migration): The following rule targets internal classes of slide-toggle that may no longer apply for the MDC version. */
.mat-slide-toggle-thumb-container {
top: -5px;
.mdc-switch__handle-track {
top: -15px;
}

/* TODO(mdc-migration): The following rule targets internal classes of slide-toggle that may no longer apply for the MDC version. */
.mat-slide-toggle-ripple {
.mdc-switch__ripple {
display: none;
}
}

&.cdk-keyboard-focused {
/* TODO(mdc-migration): The following rule targets internal classes of slide-toggle that may no longer apply for the MDC version. */
.mat-slide-toggle-bar {
outline: 2px solid var(--theme-blue-button-color);
}
}

&.mat-primary.mat-checked:not(.mat-disabled) {
/* TODO(mdc-migration): The following rule targets internal classes of slide-toggle that may no longer apply for the MDC version. */
.mat-slide-toggle-bar {
background-color: var(--theme-blue-button-color);
}

/* TODO(mdc-migration): The following rule targets internal classes of slide-toggle that may no longer apply for the MDC version. */
.mat-slide-toggle-thumb {
background-color: white;
}
}
.mat-mdc-slide-toggle.cdk-keyboard-focused .mdc-form-field .mdc-switch .mdc-switch__track {
outline: 2px solid var(--theme-blue-button-color);
}

.mat-mdc-outlined-button,
Expand Down
22 changes: 22 additions & 0 deletions projects/aca-content/src/lib/ui/theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,28 @@ mat-icon {
color: var(--theme-secondary-text);
}

mat-slide-toggle {
.mdc-switch__icons {
display: none;
}

.mdc-switch--unselected.mdc-switch:enabled .mdc-switch__track::before {
background: var(--adf-theme-foreground-disabled-text-color);
}
nikita-web-ua marked this conversation as resolved.
Show resolved Hide resolved

.mdc-switch--unselected.mdc-switch:enabled:active .mdc-switch__track::before {
background: var(--adf-theme-foreground-disabled-text-color);
}

.mdc-switch--unselected.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::before {
background: var(--adf-theme-foreground-disabled-text-color);
}

.mdc-switch--unselected.mdc-switch:enabled:hover:not(:focus:active) .mdc-switch__track::before {
background: var(--adf-theme-foreground-disabled-text-color);
}
}

.mat-mdc-tab-list {
.mat-mdc-tab-labels {
.mdc-tab--active {
Expand Down