new-is-app-angular2 #12
|
@ -6,12 +6,12 @@
|
||||||
|
|
||||||
<mat-form-field appearance="fill" style="width: 100%;">
|
<mat-form-field appearance="fill" style="width: 100%;">
|
||||||
<mat-label>ID</mat-label>
|
<mat-label>ID</mat-label>
|
||||||
<input matInput required readonly value="{{data.id}}"/>
|
<input matInput readonly value="{{data.id}}"/>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<mat-form-field appearance="fill" style="width: 100%;">
|
<mat-form-field appearance="fill" style="width: 100%;">
|
||||||
<mat-label>Content ({{data.contentType}})</mat-label>
|
<mat-label>Content ({{data.contentType}})</mat-label>
|
||||||
<textarea matInput formControlName="content" rows="16" required style="font-size: 0.8em;"></textarea>
|
<textarea matInput formControlName="content" required rows="16" style="font-size: 0.8em;"></textarea>
|
||||||
<mat-error *ngIf="contentForm.get('content')?.invalid">This field is <strong>required</strong></mat-error>
|
<mat-error *ngIf="contentForm.get('content')?.invalid">This field is <strong>required</strong></mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -5,14 +5,12 @@
|
||||||
|
|
||||||
<mat-form-field appearance="fill" style="width: 100%;">
|
<mat-form-field appearance="fill" style="width: 100%;">
|
||||||
<mat-label>ID</mat-label>
|
<mat-label>ID</mat-label>
|
||||||
<input matInput formControlName="id" required readonly />
|
<input matInput readonly value="{{data.id}}"/>
|
||||||
<mat-error *ngIf="metadataForm.get('id')?.invalid">This field should not be empty</mat-error>
|
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<mat-form-field appearance="fill" style="width: 100%;">
|
<mat-form-field appearance="fill" style="width: 100%;">
|
||||||
<mat-label>Type</mat-label>
|
<mat-label>Type</mat-label>
|
||||||
<input matInput formControlName="type" required readonly />
|
<input matInput readonly value="{{data.type}}" />
|
||||||
<mat-error *ngIf="metadataForm.get('type')?.invalid">This field should not be empty</mat-error>
|
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<mat-form-field appearance="fill" style="width: 100%;">
|
<mat-form-field appearance="fill" style="width: 100%;">
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
<mat-form-field appearance="fill" style="width: 100%;">
|
<mat-form-field appearance="fill" style="width: 100%;">
|
||||||
<mat-label>Content ({{data.contentType}})</mat-label>
|
<mat-label>Content ({{data.contentType}})</mat-label>
|
||||||
<textarea matInput formControlName="content" rows="10" required style="font-size: 0.8em;"></textarea>
|
<textarea matInput formControlName="content" required rows="10" style="font-size: 0.8em;"></textarea>
|
||||||
<mat-error *ngIf="newResourceForm.get('content')?.invalid">This field is <strong>required</strong></mat-error>
|
<mat-error *ngIf="newResourceForm.get('content')?.invalid">This field is <strong>required</strong></mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,7 @@ export class ResourcesComponent implements OnInit {
|
||||||
styleUrls: ['resources.component.css']
|
styleUrls: ['resources.component.css']
|
||||||
})
|
})
|
||||||
export class ResContentDialog {
|
export class ResContentDialog {
|
||||||
contentFormControl = new FormControl('', [Validators.required]);
|
contentFormControl = new FormControl('');
|
||||||
|
|
||||||
contentForm = new FormGroup({
|
contentForm = new FormGroup({
|
||||||
content : this.contentFormControl
|
content : this.contentFormControl
|
||||||
|
@ -145,15 +145,11 @@ export class ResContentDialog {
|
||||||
})
|
})
|
||||||
export class ResMetadataDialog {
|
export class ResMetadataDialog {
|
||||||
metadataForm = new FormGroup({
|
metadataForm = new FormGroup({
|
||||||
id: new FormControl('', [Validators.required]),
|
name: new FormControl(''),
|
||||||
type: new FormControl('', [Validators.required]),
|
description : new FormControl('')
|
||||||
name: new FormControl('', [Validators.required]),
|
|
||||||
description : new FormControl('', [])
|
|
||||||
});
|
});
|
||||||
|
|
||||||
constructor(public dialogRef: MatDialogRef<ResMetadataDialog>, @Inject(MAT_DIALOG_DATA) public data: any, public service: ISService) {
|
constructor(public dialogRef: MatDialogRef<ResMetadataDialog>, @Inject(MAT_DIALOG_DATA) public data: any, public service: ISService) {
|
||||||
this.metadataForm.get('id')?.setValue(data.id);
|
|
||||||
this.metadataForm.get('type')?.setValue(data.type);
|
|
||||||
this.metadataForm.get('name')?.setValue(data.name);
|
this.metadataForm.get('name')?.setValue(data.name);
|
||||||
if (data.description) {
|
if (data.description) {
|
||||||
this.metadataForm.get('description')?.setValue(data.description);
|
this.metadataForm.get('description')?.setValue(data.description);
|
||||||
|
@ -184,9 +180,9 @@ export class ResMetadataDialog {
|
||||||
})
|
})
|
||||||
export class ResCreateNewDialog {
|
export class ResCreateNewDialog {
|
||||||
newResourceForm = new FormGroup({
|
newResourceForm = new FormGroup({
|
||||||
name: new FormControl('', [Validators.required]),
|
name: new FormControl(''),
|
||||||
description : new FormControl('', []),
|
description : new FormControl(''),
|
||||||
content : new FormControl('', [Validators.required])
|
content : new FormControl('')
|
||||||
});
|
});
|
||||||
|
|
||||||
constructor(public dialogRef: MatDialogRef<ResCreateNewDialog>, @Inject(MAT_DIALOG_DATA) public data: any, public service: ISService) {}
|
constructor(public dialogRef: MatDialogRef<ResCreateNewDialog>, @Inject(MAT_DIALOG_DATA) public data: any, public service: ISService) {}
|
||||||
|
|
Loading…
Reference in New Issue