Skip to content

Commit

Permalink
[AAE-10219] Add css to align according to alignment property in Radio…
Browse files Browse the repository at this point in the history
…Field (#7750)

* [AAE-10219] Add css to align according to alignment property in RadioField

* [AAE-10219] Add css to align according to alignment property in RadioField

* trigger travis

* Fix nx build core

* reduce dependsOn config

* update demoshell cspell path

* [AAE-10460] fix storybook config (#7785)

* [AAE-10460] fix storybook config

* trigger travis

* trigger travis

Co-authored-by: Rafal Szmit <rafal.szmit@hyland.com>
Co-authored-by: Tomasz <tomasz.gnyp@hyland.com>
Co-authored-by: Tomasz Gnyp <49343696+tomgny@users.noreply.github.com>
  • Loading branch information
4 people committed Aug 25, 2022
1 parent 76c98c5 commit 2ef40b1
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 29 deletions.
34 changes: 7 additions & 27 deletions angular.json
Expand Up @@ -260,7 +260,7 @@
"options": {
"commands": [
{
"command": "$(npm bin)/cspell 'lib/demo-shell/**/*.ts'"
"command": "$(npm bin)/cspell 'demo-shell/**/*.ts'"
}
]
}
Expand Down Expand Up @@ -306,7 +306,7 @@
"tsConfig": "lib/core/tsconfig.lib.json",
"project": "lib/core/ng-package.json"
},
"dependsOn": ["license"],
"dependsOn": ["license", "^build"],
"configurations": {
"production": {
"project": "lib/core/ng-package.json",
Expand Down Expand Up @@ -339,11 +339,7 @@
"lib/core/api/**/*.ts",
"lib/core/api/**/*.html"
]
},
"dependsOn": [
"spellcheck",
"stylelint"
]
}
},
"storybook": {
"builder": "@storybook/angular:start-storybook",
Expand Down Expand Up @@ -454,11 +450,7 @@
"lib/content-services/**/*.ts",
"lib/content-services/**/*.html"
]
},
"dependsOn": [
"spellcheck",
"stylelint"
]
}
},
"storybook": {
"builder": "@storybook/angular:start-storybook",
Expand Down Expand Up @@ -559,11 +551,7 @@
"lib/process-services/**/*.ts",
"lib/process-services/**/*.html"
]
},
"dependsOn": [
"spellcheck",
"stylelint"
]
}
},
"spellcheck": {
"executor": "nx:run-commands",
Expand Down Expand Up @@ -632,11 +620,7 @@
"lib/process-services-cloud/**/*.ts",
"lib/process-services-cloud/**/*.html"
]
},
"dependsOn": [
"spellcheck",
"stylelint"
]
}
},
"storybook": {
"builder": "@storybook/angular:start-storybook",
Expand Down Expand Up @@ -737,11 +721,7 @@
"lib/insights/**/*.ts",
"lib/insights/**/*.html"
]
},
"dependsOn": [
"spellcheck",
"stylelint"
]
}
},
"spellcheck": {
"executor": "nx:run-commands",
Expand Down
Expand Up @@ -76,6 +76,7 @@ export class FormFieldModel extends FormWidgetModel {
currency: string = null;
dateDisplayFormat: string = this.defaultDateFormat;
selectionType: 'single' | 'multiple' = null;
alignmentType: 'vertical' | 'horizontal' = null;
rule?: FormFieldRule;
selectLoggedUser: boolean;
groupsRestriction: string[];
Expand Down Expand Up @@ -189,6 +190,7 @@ export class FormFieldModel extends FormWidgetModel {
this.validationSummary = new ErrorMessageModel();
this.tooltip = json.tooltip;
this.selectionType = json.selectionType;
this.alignmentType = json.alignmentType;
this.rule = json.rule;
this.selectLoggedUser = json.selectLoggedUser;
this.groupsRestriction = json.groupsRestriction?.groups;
Expand Down
@@ -1,8 +1,8 @@
<div class="adf-radio-buttons-widget-cloud {{field.className}}"
[class.adf-readonly]="field.readOnly" [id]="field.id">
<div class="adf-radio-button-container">
<div [ngClass]="(field.alignmentType === 'vertical') ? 'adf-radio-button-container': 'adf-radio-button-container-horizontal'">
<label class="adf-label" [attr.for]="field.id">{{field.name | translate }}<span class="adf-asterisk" *ngIf="isRequired()">*</span></label>
<mat-radio-group class="adf-radio-group" [(ngModel)]="field.value" [disabled]="field.readOnly">
<mat-radio-group [ngClass]="(field.alignmentType === 'vertical') ? 'adf-radio-group': 'adf-radio-group-horizontal'" class="adf-radio-group" [(ngModel)]="field.value" [disabled]="field.readOnly">
<mat-radio-button
[matTooltip]="field.tooltip"
matTooltipPosition="above"
Expand Down
Expand Up @@ -5,13 +5,26 @@
flex-direction: column;
}

&-radio-button-container-horizontal {
margin-bottom: 15px;
display: flex;
flex-direction: row;
}

&-radio-group {
margin-top: 15px;
margin-left: 5px;
display: inline-flex;
flex-direction: column;
}

&-radio-group-horizontal {
margin-top: 0;
margin-left: 25%;
display: inline-flex;
display: table-column-group;
}

&-radio-button {
margin: 5px;
}
Expand Down
6 changes: 6 additions & 0 deletions nx.json
Expand Up @@ -30,6 +30,12 @@
"targetDefaults": {
"build": {
"dependsOn": ["^build"]
},
"lint": {
"dependsOn": [
"spellcheck",
"stylelint"
]
}
},
"tasksRunnerOptions": {
Expand Down

0 comments on commit 2ef40b1

Please sign in to comment.