Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchParapheur
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maarch
MaarchParapheur
Commits
e4268cb4
Verified
Commit
e4268cb4
authored
5 years ago
by
Alex ORLUC
Browse files
Options
Downloads
Patches
Plain Diff
FIX #11312 TIME 0:25 remove useless functions
parent
bb0473fe
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/frontend/app/profile/profile.component.html
+16
-15
16 additions, 15 deletions
src/frontend/app/profile/profile.component.html
src/frontend/app/profile/profile.component.ts
+1
-72
1 addition, 72 deletions
src/frontend/app/profile/profile.component.ts
with
17 additions
and
87 deletions
src/frontend/app/profile/profile.component.html
+
16
−
15
View file @
e4268cb4
...
...
@@ -15,8 +15,7 @@
</div>
<div
class=
"panel-content"
>
<form
(ngSubmit)=
"submitProfile()"
#profileForm
="
ngForm
"
>
<mat-tab-group
#tabProfile
(selectedTabChange)=
"initProfileTab($event);"
(swipeleft)=
"switchToleft(tabProfile)"
(swiperight)=
"switchToRight(tabProfile)"
>
<mat-tab-group
#tabProfile
(selectedTabChange)=
"initProfileTab($event);"
>
<mat-tab
label=
"{{'lang.informations' | translate}}"
>
<div
class=
"profile-content"
>
<mat-form-field
class=
"input-row"
>
...
...
@@ -202,19 +201,21 @@
<legend
align=
"left"
>
{{'lang.substitute' | translate}}
</legend>
<div
class=
"form-container"
>
<div
class=
"form-col"
>
<ng-container
*ngFor=
"let user of usersList"
>
<mat-form-field
class=
"selectedSubstitute"
*ngIf=
"user.id === authService.user.substitute"
>
<input
matInput
[value]=
"user.lastname + ' ' + user.firstname"
readonly
>
<button
matSuffix
mat-icon-button
type=
"button"
(tap)=
"deleteSubstitute()"
color=
"warn"
title=
"{{'lang.deleteSubstitution' | translate}}"
>
<mat-icon
fontSet=
"fas"
fontIcon=
"fa-times fa-2x"
></mat-icon>
</button>
</mat-form-field>
</ng-container>
<plugin-autocomplete
*ngIf=
"authService.user.substitute === null"
[labelPlaceholder]=
"'lang.chooseSubstitute' | translate"
[routeDatas]=
"['/rest/autocomplete/users']"
[targetSearchKey]=
"['lastname', 'firstname']"
[subInfoKey]=
"'email'"
(triggerEvent)=
"selectSubstitute($event)"
[excludeClause]=
"[{id:profileInfo.id}, {substitute: true}]"
></plugin-autocomplete>
<mat-form-field
class=
"selectedSubstitute"
*ngIf=
"authService.user.substitute !== null"
>
<input
matInput
[value]=
"authService.user.substituteUser"
readonly
>
<button
matSuffix
mat-icon-button
type=
"button"
(tap)=
"deleteSubstitute()"
color=
"warn"
title=
"{{'lang.deleteSubstitution' | translate}}"
>
<mat-icon
fontSet=
"fas"
fontIcon=
"fa-times fa-2x"
></mat-icon>
</button>
</mat-form-field>
<plugin-autocomplete
*ngIf=
"authService.user.substitute === null"
[labelPlaceholder]=
"'lang.chooseSubstitute' | translate"
[routeDatas]=
"['/rest/autocomplete/users']"
[targetSearchKey]=
"['lastname', 'firstname']"
[subInfoKey]=
"'email'"
(triggerEvent)=
"selectSubstitute($event)"
[excludeClause]=
"[{id:profileInfo.id}, {substitute: true}]"
>
</plugin-autocomplete>
</div>
</div>
</fieldset>
...
...
This diff is collapsed.
Click to expand it.
src/frontend/app/profile/profile.component.ts
+
1
−
72
View file @
e4268cb4
...
...
@@ -278,6 +278,7 @@ export class ProfileComponent implements OnInit {
}
selectSubstitute
(
newUserSubtituted
:
any
)
{
if
(
this
.
profileInfo
.
substitute
!==
null
)
{
alert
(
this
.
translate
.
instant
(
'
lang.substitutionWarn
'
));
}
...
...
@@ -371,85 +372,13 @@ export class ProfileComponent implements OnInit {
if
(
e
.
index
===
1
)
{
this
.
drawSample
();
}
if
(
e
.
index
===
2
)
{
this
.
refreshInfoSubstitute
();
this
.
swithToAdmin
();
}
}
counter
(
i
:
number
)
{
return
new
Array
(
i
);
}
switchToleft
(
tab
:
MatTabGroup
)
{
tab
.
selectedIndex
++
;
if
(
tab
.
selectedIndex
===
2
)
{
this
.
swithToAdmin
();
}
}
switchToRight
(
tab
:
MatTabGroup
)
{
if
(
tab
.
selectedIndex
>
0
)
{
tab
.
selectedIndex
--
;
if
(
tab
.
selectedIndex
===
2
)
{
this
.
swithToAdmin
();
}
}
}
swithToAdmin
()
{
if
(
this
.
authService
.
user
.
substitute
||
this
.
usersList
.
length
===
0
)
{
this
.
http
.
get
(
'
../rest/users
'
).
pipe
(
map
((
data
:
any
)
=>
{
data
.
users
.
forEach
((
element
:
any
)
=>
{
if
(
element
.
id
!==
this
.
profileInfo
.
id
&&
!
element
.
substitute
)
{
element
.
disabled
=
false
;
}
else
{
element
.
disabled
=
true
;
}
});
return
data
;
}),
tap
((
data
:
any
)
=>
this
.
usersList
=
data
.
users
),
).
subscribe
();
}
if
(
this
.
signaturesService
.
signaturesList
.
length
===
0
)
{
this
.
http
.
get
(
'
../rest/users/
'
+
this
.
profileInfo
.
id
+
'
/signatures
'
)
.
subscribe
((
data
:
any
)
=>
{
this
.
signaturesService
.
signaturesList
=
data
.
signatures
;
});
}
}
setLang
(
lang
:
any
)
{
this
.
translate
.
use
(
lang
);
}
refreshUserList
()
{
this
.
usersList
=
[];
this
.
http
.
get
(
'
../rest/users
'
).
pipe
(
map
((
data
:
any
)
=>
{
data
.
users
.
forEach
((
element
:
any
)
=>
{
if
(
element
.
id
!==
this
.
profileInfo
.
id
&&
!
element
.
substitute
)
{
element
.
disabled
=
false
;
}
else
{
element
.
disabled
=
true
;
}
});
return
data
;
}),
tap
((
data
:
any
)
=>
this
.
usersList
=
data
.
users
),
).
subscribe
();
}
refreshInfoSubstitute
()
{
this
.
http
.
get
(
'
../rest/users/
'
+
this
.
authService
.
user
.
id
+
'
/substitute
'
)
.
subscribe
((
data
:
any
)
=>
{
this
.
authService
.
user
.
substitute
=
data
.
substitute
;
this
.
profileInfo
.
substitute
=
data
.
substitute
;
});
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment