diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-18 12:09:32 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-18 12:09:32 +0300 |
commit | a8b87b4fe0ebd38c0f1d7789ae768a6bcacb6c51 (patch) | |
tree | c1526cfec8ac3d9189188e08265ef1110419f643 /app/assets/javascripts/releases | |
parent | 0115b63f646be489bb9685dad0e4b0747a79de05 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/releases')
5 files changed, 19 insertions, 39 deletions
diff --git a/app/assets/javascripts/releases/components/app_index.vue b/app/assets/javascripts/releases/components/app_index.vue index ba5342e993e..b8cf6ce478f 100644 --- a/app/assets/javascripts/releases/components/app_index.vue +++ b/app/assets/javascripts/releases/components/app_index.vue @@ -25,31 +25,16 @@ export default { GlLink, GlButton, }, - props: { - projectId: { - type: String, - required: true, - }, - projectPath: { - type: String, - required: true, - }, - documentationPath: { - type: String, - required: true, - }, - illustrationPath: { - type: String, - required: true, - }, - newReleasePath: { - type: String, - required: false, - default: '', - }, - }, computed: { - ...mapState('list', ['isLoading', 'releases', 'hasError', 'pageInfo']), + ...mapState('list', [ + 'documentationPath', + 'illustrationPath', + 'newReleasePath', + 'isLoading', + 'releases', + 'hasError', + 'pageInfo', + ]), shouldRenderEmptyState() { return !this.releases.length && !this.hasError && !this.isLoading; }, @@ -65,15 +50,13 @@ export default { created() { this.fetchReleases({ page: getParameterByName('page'), - projectId: this.projectId, - projectPath: this.projectPath, }); }, methods: { ...mapActions('list', ['fetchReleases']), onChangePage(page) { historyPushState(buildUrlWithCurrentLocation(`?page=${page}`)); - this.fetchReleases({ page, projectId: this.projectId }); + this.fetchReleases({ page }); }, }, }; diff --git a/app/assets/javascripts/releases/components/releases_pagination_graphql.vue b/app/assets/javascripts/releases/components/releases_pagination_graphql.vue index 50d2796b0bd..a4fe407a5bd 100644 --- a/app/assets/javascripts/releases/components/releases_pagination_graphql.vue +++ b/app/assets/javascripts/releases/components/releases_pagination_graphql.vue @@ -7,7 +7,7 @@ export default { name: 'ReleasesPaginationGraphql', components: { GlKeysetPagination }, computed: { - ...mapState('list', ['projectPath', 'graphQlPageInfo']), + ...mapState('list', ['graphQlPageInfo']), showPagination() { return this.graphQlPageInfo.hasPreviousPage || this.graphQlPageInfo.hasNextPage; }, @@ -16,11 +16,11 @@ export default { ...mapActions('list', ['fetchReleasesGraphQl']), onPrev(before) { historyPushState(buildUrlWithCurrentLocation(`?before=${before}`)); - this.fetchReleasesGraphQl({ projectPath: this.projectPath, before }); + this.fetchReleasesGraphQl({ before }); }, onNext(after) { historyPushState(buildUrlWithCurrentLocation(`?after=${after}`)); - this.fetchReleasesGraphQl({ projectPath: this.projectPath, after }); + this.fetchReleasesGraphQl({ after }); }, }, }; diff --git a/app/assets/javascripts/releases/components/releases_pagination_rest.vue b/app/assets/javascripts/releases/components/releases_pagination_rest.vue index 52e88f5dc9b..992cc4cd469 100644 --- a/app/assets/javascripts/releases/components/releases_pagination_rest.vue +++ b/app/assets/javascripts/releases/components/releases_pagination_rest.vue @@ -7,13 +7,13 @@ export default { name: 'ReleasesPaginationRest', components: { TablePagination }, computed: { - ...mapState('list', ['projectId', 'pageInfo']), + ...mapState('list', ['pageInfo']), }, methods: { ...mapActions('list', ['fetchReleasesRest']), onChangePage(page) { historyPushState(buildUrlWithCurrentLocation(`?page=${page}`)); - this.fetchReleasesRest({ page, projectId: this.projectId }); + this.fetchReleasesRest({ page }); }, }, }; diff --git a/app/assets/javascripts/releases/mount_index.js b/app/assets/javascripts/releases/mount_index.js index c193cb9de9f..cd4fa5c5df5 100644 --- a/app/assets/javascripts/releases/mount_index.js +++ b/app/assets/javascripts/releases/mount_index.js @@ -21,9 +21,6 @@ export default () => { graphqlMilestoneStats: Boolean(gon.features?.graphqlMilestoneStats), }, }), - render: h => - h(ReleaseListApp, { - props: el.dataset, - }), + render: h => h(ReleaseListApp), }); }; diff --git a/app/assets/javascripts/releases/stores/modules/list/actions.js b/app/assets/javascripts/releases/stores/modules/list/actions.js index 3d28ef23fe7..945b093b983 100644 --- a/app/assets/javascripts/releases/stores/modules/list/actions.js +++ b/app/assets/javascripts/releases/stores/modules/list/actions.js @@ -23,7 +23,7 @@ export const requestReleases = ({ commit }) => commit(types.REQUEST_RELEASES); * * @param {String} projectId */ -export const fetchReleases = ({ dispatch, rootState }, { page = '1', projectId, projectPath }) => { +export const fetchReleases = ({ dispatch, rootState, state }, { page = '1' }) => { dispatch('requestReleases'); if ( @@ -35,7 +35,7 @@ export const fetchReleases = ({ dispatch, rootState }, { page = '1', projectId, .query({ query: allReleasesQuery, variables: { - fullPath: projectPath, + fullPath: state.projectPath, }, }) .then(response => { @@ -44,7 +44,7 @@ export const fetchReleases = ({ dispatch, rootState }, { page = '1', projectId, .catch(() => dispatch('receiveReleasesError')); } else { api - .releases(projectId, { page }) + .releases(state.projectId, { page }) .then(response => dispatch('receiveReleasesSuccess', response)) .catch(() => dispatch('receiveReleasesError')); } |