diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-24 06:10:15 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-24 06:10:15 +0000 |
commit | 273d780f9ede8f6ed5ebbd4f81c8a391a55f882a (patch) | |
tree | bf1f9c065bcb3c3d0c7f8e049587e8e7fecbee46 /app/assets | |
parent | ed621e6801d74097e2da08d2afc7574261bb7da1 (diff) | |
download | gitlab-ce-273d780f9ede8f6ed5ebbd4f81c8a391a55f882a.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets')
6 files changed, 33 insertions, 9 deletions
diff --git a/app/assets/javascripts/boards/components/board_content.vue b/app/assets/javascripts/boards/components/board_content.vue index c42295792f1..ef160e954e9 100644 --- a/app/assets/javascripts/boards/components/board_content.vue +++ b/app/assets/javascripts/boards/components/board_content.vue @@ -1,13 +1,14 @@ <script> import { mapState } from 'vuex'; +import { GlAlert } from '@gitlab/ui'; import BoardColumn from 'ee_else_ce/boards/components/board_column.vue'; -import EpicsSwimlanes from 'ee_component/boards/components/epics_swimlanes.vue'; import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; export default { components: { BoardColumn, - EpicsSwimlanes, + EpicsSwimlanes: () => import('ee_component/boards/components/epics_swimlanes.vue'), + GlAlert, }, mixins: [glFeatureFlagMixin()], props: { @@ -42,7 +43,7 @@ export default { }, }, computed: { - ...mapState(['isShowingEpicsSwimlanes', 'boardLists']), + ...mapState(['isShowingEpicsSwimlanes', 'boardLists', 'error']), isSwimlanesOn() { return this.glFeatures.boardsWithSwimlanes && this.isShowingEpicsSwimlanes; }, @@ -52,6 +53,9 @@ export default { <template> <div> + <gl-alert v-if="error" variant="danger" :dismissible="false"> + {{ error }} + </gl-alert> <div v-if="!isSwimlanesOn" class="boards-list gl-w-full gl-py-5 gl-px-3 gl-white-space-nowrap" diff --git a/app/assets/javascripts/boards/stores/mutations.js b/app/assets/javascripts/boards/stores/mutations.js index ca9b911ce5b..1644c118868 100644 --- a/app/assets/javascripts/boards/stores/mutations.js +++ b/app/assets/javascripts/boards/stores/mutations.js @@ -1,4 +1,5 @@ import * as mutationTypes from './mutation_types'; +import { __ } from '~/locale'; const notImplemented = () => { /* eslint-disable-next-line @gitlab/require-i18n-strings */ @@ -62,7 +63,7 @@ export default { }, [mutationTypes.RECEIVE_ISSUES_FOR_ALL_LISTS_FAILURE]: state => { - state.listIssueFetchFailure = true; + state.error = __('An error occurred while fetching the board issues. Please reload the page.'); state.isLoadingIssues = false; }, diff --git a/app/assets/javascripts/boards/stores/state.js b/app/assets/javascripts/boards/stores/state.js index cb6930774ed..fde9e62149c 100644 --- a/app/assets/javascripts/boards/stores/state.js +++ b/app/assets/javascripts/boards/stores/state.js @@ -5,7 +5,10 @@ export default () => ({ boardType: null, isShowingLabels: true, activeId: inactiveId, + boardLists: [], issuesByListId: {}, isLoadingIssues: false, - listIssueFetchFailure: false, + error: undefined, + // TODO: remove after ce/ee split of board_content.vue + isShowingEpicsSwimlanes: false, }); diff --git a/app/assets/javascripts/graphql_shared/fragments/epic.fragment.graphql b/app/assets/javascripts/graphql_shared/fragments/epic.fragment.graphql new file mode 100644 index 00000000000..286ebbd019e --- /dev/null +++ b/app/assets/javascripts/graphql_shared/fragments/epic.fragment.graphql @@ -0,0 +1,10 @@ +fragment EpicNode on Epic { + id + iid + title + state + reference + webUrl + createdAt + closedAt +} diff --git a/app/assets/javascripts/pipelines/components/test_reports/test_summary.vue b/app/assets/javascripts/pipelines/components/test_reports/test_summary.vue index 712ac5eb0e5..4a9688e0eab 100644 --- a/app/assets/javascripts/pipelines/components/test_reports/test_summary.vue +++ b/app/assets/javascripts/pipelines/components/test_reports/test_summary.vue @@ -1,8 +1,8 @@ <script> import { GlDeprecatedButton, GlProgressBar } from '@gitlab/ui'; import { __ } from '~/locale'; -import { formatTime, secondsToMilliseconds } from '~/lib/utils/datetime_utility'; import Icon from '~/vue_shared/components/icon.vue'; +import { formattedTime } from '../../stores/test_reports/utils'; export default { name: 'TestSummary', @@ -39,7 +39,7 @@ export default { return 0; }, formattedDuration() { - return formatTime(secondsToMilliseconds(this.report.total_time)); + return formattedTime(this.report.total_time); }, progressBarVariant() { if (this.successPercentage < 33) { diff --git a/app/assets/javascripts/pipelines/stores/test_reports/utils.js b/app/assets/javascripts/pipelines/stores/test_reports/utils.js index 16fa6935cbe..b6d533fc8f1 100644 --- a/app/assets/javascripts/pipelines/stores/test_reports/utils.js +++ b/app/assets/javascripts/pipelines/stores/test_reports/utils.js @@ -1,5 +1,5 @@ import { TestStatus } from '~/pipelines/constants'; -import { formatTime, secondsToMilliseconds } from '~/lib/utils/datetime_utility'; +import { __, sprintf } from '../../../locale'; export function iconForTestStatus(status) { switch (status) { @@ -12,7 +12,13 @@ export function iconForTestStatus(status) { } } -export const formattedTime = timeInSeconds => formatTime(secondsToMilliseconds(timeInSeconds)); +export const formattedTime = (seconds = 0) => { + if (seconds < 1) { + const milliseconds = seconds * 1000; + return sprintf(__('%{milliseconds}ms'), { milliseconds: milliseconds.toFixed(2) }); + } + return sprintf(__('%{seconds}s'), { seconds: seconds.toFixed(2) }); +}; export const addIconStatus = testCase => ({ ...testCase, |