-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from CashStory/add-templates
Workspace templates
- Loading branch information
Showing
14 changed files
with
154 additions
and
4 deletions.
There are no files selected for viewing
Empty file.
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 |
---|---|---|
|
@@ -35,4 +35,4 @@ | |
</nb-user> | ||
</nb-action> | ||
</nb-actions> | ||
</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
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
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 |
---|---|---|
|
@@ -131,4 +131,4 @@ | |
</div> | ||
</nb-card-footer> | ||
</nb-card> | ||
</ng-template> | ||
</ng-template> |
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
9 changes: 9 additions & 0 deletions
9
src/app/workspace/template-apply/template-apply.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,9 @@ | ||
<nb-card> | ||
<nb-card-body> | ||
<h6> Are you sure to create workspace?</h6><br/> | ||
<input type="text" nbInput fullWidth status="basic" placeholder="Default" | ||
[(ngModel)]="wpName"><br/><br/> | ||
<p class="error" *ngIf="nameError">Workspace name is required!</p> | ||
<button nbButton status="success" (click)="applyTheme()">Proceed</button> | ||
</nb-card-body> | ||
</nb-card> |
3 changes: 3 additions & 0 deletions
3
src/app/workspace/template-apply/template-apply.component.scss
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,3 @@ | ||
.error { | ||
color: red; | ||
} |
37 changes: 37 additions & 0 deletions
37
src/app/workspace/template-apply/template-apply.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,37 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { NbToastrService } from '@nebular/theme'; | ||
import { WorkspaceService } from 'app/services/workspace.service'; | ||
|
||
@Component({ | ||
selector: 'ngx-template-apply', | ||
templateUrl: './template-apply.component.html', | ||
styleUrls: ['./template-apply.component.scss'], | ||
}) | ||
export class TemplateApplyComponent implements OnInit { | ||
wpName: string; | ||
nameError: boolean = false; | ||
templateId: string; | ||
constructor( | ||
private wss: WorkspaceService, | ||
private toastrService: NbToastrService, | ||
) { } | ||
|
||
ngOnInit(): void { | ||
|
||
} | ||
|
||
applyTheme() { | ||
if (!this.wpName) { | ||
this.nameError = true; | ||
return false; | ||
} | ||
const postData = { | ||
wpName : this.wpName, | ||
}; | ||
this.wss.applyTemplate(this.templateId, postData).subscribe((resp) => { | ||
this.toastrService.show('', 'Workspace Created!'); | ||
location.href = `/${resp[0]._id}`; | ||
}); | ||
} | ||
|
||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.