-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged in bugfix/SHIBUI-578 (pull request #110)
SHIBUI-578 Added required field markers Approved-by: Shibui Jenkins <shibui.jenkins@gmail.com> Approved-by: Ryan Mathis <rmathis@unicon.net>
- Loading branch information
Showing
19 changed files
with
197 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 12 additions & 2 deletions
14
ui/src/app/schema-form/widget/datalist/datalist.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
import { Component, OnChanges } from '@angular/core'; | ||
|
||
import { ControlWidget } from 'ngx-schema-form'; | ||
import { OneOf } from '../../model/one-of'; | ||
import { SchemaService } from '../../service/schema.service'; | ||
|
||
@Component({ | ||
selector: 'datalist-component', | ||
templateUrl: `./datalist.component.html` | ||
}) | ||
export class DatalistComponent extends ControlWidget {} | ||
export class DatalistComponent extends ControlWidget { | ||
constructor( | ||
private widgetService: SchemaService | ||
) { | ||
super(); | ||
} | ||
|
||
get required(): boolean { | ||
return this.widgetService.isRequired(this.formProperty); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
ui/src/app/schema-form/widget/number/number.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<div class="widget form-group"> | ||
<label [attr.for]="id" class="d-flex justify-content-between control-label"> | ||
<span>{{ schema.title }} <i class="fa fa-asterisk text-danger" aria-hidden="true" *ngIf="required"></i></span> | ||
<span *ngIf="schema.description"> | ||
<ng-template #tooltip i18n="@@tooltip--description">{{ schema.description }}</ng-template> | ||
<i class="info-icon fa fa-fw fa-info-circle text-primary fa-lg" | ||
[ngbPopover]="tooltip" | ||
i18n-aria-label="@@tooltip--instruction" | ||
aria-label="Information icon - press spacebar to read additional information for this form field"></i> | ||
</span> | ||
</label> | ||
<span *ngIf="schema.description" class="formHelp">{{schema.description}}</span> | ||
<input [attr.readonly]="schema.readOnly?true:null" | ||
[name]="name" | ||
class="text-widget integer-widget form-control" | ||
[formControl]="control" | ||
[attr.type]="'number'" [attr.min]="schema.minimum" [attr.max]="schema.maximum" | ||
[attr.placeholder]="schema.placeholder" | ||
[attr.maxLength]="schema.maxLength || null" | ||
[attr.minLength]="schema.minLength || null"> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { | ||
Component, | ||
} from '@angular/core'; | ||
import { IntegerWidget } from 'ngx-schema-form'; | ||
import { SchemaService } from '../../service/schema.service'; | ||
|
||
@Component({ | ||
selector: 'integer-component', | ||
templateUrl: `./number.component.html` | ||
}) | ||
export class CustomIntegerComponent extends IntegerWidget { | ||
constructor( | ||
private widgetService: SchemaService | ||
) { | ||
super(); | ||
} | ||
|
||
get required(): boolean { | ||
return this.widgetService.isRequired(this.formProperty); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,20 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
import { ControlWidget } from 'ngx-schema-form'; | ||
import { SelectWidget } from 'ngx-schema-form'; | ||
import { SchemaService } from '../../service/schema.service'; | ||
|
||
@Component({ | ||
selector: 'select-component', | ||
templateUrl: `./select.component.html` | ||
}) | ||
export class CustomSelectComponent extends ControlWidget { } | ||
export class CustomSelectComponent extends SelectWidget { | ||
constructor( | ||
private widgetService: SchemaService | ||
) { | ||
super(); | ||
} | ||
|
||
get required(): boolean { | ||
return this.widgetService.isRequired(this.formProperty); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,21 @@ | ||
import { Component } from '@angular/core'; | ||
import { StringWidget } from 'ngx-schema-form'; | ||
import { SchemaService } from '../../service/schema.service'; | ||
|
||
@Component({ | ||
selector: 'custom-string', | ||
templateUrl: `./string.component.html`, | ||
styleUrls: ['../widget.component.scss'] | ||
}) | ||
export class CustomStringComponent extends StringWidget {} | ||
export class CustomStringComponent extends StringWidget { | ||
|
||
constructor( | ||
private widgetService: SchemaService | ||
) { | ||
super(); | ||
} | ||
|
||
get required(): boolean { | ||
return this.widgetService.isRequired(this.formProperty); | ||
} | ||
} |
5 changes: 4 additions & 1 deletion
5
ui/src/app/schema-form/widget/textarea/textarea.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 12 additions & 1 deletion
13
ui/src/app/schema-form/widget/textarea/textarea.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,20 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
import { TextAreaWidget } from 'ngx-schema-form'; | ||
import { SchemaService } from '../../service/schema.service'; | ||
|
||
@Component({ | ||
selector: 'textarea-component', | ||
templateUrl: `./textarea.component.html` | ||
}) | ||
export class CustomTextAreaComponent extends TextAreaWidget {} | ||
export class CustomTextAreaComponent extends TextAreaWidget { | ||
constructor( | ||
private widgetService: SchemaService | ||
) { | ||
super(); | ||
} | ||
|
||
get required(): boolean { | ||
return this.widgetService.isRequired(this.formProperty); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.