-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement delete project (UI) (#749)
* delete project update project onboarding * fix style source
- Loading branch information
Showing
16 changed files
with
229 additions
and
83 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
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.width__500px { | ||
width: 500px; | ||
} |
20 changes: 19 additions & 1 deletion
20
web/ui/dashboard/src/app/private/pages/project/settings/settings.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 |
---|---|---|
@@ -1,13 +1,31 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { Router } from '@angular/router'; | ||
import { PrivateService } from 'src/app/private/private.service'; | ||
import { GeneralService } from 'src/app/services/general/general.service'; | ||
import { SettingsService } from './settings.service'; | ||
|
||
@Component({ | ||
selector: 'app-settings', | ||
templateUrl: './settings.component.html', | ||
styleUrls: ['./settings.component.scss'] | ||
}) | ||
export class SettingsComponent implements OnInit { | ||
constructor(public privateService: PrivateService) {} | ||
isloading = false; | ||
|
||
constructor(public privateService: PrivateService, private settingsService: SettingsService, private router: Router, private generalService: GeneralService) {} | ||
|
||
ngOnInit(): void {} | ||
|
||
async deleteProject() { | ||
this.isloading = true; | ||
|
||
try { | ||
await this.settingsService.deleteProject(); | ||
this.generalService.showNotification({ message: 'Project deleted successfully', style: 'success' }); | ||
this.router.navigateByUrl('/projects'); | ||
this.isloading = false; | ||
} catch (error) { | ||
this.isloading = false; | ||
} | ||
} | ||
} |
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
21 changes: 19 additions & 2 deletions
21
web/ui/dashboard/src/app/private/pages/project/settings/settings.service.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 |
---|---|---|
@@ -1,9 +1,26 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { HTTP_RESPONSE } from 'convoy-app/lib/models/http.model'; | ||
import { PrivateService } from 'src/app/private/private.service'; | ||
import { HttpService } from 'src/app/services/http/http.service'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
providedIn: 'root' | ||
}) | ||
export class SettingsService { | ||
constructor(private http: HttpService, private privateService: PrivateService) {} | ||
|
||
constructor() { } | ||
deleteProject(): Promise<HTTP_RESPONSE> { | ||
return new Promise(async (resolve, reject) => { | ||
try { | ||
const sourceResponse = await this.http.request({ | ||
url: `${this.privateService.urlFactory('org')}/groups/${this.privateService.activeProjectDetails.uid}`, | ||
method: 'delete' | ||
}); | ||
|
||
return resolve(sourceResponse); | ||
} catch (error: any) { | ||
return reject(error); | ||
} | ||
}); | ||
} | ||
} |
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
134 changes: 77 additions & 57 deletions
134
web/ui/dashboard/src/app/private/pages/projects/projects.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,72 +1,92 @@ | ||
<div class="page padding-top__60px"> | ||
<div class="page__head"> | ||
<div> | ||
<h3 class="margin-bottom__8px">Projects</h3> | ||
<p class="page__head--sub">All your project's summary at a glance</p> | ||
<convoy-loader *ngIf="isloadingOrganisations"></convoy-loader> | ||
|
||
<ng-container *ngIf="!isloadingOrganisations && organisations.length > 0"> | ||
<div class="page padding-top__60px"> | ||
<div class="page__head"> | ||
<div> | ||
<h3 class="margin-bottom__8px">Projects</h3> | ||
<p class="page__head--sub">All your project's summary at a glance</p> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<ul class="grid projects-grid" *ngIf="isLoadingProjects"> | ||
<li *ngFor="let index of projectsLoaderIndex"> | ||
<div class="card rounded__8px border__all bg__white"> | ||
<div class="padding-x__24px padding-top__24px padding-bottom__14px border__bottom"> | ||
<div class="skeleton-loader header"></div> | ||
</div> | ||
<div class="flex flex__align-items-center border__bottom"> | ||
<div class="border__right padding-y__8px padding-x__24px"> | ||
<div class="skeleton-loader text"></div> | ||
<ul class="grid projects-grid" *ngIf="isLoadingProjects"> | ||
<li *ngFor="let index of projectsLoaderIndex"> | ||
<div class="card rounded__8px border__all bg__white"> | ||
<div class="padding-x__24px padding-top__24px padding-bottom__14px border__bottom"> | ||
<div class="skeleton-loader header"></div> | ||
</div> | ||
<div class="flex flex__align-items-center flex__justify-between width__60 padding-y__8px padding-x__24px"> | ||
<div> | ||
<div class="flex flex__align-items-center border__bottom"> | ||
<div class="border__right padding-y__8px padding-x__24px"> | ||
<div class="skeleton-loader text"></div> | ||
</div> | ||
<div><div class="skeleton-loader small"></div></div> | ||
<div class="flex flex__align-items-center flex__justify-between width__60 padding-y__8px padding-x__24px"> | ||
<div> | ||
<div class="skeleton-loader text"></div> | ||
</div> | ||
<div><div class="skeleton-loader small"></div></div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
|
||
<ul class="grid projects-grid" *ngIf="!isLoadingProjects"> | ||
<li *ngFor="let project of projects"> | ||
<a [routerLink]="'/projects/' + project.uid" class="card rounded__8px bg__white display__block"> | ||
<div class="padding-x__24px padding-y__16px border__bottom flex flex__align-items-center flex__justify-between"> | ||
<div class="flex flex__align-items-center"> | ||
<div class="width__24px height__24px rounded__50px margin-right__8px flex flex__align-items-center flex__justify-center" style="background: var(--primary-color-500)"> | ||
<svg width="16" height="16" fill="var(--primary-color)" stroke="var(--primary-color)"> | ||
<use xlink:href="#top-right-icon"></use> | ||
</svg> | ||
<ul class="grid projects-grid" *ngIf="!isLoadingProjects"> | ||
<li *ngFor="let project of projects"> | ||
<a [routerLink]="'/projects/' + project.uid" class="card rounded__8px bg__white display__block"> | ||
<div class="padding-x__24px padding-y__16px border__bottom flex flex__align-items-center flex__justify-between"> | ||
<div class="flex flex__align-items-center"> | ||
<div class="width__24px height__24px rounded__50px margin-right__8px flex flex__align-items-center flex__justify-center" style="background: var(--primary-color-500)"> | ||
<svg width="16" height="16" fill="var(--primary-color)" stroke="var(--primary-color)"> | ||
<use xlink:href="#top-right-icon"></use> | ||
</svg> | ||
</div> | ||
<h4 class="pointer-cursor">{{ project.name }}</h4> | ||
</div> | ||
<h4 class="pointer-cursor">{{ project.name }}</h4> | ||
<div class="tag tag--Primary font__10px text__uppercase">{{ project.type || '-' }}</div> | ||
</div> | ||
<div class="tag tag--Primary font__10px text__uppercase">{{ project.type || '-' }}</div> | ||
</div> | ||
|
||
<div class="flex flex__align-items-center"> | ||
<div class="font__12px font__weight-500 color__grey border__right width__40 padding-y__8px padding-x__24px"> | ||
<span class="color__black margin-right__8px">{{ project.statistics.messages_sent }}</span> | ||
<span class="color__grey">Events Sent</span> | ||
</div> | ||
<div class="flex flex__align-items-center flex__justify-between flex__align-items-center width__60 padding-y__8px padding-x__24px"> | ||
<div class="font__12px font__weight-500 color__grey"> | ||
<span class="color__black margin-right__8px">{{ project.statistics.total_apps }}</span> | ||
<span class="color__grey">Apps</span> | ||
<div class="flex flex__align-items-center"> | ||
<div class="font__12px font__weight-500 color__grey border__right width__40 padding-y__8px padding-x__24px"> | ||
<span class="color__black margin-right__8px">{{ project.statistics.messages_sent }}</span> | ||
<span class="color__grey">Events Sent</span> | ||
</div> | ||
<div class="flex flex__align-items-center flex__justify-between flex__align-items-center width__60 padding-y__8px padding-x__24px"> | ||
<div class="font__12px font__weight-500 color__grey"> | ||
<span class="color__black margin-right__8px">{{ project.statistics.total_apps }}</span> | ||
<span class="color__grey">Apps</span> | ||
</div> | ||
<svg width="20" height="20" fill="var(--primary-color)"> | ||
<use xlink:href="#arrow-right-icon"></use> | ||
</svg> | ||
</div> | ||
<svg width="20" height="20" fill="var(--primary-color)"> | ||
<use xlink:href="#arrow-right-icon"></use> | ||
</svg> | ||
</div> | ||
</div> | ||
</a> | ||
</li> | ||
</a> | ||
</li> | ||
|
||
<li> | ||
<a routerLink="./new" class="card new-project-card rounded__8px bg__white flex flex__align-items-center flex__justify-center padding-y__32px"> | ||
<svg width="22" height="22" class="margin-right__8px" fill="var(--primary-color)"> | ||
<use xlink:href="#plus-icon"></use> | ||
</svg> | ||
<span class="color__primary font__weight-500">Create new project</span> | ||
</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</ng-container> | ||
|
||
<div class="page padding-top__60px" *ngIf="organisations.length == 0"> | ||
<div class="page--empty-state"> | ||
<div class="page--empty-state--img"> | ||
<img src="/assets/img/org-empty-img.svg" alt="add group empty" /> | ||
</div> | ||
<h3>You have no organisation yet</h3> | ||
<p>Create an organisation to get started with sending/receiving webhooks</p> | ||
<button class="button button__primary" (click)="showOrganisationModal = true">Create Organisation</button> | ||
</div> | ||
</div> | ||
|
||
<li> | ||
<a routerLink="./new" class="card new-project-card rounded__8px bg__white flex flex__align-items-center flex__justify-center padding-y__32px"> | ||
<svg width="22" height="22" class="margin-right__8px" fill="var(--primary-color)"> | ||
<use xlink:href="#plus-icon"></use> | ||
</svg> | ||
<span class="color__primary font__weight-500">Create new project</span> | ||
</a> | ||
</li> | ||
</ul> | ||
<div class="_overlay z-index--2" *ngIf="showOrganisationModal" (click)="showOrganisationModal = false"></div> | ||
<div class="modal modal__right z-index--3" *ngIf="showOrganisationModal"> | ||
<app-create-organisation (closeModal)="setOrganisation()"></app-create-organisation> | ||
</div> |
Oops, something went wrong.