Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.

Commit

Permalink
Make post-aggregator mandatory to prevent weird issues (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
raqbit authored Sep 24, 2018
1 parent 7f1f1e8 commit e8287ee
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 23 deletions.
45 changes: 23 additions & 22 deletions src/app/core/import/tag-select/tag-table/tag-table.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,13 @@
<th cdk-header-cell *cdkHeaderCellDef class="mdl-data-table__cell--non-numeric">Name</th>
<td cdk-cell *cdkCellDef="let tag" class="mdl-data-table__cell--non-numeric">{{tag.name}}</td>
</ng-container>
<ng-container cdkColumnDef="limit">
<th cdk-header-cell *cdkHeaderCellDef class="mdl-data-table__cell--non-numeric">Limit</th>
<td cdk-cell *cdkCellDef="let tag; let i = index" class="mdl-data-table__cell--non-numeric">
<mdl-textfield
floating-label
label="Enter a limit"
required
class="limit"
name="{{i}}_limit"
[(ngModel)]="tags[i].limit"
#limitInput="ngModel"
pattern="^[0-9]+$"
[disabled]="!selection.isSelected(tag)"
error-msg="Please enter a valid limit"
[class.is-invalid]="(limitInput.pristine && limitInput.enabled) || limitInput.errors && (limitInput.dirty || limitInput.touched)"
(change)="onTagChange()">
</mdl-textfield>
</td>
</ng-container>
<ng-container cdkColumnDef="postAggr">
<th cdk-header-cell *cdkHeaderCellDef class="mdl-data-table__cell--non-numeric">Post-Aggregator</th>
<td cdk-cell *cdkCellDef="let tag; let i = index" class="mdl-data-table__cell--non-numeric">
<mdl-select
floating-label
label="Select a post-aggregator"
required
label="Post-aggregator"
name="{{i}}_postAggr"
class="post_aggregator"
[(ngModel)]="tags[i].postAggr"
Expand All @@ -52,13 +34,32 @@
[disabled]="!selection.isSelected(tag)"
[class.is-invalid]="postAggrSelect.errors && (postAggrSelect.dirty || postAggrSelect.touched)"
(change)="onTagChange()">
<mdl-option value><em>None</em></mdl-option>
<mdl-option [value]><em>None</em></mdl-option>
<mdl-option *ngFor="let option of getPostAggrOptions(tag.type)" [value]="option">
{{option}}
</mdl-option>
</mdl-select>
</td>
</ng-container>
<ng-container cdkColumnDef="limit">
<th cdk-header-cell *cdkHeaderCellDef class="mdl-data-table__cell--non-numeric">Limit</th>
<td cdk-cell *cdkCellDef="let tag; let i = index" class="mdl-data-table__cell--non-numeric">
<mdl-textfield
floating-label
label="Limit"
required
class="limit"
name="{{i}}_limit"
[(ngModel)]="tags[i].limit"
#limitInput="ngModel"
pattern="^[0-9]+$"
[disabled]="!selection.isSelected(tag) || !tags[i].postAggr"
error-msg="Please enter a valid limit"
[class.is-invalid]="(limitInput.pristine && limitInput.enabled) || limitInput.errors && (limitInput.dirty || limitInput.touched)"
(change)="onTagChange()">
</mdl-textfield>
</td>
</ng-container>
<ng-container cdkColumnDef="formula">
<th cdk-header-cell *cdkHeaderCellDef class="mdl-data-table__cell--non-numeric">Formula</th>
<td cdk-cell *cdkCellDef="let tag; let i = index" class="mdl-data-table__cell--non-numeric">
Expand All @@ -73,7 +74,7 @@
[disabled]="!selection.isSelected(tag) || shouldDisableFormula(tag)"
[class.is-invalid]="formulaOperatorSelect.errors && (formulaOperatorSelect.dirty || formulaOperatorSelect.touched)"
(change)="onTagChange()">
<mdl-option value><em>None</em></mdl-option>
<mdl-option [value]><em>None</em></mdl-option>
<mdl-option *ngFor="let option of getOperatorOptions()" [value]="option">
{{option}}
</mdl-option>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class TagTableComponent implements OnInit {
/**
* The table columns to be displayed
*/
displayedColumns = ['select', 'name', 'limit', 'postAggr', 'formula'];
displayedColumns = ['select', 'name', 'postAggr', 'limit', 'formula'];

/**
* Datasource for the table
Expand Down

0 comments on commit e8287ee

Please sign in to comment.