diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-16 00:14:31 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-16 00:14:31 +0300 |
commit | c568cb4dbc0421212a28f3cd5b77223aad8888ba (patch) | |
tree | be3ab3b5d6cf5c23a71b557ed82758c905a437bd /app/assets/javascripts/projects | |
parent | 4481a56a94c579f52e1cdef1cc1f4995f0ee1412 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/projects')
-rw-r--r-- | app/assets/javascripts/projects/components/project_delete_button.vue | 56 | ||||
-rw-r--r-- | app/assets/javascripts/projects/project_delete_button.js | 16 |
2 files changed, 71 insertions, 1 deletions
diff --git a/app/assets/javascripts/projects/components/project_delete_button.vue b/app/assets/javascripts/projects/components/project_delete_button.vue index 06711e4025a..bac876317b8 100644 --- a/app/assets/javascripts/projects/components/project_delete_button.vue +++ b/app/assets/javascripts/projects/components/project_delete_button.vue @@ -18,12 +18,36 @@ export default { type: String, required: true, }, + isFork: { + type: Boolean, + required: true, + }, + issuesCount: { + type: Number, + required: true, + }, + mergeRequestsCount: { + type: Number, + required: true, + }, + forksCount: { + type: Number, + required: true, + }, + starsCount: { + type: Number, + required: true, + }, }, strings: { alertTitle: __('You are about to permanently delete this project'), alertBody: __( 'Once a project is permanently deleted, it %{strongStart}cannot be recovered%{strongEnd}. Permanently deleting this project will %{strongStart}immediately delete%{strongEnd} its repositories and %{strongStart}all related resources%{strongEnd}, including issues, merge requests etc.', ), + isNotForkMessage: __( + 'This project is %{strongStart}NOT%{strongEnd} a fork, and has the following:', + ), + isForkMessage: __('This forked project has the following:'), }, }; </script> @@ -37,6 +61,38 @@ export default { :title="$options.strings.alertTitle" :dismissible="false" > + <p> + <gl-sprintf v-if="isFork" :message="$options.strings.isForkMessage" /> + <gl-sprintf v-else :message="$options.strings.isNotForkMessage"> + <template #strong="{ content }"> + <strong>{{ content }}</strong> + </template> + </gl-sprintf> + </p> + <ul> + <li> + <gl-sprintf :message="n__('%d issue', '%d issues', issuesCount)"> + <template #issuesCount>{{ issuesCount }}</template> + </gl-sprintf> + </li> + <li> + <gl-sprintf + :message="n__('%d merge requests', '%d merge requests', mergeRequestsCount)" + > + <template #mergeRequestsCount>{{ mergeRequestsCount }}</template> + </gl-sprintf> + </li> + <li> + <gl-sprintf :message="n__('%d fork', '%d forks', forksCount)"> + <template #forksCount>{{ forksCount }}</template> + </gl-sprintf> + </li> + <li> + <gl-sprintf :message="n__('%d star', '%d stars', starsCount)"> + <template #starsCount>{{ starsCount }}</template> + </gl-sprintf> + </li> + </ul> <gl-sprintf :message="$options.strings.alertBody"> <template #strong="{ content }"> <strong>{{ content }}</strong> diff --git a/app/assets/javascripts/projects/project_delete_button.js b/app/assets/javascripts/projects/project_delete_button.js index aa7fc31d307..b4d388eda3a 100644 --- a/app/assets/javascripts/projects/project_delete_button.js +++ b/app/assets/javascripts/projects/project_delete_button.js @@ -1,4 +1,5 @@ import Vue from 'vue'; +import { parseBoolean } from '~/lib/utils/common_utils'; import ProjectDeleteButton from './components/project_delete_button.vue'; export default (selector = '#js-project-delete-button') => { @@ -6,7 +7,15 @@ export default (selector = '#js-project-delete-button') => { if (!el) return; - const { confirmPhrase, formPath } = el.dataset; + const { + confirmPhrase, + formPath, + isFork, + issuesCount, + mergeRequestsCount, + forksCount, + starsCount, + } = el.dataset; // eslint-disable-next-line no-new new Vue({ @@ -16,6 +25,11 @@ export default (selector = '#js-project-delete-button') => { props: { confirmPhrase, formPath, + isFork: parseBoolean(isFork), + issuesCount: parseInt(issuesCount, 10), + mergeRequestsCount: parseInt(mergeRequestsCount, 10), + forksCount: parseInt(forksCount, 10), + starsCount: parseInt(starsCount, 10), }, }); }, |