Commit dd937373 authored by Illya Klymov's avatar Illya Klymov

Update import statuses icons and texts

* use gitlab-ui
parent 775bb585
<script> <script>
import { GlLoadingIcon } from '@gitlab/ui'; import { GlIcon } from '@gitlab/ui';
import CiIcon from '~/vue_shared/components/ci_icon.vue';
import STATUS_MAP from '../constants'; import STATUS_MAP from '../constants';
export default { export default {
name: 'ImportStatus', name: 'ImportStatus',
components: { components: {
CiIcon, GlIcon,
GlLoadingIcon,
}, },
props: { props: {
status: { status: {
...@@ -20,28 +18,13 @@ export default { ...@@ -20,28 +18,13 @@ export default {
mappedStatus() { mappedStatus() {
return STATUS_MAP[this.status]; return STATUS_MAP[this.status];
}, },
ciIconStatus() {
const { icon } = this.mappedStatus;
return {
icon: `status_${icon}`,
group: icon,
};
},
}, },
}; };
</script> </script>
<template> <template>
<div class="gl-display-flex gl-h-7 gl-align-items-center"> <div>
<gl-loading-icon <gl-icon :name="mappedStatus.icon" :class="mappedStatus.iconClass" :size="12" class="gl-mr-2" />
v-if="mappedStatus.loadingIcon" <span>{{ mappedStatus.text }}</span>
:inline="true"
:class="mappedStatus.textClass"
class="align-middle mr-2"
/>
<ci-icon v-else css-classes="align-middle mr-2" :status="ciIconStatus" />
<span :class="mappedStatus.textClass">{{ mappedStatus.text }}</span>
</div> </div>
</template> </template>
...@@ -11,43 +11,43 @@ export const STATUSES = { ...@@ -11,43 +11,43 @@ export const STATUSES = {
STARTED: 'started', STARTED: 'started',
NONE: 'none', NONE: 'none',
SCHEDULING: 'scheduling', SCHEDULING: 'scheduling',
CANCELLED: 'cancelled',
};
const SCHEDULED_STATUS = {
icon: 'status-scheduled',
text: __('Pending'),
iconClass: 'gl-text-orange-400',
}; };
const STATUS_MAP = { const STATUS_MAP = {
[STATUSES.NONE]: {
icon: 'status-waiting',
text: __('Not started'),
iconClass: 'gl-text-gray-400',
},
[STATUSES.SCHEDULING]: SCHEDULED_STATUS,
[STATUSES.SCHEDULED]: SCHEDULED_STATUS,
[STATUSES.CREATED]: SCHEDULED_STATUS,
[STATUSES.STARTED]: {
icon: 'status-running',
text: __('Importing...'),
iconClass: 'gl-text-blue-400',
},
[STATUSES.FINISHED]: { [STATUSES.FINISHED]: {
icon: 'success', icon: 'status-success',
text: __('Done'), text: __('Complete'),
textClass: 'text-success', iconClass: 'gl-text-green-400',
}, },
[STATUSES.FAILED]: { [STATUSES.FAILED]: {
icon: 'failed', icon: 'status-failed',
text: __('Failed'), text: __('Failed'),
textClass: 'text-danger', iconClass: 'gl-text-red-600',
},
[STATUSES.CREATED]: {
icon: 'pending',
text: __('Scheduled'),
textClass: 'text-warning',
},
[STATUSES.SCHEDULED]: {
icon: 'pending',
text: __('Scheduled'),
textClass: 'text-warning',
},
[STATUSES.STARTED]: {
icon: 'running',
text: __('Running…'),
textClass: 'text-info',
},
[STATUSES.NONE]: {
icon: 'created',
text: __('Not started'),
textClass: 'text-muted',
}, },
[STATUSES.SCHEDULING]: { [STATUSES.CANCELLED]: {
loadingIcon: true, icon: 'status-stopped',
text: __('Scheduling'), text: __('Cancelled'),
textClass: 'text-warning', iconClass: 'gl-text-red-600',
}, },
}; };
......
---
title: Update import statuses texts and icons
merge_request: 54957
author:
type: changed
...@@ -136,7 +136,7 @@ RSpec.describe 'New project', :js do ...@@ -136,7 +136,7 @@ RSpec.describe 'New project', :js do
click_button 'Connect' click_button 'Connect'
wait_for_requests wait_for_requests
expect(page).to have_text('Done') expect(page).to have_text('Complete')
created_project = Project.last created_project = Project.last
expect(created_project.name).to eq('some-github-repo') expect(created_project.name).to eq('some-github-repo')
......
...@@ -5519,6 +5519,9 @@ msgstr "" ...@@ -5519,6 +5519,9 @@ msgstr ""
msgid "Canceled deployment to" msgid "Canceled deployment to"
msgstr "" msgstr ""
msgid "Cancelled"
msgstr ""
msgid "Cancelling Preview" msgid "Cancelling Preview"
msgstr "" msgstr ""
...@@ -15739,6 +15742,9 @@ msgid_plural "Importing %d repositories" ...@@ -15739,6 +15742,9 @@ msgid_plural "Importing %d repositories"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
msgid "Importing..."
msgstr ""
msgid "Improve customer support with Service Desk" msgid "Improve customer support with Service Desk"
msgstr "" msgstr ""
...@@ -26322,9 +26328,6 @@ msgstr "" ...@@ -26322,9 +26328,6 @@ msgstr ""
msgid "Running" msgid "Running"
msgstr "" msgstr ""
msgid "Running…"
msgstr ""
msgid "Runs a number of housekeeping tasks within the current repository, such as compressing file revisions and removing unreachable objects." msgid "Runs a number of housekeeping tasks within the current repository, such as compressing file revisions and removing unreachable objects."
msgstr "" msgstr ""
...@@ -26466,9 +26469,6 @@ msgstr "" ...@@ -26466,9 +26469,6 @@ msgstr ""
msgid "Schedules to merge this merge request (%{strategy})." msgid "Schedules to merge this merge request (%{strategy})."
msgstr "" msgstr ""
msgid "Scheduling"
msgstr ""
msgid "Scheduling Pipelines" msgid "Scheduling Pipelines"
msgstr "" msgstr ""
......
...@@ -37,7 +37,7 @@ RSpec.describe 'Import multiple repositories by uploading a manifest file', :js ...@@ -37,7 +37,7 @@ RSpec.describe 'Import multiple repositories by uploading a manifest file', :js
wait_for_requests wait_for_requests
page.within(second_row) do page.within(second_row) do
expect(page).to have_content 'Done' expect(page).to have_content 'Complete'
expect(page).to have_content("#{group.full_path}/build/blueprint") expect(page).to have_content("#{group.full_path}/build/blueprint")
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment