Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Churros
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexandre Vanicotte--Hochman
Churros
Commits
9263aa24
Commit
9263aa24
authored
1 year ago
by
Ewen Le Bihan
Browse files
Options
Downloads
Patches
Plain Diff
feat(registrations): prevent empty reason when refusing registration
parent
d196f3ae
Branches
Branches containing commit
Tags
v0.52.0
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/app/src/routes/signups/+page.svelte
+8
-1
8 additions, 1 deletion
packages/app/src/routes/signups/+page.svelte
packages/app/src/routes/signups/edit/[email]/+page.svelte
+10
-6
10 additions, 6 deletions
packages/app/src/routes/signups/edit/[email]/+page.svelte
with
18 additions
and
7 deletions
packages/app/src/routes/signups/+page.svelte
+
8
−
1
View file @
9263aa24
...
...
@@ -6,6 +6,7 @@
import
{
zeus
}
from
'
$lib/zeus
'
;
import
ButtonSecondary
from
'
$lib/components/ButtonSecondary.svelte
'
;
import
{
tooltip
}
from
'
$lib/tooltip
'
;
import
{
toasts
}
from
'
$lib/toasts
'
;
export
let
data
:
PageData
;
...
...
@@ -66,7 +67,13 @@
<ButtonSecondary
on:click=
{async
() =
>
{
//
eslint-disable-next-line
no-alert
await
decide
(
email
,
false
,
prompt
('
pk
?')
??
'');
const
reason =
prompt('pk
?');
if
(!
reason
)
{
toasts.error
("
Il
faut
une
raison
pour
refuser
l
'
inscription
");
return
;
}
await
decide
(
email
,
false
,
reason
);
}}
icon=
{IconTrash}
danger
...
...
This diff is collapsed.
Click to expand it.
packages/app/src/routes/signups/edit/[email]/+page.svelte
+
10
−
6
View file @
9263aa24
...
...
@@ -17,6 +17,7 @@
import
IconCheck
from
'
~icons/mdi/check
'
;
import
IconSave
from
'
~icons/mdi/content-save-outline
'
;
import
IconDelete
from
'
~icons/mdi/delete-outline
'
;
import
{
toasts
}
from
'
$lib/toasts
'
;
export
let
data
:
PageData
;
...
...
@@ -67,13 +68,16 @@
if
(
register
)
await
goto
(
'
../..
'
);
}
else
{
loadingRefuse
=
true
;
// eslint-disable-next-line no-alert
const
reason
=
prompt
(
'
pk ?
'
);
if
(
!
reason
)
{
toasts
.
error
(
'
Il faut une raison pour refuser une inscription
'
);
loading
=
false
;
return
;
}
await
$zeus
.
mutate
({
/* eslint-disable no-alert */
refuseRegistration
:
[
{
email
:
data
.
userCandidateByEmail
.
email
,
reason
:
prompt
(
'
pk ?
'
)
??
''
},
true
,
],
/* eslint-enable no-alert */
refuseRegistration
:
[{
email
:
data
.
userCandidateByEmail
.
email
,
reason
},
true
],
});
}
}
finally
{
...
...
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