Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
feudalWebpage
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
feudal
feudalWebpage
Commits
ec1715e2
Commit
ec1715e2
authored
Mar 12, 2018
by
Lukas Burgey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement user deletion
parent
d6b72c4f
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
95 additions
and
6 deletions
+95
-6
src/app/account/account.component.css
src/app/account/account.component.css
+0
-0
src/app/account/account.component.html
src/app/account/account.component.html
+11
-0
src/app/account/account.component.spec.ts
src/app/account/account.component.spec.ts
+25
-0
src/app/account/account.component.ts
src/app/account/account.component.ts
+25
-0
src/app/app.module.ts
src/app/app.module.ts
+3
-0
src/app/dialog.service.ts
src/app/dialog.service.ts
+14
-6
src/app/login/login.component.html
src/app/login/login.component.html
+3
-0
src/app/user.service.ts
src/app/user.service.ts
+14
-0
No files found.
src/app/account/account.component.css
0 → 100644
View file @
ec1715e2
src/app/account/account.component.html
0 → 100644
View file @
ec1715e2
<p>
You can delete your account. All deployments will be withdrawn if you chose to do so.
</p>
<p>
<mat-checkbox
[(ngModel)]=
"sure"
style=
"margin-right: 8px"
[checked]=
"sure"
>
I'm sure i want to delete all my data on the server.
</mat-checkbox>
<button
mat-raised-button
mat-dialog-close
color=
"primary"
(click)=
"delete()"
[disabled]=
"!sure"
>
Delete
</button>
</p>
src/app/account/account.component.spec.ts
0 → 100644
View file @
ec1715e2
import
{
async
,
ComponentFixture
,
TestBed
}
from
'
@angular/core/testing
'
;
import
{
AccountComponent
}
from
'
./account.component
'
;
describe
(
'
AccountComponent
'
,
()
=>
{
let
component
:
AccountComponent
;
let
fixture
:
ComponentFixture
<
AccountComponent
>
;
beforeEach
(
async
(()
=>
{
TestBed
.
configureTestingModule
({
declarations
:
[
AccountComponent
]
})
.
compileComponents
();
}));
beforeEach
(()
=>
{
fixture
=
TestBed
.
createComponent
(
AccountComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'
should create
'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
src/app/account/account.component.ts
0 → 100644
View file @
ec1715e2
import
{
Component
,
OnInit
}
from
'
@angular/core
'
;
import
{
UserService
}
from
'
../user.service
'
;
@
Component
({
selector
:
'
app-account
'
,
templateUrl
:
'
./account.component.html
'
,
styleUrls
:
[
'
./account.component.css
'
]
})
export
class
AccountComponent
implements
OnInit
{
public
sure
:
boolean
;
constructor
(
public
userService
:
UserService
,
)
{
this
.
sure
=
false
;
}
ngOnInit
()
{
}
delete
()
{
this
.
userService
.
deleteUser
();
}
}
src/app/app.module.ts
View file @
ec1715e2
...
...
@@ -33,6 +33,7 @@ import { LoginComponent } from './login/login.component';
import
{
ProfileComponent
}
from
'
./profile/profile.component
'
;
import
{
ServiceComponent
}
from
'
./service/service.component
'
;
import
{
SshKeysComponent
}
from
'
./ssh-keys/ssh-keys.component
'
;
import
{
AccountComponent
}
from
'
./account/account.component
'
;
/*
const routes = [
...
...
@@ -55,6 +56,7 @@ const routes = [
ProfileComponent
,
ServiceComponent
,
SshKeysComponent
,
AccountComponent
,
],
imports
:
[
BrowserModule
,
...
...
@@ -95,6 +97,7 @@ const routes = [
entryComponents
:
[
ProfileComponent
,
SshKeysComponent
,
AccountComponent
,
],
})
export
class
AppModule
{
...
...
src/app/dialog.service.ts
View file @
ec1715e2
...
...
@@ -3,11 +3,17 @@ import { MatDialog, MatDialogRef } from '@angular/material/dialog';
import
{
ProfileComponent
}
from
'
./profile/profile.component
'
;
import
{
SshKeysComponent
}
from
'
./ssh-keys/ssh-keys.component
'
;
import
{
AccountComponent
}
from
'
./account/account.component
'
;
@
Injectable
()
export
class
DialogService
{
profileDialog
:
MatDialogRef
<
any
>
;
sshKeysDialog
:
MatDialogRef
<
any
>
;
accountDialog
:
MatDialogRef
<
any
>
;
settings
=
{
width
:
'
80%
'
,
};
constructor
(
public
dialog
:
MatDialog
,
...
...
@@ -16,19 +22,21 @@ export class DialogService {
public
openProfile
()
{
this
.
profileDialog
=
this
.
dialog
.
open
(
ProfileComponent
,
{
width
:
'
80%
'
,
}
this
.
settings
,
);
}
public
openSshKeys
()
{
this
.
sshKeysDialog
=
this
.
dialog
.
open
(
SshKeysComponent
,
{
width
:
'
80%
'
,
}
this
.
settings
,
);
}
public
openAccount
()
{
this
.
accountDialog
=
this
.
dialog
.
open
(
AccountComponent
,
this
.
settings
,
);
}
}
src/app/login/login.component.html
View file @
ec1715e2
...
...
@@ -12,6 +12,9 @@
</form>
</span>
<span
*ngIf=
"userService.loggedIn"
>
<button
mat-button
mat-icon-button
(click)=
"dialog.openAccount()"
>
<mat-icon>
settings
</mat-icon>
</button>
<button
mat-button
mat-icon-button
(click)=
"dialog.openSshKeys()"
>
<mat-icon>
vpn_key
</mat-icon>
</button>
...
...
src/app/user.service.ts
View file @
ec1715e2
...
...
@@ -210,4 +210,18 @@ export class UserService {
}
);
}
public
deleteUser
()
{
return
this
.
http
.
delete
(
'
/backend/api/delete_user/
'
).
subscribe
(
(
data
)
=>
{
this
.
snackBar
.
open
(
'
Deleted user from server
'
);
this
.
updateData
(
data
);
},
(
err
)
=>
{
this
.
snackBar
.
open
(
'
Error deleting user from server
'
);
console
.
log
(
err
);
this
.
update
();
}
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment