-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add ability to delete cases from projects
- Loading branch information
1 parent
4250790
commit 399c5fc
Showing
3 changed files
with
113 additions
and
72 deletions.
There are no files selected for viewing
100 changes: 52 additions & 48 deletions
100
web/src/app/components/projects/project-diagram/project-diagram.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 |
---|---|---|
@@ -1,53 +1,57 @@ | ||
<div class="container"> | ||
<h1>{{ projectName }}</h1> | ||
<ul class="nav nav-tabs"> | ||
<li class="nav-item" *ngFor="let tab of tabs; let i = index"> | ||
<a | ||
class="nav-link" | ||
[class.active]="i === activeTabIndex" | ||
(click)="activateTab(i)" | ||
style="cursor: pointer;" | ||
> | ||
{{ tab.title }} | ||
</a> | ||
</li> | ||
<!-- Plus sign triggers modal --> | ||
<li class="nav-item"> | ||
<a class="nav-link" (click)="openNewTabModal()" style="cursor: pointer;">+</a> | ||
</li> | ||
</ul> | ||
|
||
<!-- Tab content: Display DiagramComponent in active tab --> | ||
<div class="tab-content border border-top-0 p-3"> | ||
<div class="tab-pane fade show active"> | ||
<app-diagram></app-diagram> | ||
</div> | ||
</div> | ||
|
||
<!-- Modal Dialog --> | ||
<div class="modal-backdrop fade show" *ngIf="showModal"></div> | ||
<div class="modal fade show d-block" tabindex="-1" *ngIf="showModal" role="dialog"> | ||
<div class="modal-dialog" role="document"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<h5 class="modal-title">Add a New Case</h5> | ||
<button type="button" class="btn-close" (click)="closeNewTabModal()" aria-label="Close"></button> | ||
</div> | ||
<div class="modal-body"> | ||
<label for="tabSelector" class="form-label">Select Hazard:</label> | ||
<select id="tabSelector" class="form-select" [(ngModel)]="selectedTabName"> | ||
<option *ngFor="let name of availableTabs" [value]="name">{{ name }}</option> | ||
</select> | ||
<div *ngIf="selectedTabName === 'Custom'" class="mt-3"> | ||
<label for="customTabName" class="form-label">Custom Hazard:</label> | ||
<input id="customTabName" type="text" class="form-control" [(ngModel)]="customTabName" placeholder="Enter custom tab name"> | ||
<ul class="nav nav-tabs"> | ||
<li class="nav-item" *ngFor="let tab of tabs; let i = index"> | ||
<a | ||
class="nav-link" | ||
[class.active]="i === activeTabIndex" | ||
(click)="activateTab(i)" | ||
style="cursor: pointer;" | ||
> | ||
{{ tab.title }} | ||
</a> | ||
</li> | ||
<!-- Plus sign triggers modal --> | ||
<li class="nav-item"> | ||
<a class="nav-link" (click)="openNewTabModal()" style="cursor: pointer;">+</a> | ||
</li> | ||
</ul> | ||
|
||
<!-- Tab content: Display DiagramComponent in active tab --> | ||
<div class="tab-content border border-top-0 p-3"> | ||
<div class="tab-pane fade show active"> | ||
<div class="d-flex justify-content-between mb-2"> | ||
<h4>{{ tabs[activeTabIndex].title }} Diagram</h4> | ||
<button *ngIf="tabs[activeTabIndex].title !== 'Base Case'" class="btn btn-danger" (click)="deleteTab(activeTabIndex)">Delete</button> | ||
</div> | ||
<app-diagram></app-diagram> | ||
</div> | ||
</div> | ||
|
||
<!-- Modal Dialog --> | ||
<div class="modal-backdrop fade show" *ngIf="showModal"></div> | ||
<div class="modal fade show d-block" tabindex="-1" *ngIf="showModal" role="dialog"> | ||
<div class="modal-dialog" role="document"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<h5 class="modal-title">Add a New Case</h5> | ||
<button type="button" class="btn-close" (click)="closeNewTabModal()" aria-label="Close"></button> | ||
</div> | ||
<div class="modal-body"> | ||
<label for="tabSelector" class="form-label">Select Hazard:</label> | ||
<select id="tabSelector" class="form-select" [(ngModel)]="selectedTabName"> | ||
<option *ngFor="let name of availableTabs" [value]="name">{{ name }}</option> | ||
</select> | ||
<div *ngIf="selectedTabName === 'Custom'" class="mt-3"> | ||
<label for="customTabName" class="form-label">Custom Hazard:</label> | ||
<input id="customTabName" type="text" class="form-control" [(ngModel)]="customTabName" placeholder="Enter custom tab name"> | ||
</div> | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-secondary" (click)="closeNewTabModal()">Cancel</button> | ||
<button type="button" class="btn btn-primary" (click)="addTabFromModal()">Add Hazard Case</button> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-secondary" (click)="closeNewTabModal()">Cancel</button> | ||
<button type="button" class="btn btn-primary" (click)="addTabFromModal()">Add Hazard Case</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</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
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