This repository has been archived by the owner on Dec 24, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#346 add support to 'delete connector'
- Loading branch information
Showing
10 changed files
with
746 additions
and
134 deletions.
There are no files selected for viewing
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
30 changes: 30 additions & 0 deletions
30
.../layout/project/components/edit-project/add-connector/add-connector-dialog.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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<form name="addForm" (ngSubmit)="save(sourceInfo, project)" #addForm="ngForm"> | ||
<div class="modal-header"> | ||
<h4 class="modal-title">Add connector</h4> | ||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" (click)="clear()">×</button> | ||
</div> | ||
<div class="modal-body"> | ||
<div> | ||
<div class="form-group"> | ||
<label for="loginOption">VCS Repository</label> <br> | ||
<select name="gitRepository._type" [(ngModel)]="gitRepository._type" class="form-control"> | ||
<option value="org.eclipse.scava.repository.model.vcs.git.GitRepository">Git</option> | ||
<option value="org.eclipse.scava.repository.model.documentation.gitbased.GitRepository">Git based documentation</option> | ||
<option value="org.eclipse.scava.repository.model.vcs.svn.SvnRepository">Svn</option> | ||
</select> | ||
</div> | ||
<div class="form-group"> | ||
<label for="url">URL</label> | ||
<input type="text" class="form-control" id="gitRepository.url" name="gitRepository.url" [(ngModel)]="gitRepository.url"> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-outline-dark btn-sm" data-dismiss="modal" (click)="clear()"> | ||
<span class="fa fa-ban"></span> <span>Cancel</span> | ||
</button> | ||
<button type="submit" [disabled]="addForm.form.invalid" class="btn btn-outline-dark btn-sm"> | ||
<span class="fa fa-save"></span> <span>Save</span> | ||
</button> | ||
</div> | ||
</form> |
46 changes: 46 additions & 0 deletions
46
...pp/layout/project/components/edit-project/add-connector/add-connector-dialog.component.ts
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; | ||
import { VersionControlSystems } from '../../create-project/version-control-system.model'; | ||
import { Project } from '../../../project.model'; | ||
|
||
@Component({ | ||
selector: 'app-add-connector', | ||
templateUrl: './add-connector-dialog.component.html' | ||
}) | ||
export class ConnectorMgmtAddDialogComponent implements OnInit { | ||
|
||
public isSaving: boolean; | ||
public gitRepository: any; | ||
constructor( | ||
public activeModal: NgbActiveModal | ||
) { } | ||
|
||
ngOnInit() { | ||
this.isSaving = true; | ||
this.gitRepository = new Object(); | ||
this.gitRepository._id = null; | ||
} | ||
|
||
clear() { | ||
this.activeModal.dismiss('cancel'); | ||
} | ||
|
||
save(sourceInfo: string, project: Project) { | ||
this.isSaving = true; | ||
switch (sourceInfo) { | ||
case "vcs": | ||
project.vcsRepositories.push(this.gitRepository); | ||
break; | ||
case "bts": | ||
project.bugTrackingSystems.push(); | ||
break; | ||
case "cc": | ||
project.communicationChannels.push(); | ||
break; | ||
default: | ||
break; | ||
} | ||
this.activeModal.dismiss(true); | ||
} | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
...t/project/components/edit-project/delete-connector/delete-connector-dialog.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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<form name="deleteForm" (ngSubmit)="confirmDelete(sourceInfo, target, project)"> | ||
<div class="modal-header"> | ||
<h4 class="modal-title">Confirm delete operation</h4> | ||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" (click)="clear()">×</button> | ||
</div> | ||
<div class="modal-body"> | ||
<p>Are you sure you want to delete this connector?</p> | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-outline-dark btn-sm" data-dismiss="modal" (click)="clear()"> | ||
<i class="fa fa-ban"></i> <span>Cancel</span> | ||
</button> | ||
<button type="submit" class="btn btn-outline-dark btn-sm"> | ||
<i class="fa fa-times"></i> <span>Delete</span> | ||
</button> | ||
</div> | ||
</form> |
41 changes: 41 additions & 0 deletions
41
...out/project/components/edit-project/delete-connector/delete-connector-dialog.component.ts
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; | ||
import { Project } from '../../../project.model'; | ||
|
||
@Component({ | ||
selector: 'app-delete-connector', | ||
templateUrl: './delete-connector-dialog.component.html' | ||
}) | ||
export class ConnectorMgmtDeleteDialogComponent implements OnInit { | ||
|
||
projectId: string; | ||
|
||
constructor( | ||
public activeModal: NgbActiveModal | ||
) { } | ||
|
||
ngOnInit() { | ||
} | ||
|
||
clear() { | ||
this.activeModal.dismiss('cancel'); | ||
} | ||
|
||
confirmDelete(sourceInfo: string, target: number, project: Project) { | ||
switch (sourceInfo) { | ||
case "vcs": | ||
project.vcsRepositories.splice(target, 1); | ||
break; | ||
case "bts": | ||
project.bugTrackingSystems.splice(target, 1); | ||
break; | ||
case "cc": | ||
project.communicationChannels.splice(target, 1); | ||
break; | ||
default: | ||
break; | ||
} | ||
this.activeModal.dismiss(true); | ||
} | ||
|
||
} |
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
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
Oops, something went wrong.