Skip to content

Commit

Permalink
260 filter scenarios (#145)
Browse files Browse the repository at this point in the history
* Added the filter for Scenarios into New Schedulted Event Wizard

* Refactoring Filter, but still the refactoring isn't finish

* Refactoring the code in a way to fullfill acceptance criteria of task which is create a component for filter scenario

* Filter is working, and fixing the bug with scenario selection

* Fix bug where selection doubled

---------

Co-authored-by: Abdellah Brahimi <[email protected]>
Co-authored-by: Jan-Gerrit Goebel <[email protected]>
  • Loading branch information
3 people authored Feb 6, 2023
1 parent 58f1a65 commit b584b72
Show file tree
Hide file tree
Showing 8 changed files with 294 additions and 193 deletions.
4 changes: 3 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ import { NewRoleBindingComponent } from './user/new-role-binding/new-role-bindin
import { DeleteProcessModalComponent } from './user/user/delete-process-modal/delete-process-modal.component';
import { EnvironmentDetailComponent } from './configuration/environments/environment-detail/environment-detail.component';
import { VmTemplateDetailComponent } from './configuration/vmtemplates/vmtemplate-detail/vmtemplate-detail.component';
import { FilterScenariosComponent } from './filter-scenarios/filter-scenarios.component';

const appInitializerFn = (appConfig: AppConfigService) => {
return () => {
Expand Down Expand Up @@ -144,7 +145,8 @@ export function jwtOptionsFactory() {
RolebindingsComponent,
NewRoleBindingComponent,
EnvironmentDetailComponent,
VmTemplateDetailComponent
VmTemplateDetailComponent,
FilterScenariosComponent
],
imports: [
BrowserModule,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<clr-wizard #wizard [(clrWizardOpen)]="wzOpen" clrWizardSize="xl" (clrWizardOnFinish)="save()" (clrWizardOnCancel)="close()">
<clr-wizard #wizard [(clrWizardOpen)]="wzOpen" clrWizardSize="xl" (clrWizardOnFinish)="save()"
(clrWizardOnCancel)="close()">
<clr-wizard-title>New Scheduled Event</clr-wizard-title>

<clr-wizard-button [type]="'cancel'">Cancel</clr-wizard-button>
Expand Down Expand Up @@ -102,7 +103,8 @@
<form class="quickset-endtime-form clr-form clr-form-vertical" [formGroup]="quicksetEndtimeForm">
<div class="clr-form-control clr-row no-margin-top">
<label for="quickset_endtime" class="clr-control-label padding-left">
<button class="btn btn-outline" (click)="quickEndTime()" [disabled]="!quicksetEndtimeForm.valid">Terminate in</button>
<button class="btn btn-outline" (click)="quickEndTime()" [disabled]="!quicksetEndtimeForm.valid">Terminate
in</button>
</label>
<div class="clr-control-container clr-col-md-10 clr-col-12 block"
[class.clr-error]="quicksetRequired || quicksetEndtimeForm.errors?.invalidQuicksetAmount || quicksetEndtimeForm.errors?.invalidNumber">
Expand Down Expand Up @@ -148,7 +150,8 @@
<clr-wizard-page>
<ng-template clrPageTitle>Select Course(s)</ng-template>
<i>Expand a row to view scenarios within that course</i>
<clr-datagrid [clrDgSelected]="selectedcourses" (clrDgSelectedChange)="coursesSelected($event)" [clrDgPreserveSelection]="true">
<clr-datagrid [clrDgSelected]="selectedcourses" (clrDgSelectedChange)="coursesSelected($event)"
[clrDgPreserveSelection]="true">
<clr-dg-column>Id</clr-dg-column>
<clr-dg-column [clrDgField]="'name'">Name</clr-dg-column>
<clr-dg-column [clrDgField]="'description'">Description</clr-dg-column>
Expand Down Expand Up @@ -178,12 +181,15 @@

<clr-wizard-page [clrWizardPageNextDisabled]="selectedcourses.length == 0 && selectedscenarios.length == 0">
<ng-template clrPageTitle>Select Scenario(s)</ng-template>
<clr-datagrid [clrDgSelected]="selectedscenarios" (clrDgSelectedChange)="scenariosSelected($event)" [clrDgPreserveSelection]="true">
<clr-dg-column>Id</clr-dg-column>
<filter-scenarios (filterScenarioEventEmitter)="setScenarioList($event)"></filter-scenarios>

<clr-datagrid [clrDgSelected]="selectedscenarios" (clrDgSelectedChange)="scenariosSelected($event)"
[clrDgPreserveSelection]="true">
<clr-dg-column [clrDgField]="'id'">Id</clr-dg-column>
<clr-dg-column [clrDgField]="'name'">Name</clr-dg-column>
<clr-dg-column [clrDgField]="'description'">Description</clr-dg-column>

<clr-dg-row *clrDgItems="let s of scenarios" [clrDgItem]="s">
<clr-dg-row *clrDgItems="let s of filteredScenarios" [clrDgItem]="s">
<clr-dg-cell>{{ s.id }}</clr-dg-cell>
<clr-dg-cell>{{ s.name }}</clr-dg-cell>
<clr-dg-cell>{{ s.description }}</clr-dg-cell>
Expand Down Expand Up @@ -229,7 +235,7 @@
<td class="left">
{{vmt}}
</td>
</tr>
</tr>
</ng-container>
</tbody>
</ng-container>
Expand Down Expand Up @@ -412,4 +418,4 @@ <h4>VM Information</h4>
</tbody>
</table>
</clr-wizard-page>
</clr-wizard>
</clr-wizard>
Loading

0 comments on commit b584b72

Please sign in to comment.