Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
49e27447
Commit
49e27447
authored
Feb 08, 2018
by
Shah El-Rahman
Committed by
Clement Ho
Feb 08, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "New design for project deletion confirmation"
parent
017de5c5
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
175 additions
and
1 deletion
+175
-1
app/assets/javascripts/dispatcher.js
app/assets/javascripts/dispatcher.js
+5
-0
app/assets/javascripts/pages/admin/projects/index/components/delete_project_modal.vue
.../admin/projects/index/components/delete_project_modal.vue
+125
-0
app/assets/javascripts/pages/admin/projects/index/index.js
app/assets/javascripts/pages/admin/projects/index/index.js
+37
-0
app/views/admin/projects/_projects.html.haml
app/views/admin/projects/_projects.html.haml
+8
-1
No files found.
app/assets/javascripts/dispatcher.js
View file @
49e27447
...
...
@@ -109,6 +109,11 @@ var Dispatcher;
.
then
(
callDefault
)
.
catch
(
fail
);
break
;
case
'
admin:projects:index
'
:
import
(
'
./pages/admin/projects/index/index
'
)
.
then
(
callDefault
)
.
catch
(
fail
);
break
;
case
'
dashboard:projects:index
'
:
case
'
dashboard:projects:starred
'
:
import
(
'
./pages/dashboard/projects
'
)
...
...
app/assets/javascripts/pages/admin/projects/index/components/delete_project_modal.vue
0 → 100644
View file @
49e27447
<
script
>
import
_
from
'
underscore
'
;
import
modal
from
'
~/vue_shared/components/modal.vue
'
;
import
{
s__
,
sprintf
}
from
'
~/locale
'
;
export
default
{
components
:
{
modal
,
},
props
:
{
deleteProjectUrl
:
{
type
:
String
,
required
:
false
,
default
:
''
,
},
projectName
:
{
type
:
String
,
required
:
false
,
default
:
''
,
},
csrfToken
:
{
type
:
String
,
required
:
false
,
default
:
''
,
},
},
data
()
{
return
{
enteredProjectName
:
''
,
};
},
computed
:
{
title
()
{
return
sprintf
(
s__
(
'
AdminProjects|Delete Project %{projectName}?
'
),
{
projectName
:
`'
${
_
.
escape
(
this
.
projectName
)}
'`
,
},
false
,
);
},
text
()
{
return
sprintf
(
s__
(
`AdminProjects|
You’re about to permanently delete the project %{projectName}, its repository,
and all related resources including issues, merge requests, etc.. Once you confirm and press
%{strong_start}Delete project%{strong_end}, it cannot be undone or recovered.`
),
{
projectName
:
`<strong>
${
_
.
escape
(
this
.
projectName
)}
</strong>`
,
strong_start
:
'
<strong>
'
,
strong_end
:
'
</strong>
'
,
},
false
,
);
},
confirmationTextLabel
()
{
return
sprintf
(
s__
(
'
AdminUsers|To confirm, type %{projectName}
'
),
{
projectName
:
`<code>
${
_
.
escape
(
this
.
projectName
)}
</code>`
,
},
false
,
);
},
primaryButtonLabel
()
{
return
s__
(
'
AdminProjects|Delete project
'
);
},
canSubmit
()
{
return
this
.
enteredProjectName
===
this
.
projectName
;
},
},
methods
:
{
onCancel
()
{
this
.
enteredProjectName
=
''
;
},
onSubmit
()
{
this
.
$refs
.
form
.
submit
();
this
.
enteredProjectName
=
''
;
},
},
};
</
script
>
<
template
>
<modal
id=
"delete-project-modal"
:title=
"title"
:text=
"text"
kind=
"danger"
:primary-button-label=
"primaryButtonLabel"
:submit-disabled=
"!canSubmit"
@
submit=
"onSubmit"
@
cancel=
"onCancel"
>
<template
slot=
"body"
slot-scope=
"props"
>
<p
v-html=
"props.text"
></p>
<p
v-html=
"confirmationTextLabel"
></p>
<form
ref=
"form"
:action=
"deleteProjectUrl"
method=
"post"
>
<input
ref=
"method"
type=
"hidden"
name=
"_method"
value=
"delete"
/>
<input
type=
"hidden"
name=
"authenticity_token"
:value=
"csrfToken"
/>
<input
name=
"projectName"
class=
"form-control"
type=
"text"
v-model=
"enteredProjectName"
aria-labelledby=
"input-label"
autocomplete=
"off"
/>
</form>
</
template
>
</modal>
</template>
app/assets/javascripts/pages/admin/projects/index/index.js
0 → 100644
View file @
49e27447
import
Vue
from
'
vue
'
;
import
Translate
from
'
~/vue_shared/translate
'
;
import
csrf
from
'
~/lib/utils/csrf
'
;
import
deleteProjectModal
from
'
./components/delete_project_modal.vue
'
;
export
default
()
=>
{
Vue
.
use
(
Translate
);
const
deleteProjectModalEl
=
document
.
getElementById
(
'
delete-project-modal
'
);
const
deleteModal
=
new
Vue
({
el
:
deleteProjectModalEl
,
data
:
{
deleteProjectUrl
:
''
,
projectName
:
''
,
},
render
(
createElement
)
{
return
createElement
(
deleteProjectModal
,
{
props
:
{
deleteProjectUrl
:
this
.
deleteProjectUrl
,
projectName
:
this
.
projectName
,
csrfToken
:
csrf
.
token
,
},
});
},
});
$
(
document
).
on
(
'
shown.bs.modal
'
,
(
event
)
=>
{
if
(
event
.
relatedTarget
.
classList
.
contains
(
'
delete-project-button
'
))
{
const
buttonProps
=
event
.
relatedTarget
.
dataset
;
deleteModal
.
deleteProjectUrl
=
buttonProps
.
deleteProjectUrl
;
deleteModal
.
projectName
=
buttonProps
.
projectName
;
}
});
};
app/views/admin/projects/_projects.html.haml
View file @
49e27447
...
...
@@ -5,7 +5,12 @@
%li
.project-row
{
class:
(
'no-description'
if
project
.
description
.
blank?
)
}
.controls
=
link_to
'Edit'
,
edit_project_path
(
project
),
id:
"edit_
#{
dom_id
(
project
)
}
"
,
class:
"btn"
=
link_to
'Delete'
,
[
project
.
namespace
.
becomes
(
Namespace
),
project
],
data:
{
confirm:
remove_project_message
(
project
)
},
method: :delete
,
class:
"btn btn-remove"
%button
.delete-project-button.btn.btn-danger
{
data:
{
toggle:
'modal'
,
target:
'#delete-project-modal'
,
delete_project_url:
project_path
(
project
),
project_name:
project
.
name
},
type:
'button'
}
=
s_
(
'AdminProjects|Delete'
)
.stats
%span
.badge
=
storage_counter
(
project
.
statistics
.
storage_size
)
...
...
@@ -31,3 +36,5 @@
=
paginate
@projects
,
theme:
'gitlab'
-
else
.nothing-here-block
No projects found
#delete-project-modal
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