summaryrefslogtreecommitdiff
path: root/app/assets
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-01-08 00:32:37 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-01-08 00:32:37 +0000
commit469a50879c1085ec77c95d650b7f135fee2c9e13 (patch)
tree0d639a63294b5abdb4e4a7bf1ed5a497d5e6869f /app/assets
parentaa5ca44f172f02f04cca448b1f9c17d6d933de40 (diff)
downloadgitlab-ce-469a50879c1085ec77c95d650b7f135fee2c9e13.tar.gz
Add latest changes from gitlab-org/gitlab@13-7-stable-ee
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/jobs/store/actions.js24
-rw-r--r--app/assets/javascripts/jobs/store/mutations.js1
-rw-r--r--app/assets/javascripts/registry/explorer/components/details_page/tags_list_row.vue4
3 files changed, 7 insertions, 22 deletions
diff --git a/app/assets/javascripts/jobs/store/actions.js b/app/assets/javascripts/jobs/store/actions.js
index cac9dc06284..e3ded725168 100644
--- a/app/assets/javascripts/jobs/store/actions.js
+++ b/app/assets/javascripts/jobs/store/actions.js
@@ -21,7 +21,8 @@ export const init = ({ dispatch }, { endpoint, logState, pagePath }) => {
logState,
pagePath,
});
- dispatch('fetchJob');
+
+ return Promise.all([dispatch('fetchJob'), dispatch('fetchTrace')]);
};
export const setJobEndpoint = ({ commit }, endpoint) => commit(types.SET_JOB_ENDPOINT, endpoint);
@@ -39,7 +40,6 @@ export const toggleSidebar = ({ dispatch, state }) => {
};
let eTagPoll;
-let isTraceReadyForRender;
export const clearEtagPoll = () => {
eTagPoll = null;
@@ -71,14 +71,7 @@ export const fetchJob = ({ state, dispatch }) => {
});
if (!Visibility.hidden()) {
- // eslint-disable-next-line promise/catch-or-return
- eTagPoll.makeRequest().then(() => {
- // if a job is canceled we still need to dispatch
- // fetchTrace to get the trace so we check for has_trace
- if (state.job.started || state.job.has_trace) {
- dispatch('fetchTrace');
- }
- });
+ eTagPoll.makeRequest();
} else {
axios
.get(state.jobEndpoint)
@@ -88,15 +81,9 @@ export const fetchJob = ({ state, dispatch }) => {
Visibility.change(() => {
if (!Visibility.hidden()) {
- // This check is needed to ensure the loading icon
- // is not shown for a finished job during a visibility change
- if (!isTraceReadyForRender && state.job.started) {
- dispatch('startPollingTrace');
- }
dispatch('restartPolling');
} else {
dispatch('stopPolling');
- dispatch('stopPollingTrace');
}
});
};
@@ -177,8 +164,6 @@ export const fetchTrace = ({ dispatch, state }) =>
params: { state: state.traceState },
})
.then(({ data }) => {
- isTraceReadyForRender = data.complete;
-
dispatch('toggleScrollisInBottom', isScrolledToBottom());
dispatch('receiveTraceSuccess', data);
@@ -258,7 +243,7 @@ export const receiveJobsForStageError = ({ commit }) => {
flash(__('An error occurred while fetching the jobs.'));
};
-export const triggerManualJob = ({ state, dispatch }, variables) => {
+export const triggerManualJob = ({ state }, variables) => {
const parsedVariables = variables.map(variable => {
const copyVar = { ...variable };
delete copyVar.id;
@@ -269,6 +254,5 @@ export const triggerManualJob = ({ state, dispatch }, variables) => {
.post(state.job.status.action.path, {
job_variables_attributes: parsedVariables,
})
- .then(() => dispatch('fetchTrace'))
.catch(() => flash(__('An error occurred while triggering the job.')));
};
diff --git a/app/assets/javascripts/jobs/store/mutations.js b/app/assets/javascripts/jobs/store/mutations.js
index dea53f715a7..924b811d0d6 100644
--- a/app/assets/javascripts/jobs/store/mutations.js
+++ b/app/assets/javascripts/jobs/store/mutations.js
@@ -49,7 +49,6 @@ export default {
[types.SET_TRACE_TIMEOUT](state, id) {
state.traceTimeout = id;
- state.isTraceComplete = false;
},
/**
diff --git a/app/assets/javascripts/registry/explorer/components/details_page/tags_list_row.vue b/app/assets/javascripts/registry/explorer/components/details_page/tags_list_row.vue
index 5aeafd318aa..3a5cccc7d08 100644
--- a/app/assets/javascripts/registry/explorer/components/details_page/tags_list_row.vue
+++ b/app/assets/javascripts/registry/explorer/components/details_page/tags_list_row.vue
@@ -63,7 +63,9 @@ export default {
},
computed: {
formattedSize() {
- return this.tag.totalSize ? numberToHumanSize(this.tag.totalSize) : NOT_AVAILABLE_SIZE;
+ return this.tag.totalSize
+ ? numberToHumanSize(Number(this.tag.totalSize))
+ : NOT_AVAILABLE_SIZE;
},
layers() {
return this.tag.layers ? n__('%d layer', '%d layers', this.tag.layers) : '';