Skip to content

Commit

Permalink
Update Button and Accordion Fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
nunofreitas96 committed Jun 26, 2020
1 parent 2f277ab commit 6e480c3
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 25 deletions.
7 changes: 4 additions & 3 deletions frontend/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
MatButtonModule,
MatExpansionModule,
MatFormFieldModule,
MatInputModule,
MatInputModule, MatListModule,
MatOptionModule,
MatSelectModule,
MatSliderModule
Expand All @@ -32,7 +32,7 @@ const appRoutes: Routes = [
{ path: ':uid', component: EditEntityComponent },
{ path: '', component: SearchComponent },
{ path: 'viewtemplate/:uid', component: ViewTemplateComponent },
{ path: 'eva/:uid', component: DocumentComponentComponent}
{ path: 'uidglab/:uid', component: DocumentComponentComponent}

];

Expand Down Expand Up @@ -69,7 +69,8 @@ const appRoutes: Routes = [
MatFormFieldModule,
MatInputModule,
MatOptionModule,
MatSelectModule
MatSelectModule,
MatListModule
],
providers: [MyServiceService],
bootstrap: [ AppComponent ],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<mat-accordion>

<mat-expansion-panel>
<mat-expansion-panel-header>
Expand All @@ -9,27 +8,20 @@

<mat-form-field>
<mat-label>Title Name</mat-label>
<input matInput [value]="titleName">
<input matInput [value]="titleName" [(ngModel)]="titleName">
</mat-form-field>

<mat-form-field>
<mat-label>Type</mat-label>
<input matInput [value]=titleType >
</mat-form-field>

<div>
<mat-form-field>
<mat-label>Change Type</mat-label>
<mat-select>
<mat-option *ngFor="let title of titleTypes" [value]="title.value">
<mat-select [(value)]=titleType>
<mat-option *ngFor="let title of titleTypes" [value]="title.option">
{{title.option}}
</mat-option>
</mat-select>
</mat-form-field>
</div>

</mat-expansion-panel>

<mat-expansion-panel >
<mat-expansion-panel-header>
<mat-panel-title>
Expand All @@ -39,23 +31,18 @@

<mat-form-field>
<mat-label>Identifier</mat-label>
<input matInput [value]=identifierName>
<input matInput [value]=identifierName [(ngModel)]="identifierName">
</mat-form-field>

<mat-form-field>
<mat-label>Type</mat-label>
<input matInput [value]=identifierType>
</mat-form-field>

<div>
<mat-form-field>
<mat-label>Change Type</mat-label>
<mat-select>
<mat-option *ngFor="let identifier of identifierTypes" [value]="identifier .value">
{{identifier .option}}
<mat-select [(value)]=identifierType>
<mat-option *ngFor="let identifier of identifierTypes" [value]="identifier.option">
{{identifier.option}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
</mat-expansion-panel>
</mat-accordion>

<button mat-raised-button disabled color="primary" [disabled]="checkChange()">Update</button>
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ export class DocumentComponentComponent implements OnInit {

template = {};

ftitleType = '';
ftitleName = '';
fidentifierName = '';
fidentifierType = '';
titleType = '';
titleName = '';
identifierName = '';
Expand Down Expand Up @@ -73,6 +77,10 @@ export class DocumentComponentComponent implements OnInit {
this.identifierName = returnedTemplate.identifier[0].value;
this.titleType = returnedTemplate.title[0].type;
this.titleName = returnedTemplate.title[0].value;
this.fidentifierType = returnedTemplate.identifier[0].type;
this.fidentifierName = returnedTemplate.identifier[0].value;
this.ftitleType = returnedTemplate.title[0].type;
this.ftitleName = returnedTemplate.title[0].value;
this.getTitleTypes();
});
}
Expand All @@ -95,4 +103,11 @@ export class DocumentComponentComponent implements OnInit {

}

checkChange() {

// tslint:disable-next-line:max-line-length
return this.ftitleName === this.titleName && this.fidentifierName === this.identifierName && this.fidentifierType === this.identifierType && this.ftitleType === this.titleType;

}

}

0 comments on commit 6e480c3

Please sign in to comment.