Commit 4ba7c274 authored by Tetiana Chupryna's avatar Tetiana Chupryna

Merge branch '343620-remove-frontend-code-related-to-updating-jira-issues' into 'master'

Remove editing of labels on the Jira issue details page

See merge request gitlab-org/gitlab!73668
parents b79e15b3 5a9a3eb1
---
name: jira_issue_details_edit_labels
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/65298
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/335069
milestone: '14.1'
type: development
group: group::integrations
default_enabled: false
...@@ -35,7 +35,6 @@ export default { ...@@ -35,7 +35,6 @@ export default {
return { return {
isLoading: true, isLoading: true,
isLoadingStatus: false, isLoadingStatus: false,
isUpdatingLabels: false,
isUpdatingStatus: false, isUpdatingStatus: false,
errorMessage: null, errorMessage: null,
issue: {}, issue: {},
...@@ -79,23 +78,6 @@ export default { ...@@ -79,23 +78,6 @@ export default {
return `jira_note_${id}`; return `jira_note_${id}`;
}, },
onIssueLabelsUpdated(labels) {
this.isUpdatingLabels = true;
updateIssue(this.issue, { labels })
.then((response) => {
this.issue.labels = response.labels;
})
.catch(() => {
createFlash({
message: s__(
'JiraService|Failed to update Jira issue labels. View the issue in Jira, or reload the page.',
),
});
})
.finally(() => {
this.isUpdatingLabels = false;
});
},
onIssueStatusFetch() { onIssueStatusFetch() {
this.isLoadingStatus = true; this.isLoadingStatus = true;
fetchIssueStatuses() fetchIssueStatuses()
...@@ -156,10 +138,8 @@ export default { ...@@ -156,10 +138,8 @@ export default {
:sidebar-expanded="sidebarExpanded" :sidebar-expanded="sidebarExpanded"
:issue="issue" :issue="issue"
:is-loading-status="isLoadingStatus" :is-loading-status="isLoadingStatus"
:is-updating-labels="isUpdatingLabels"
:is-updating-status="isUpdatingStatus" :is-updating-status="isUpdatingStatus"
:statuses="statuses" :statuses="statuses"
@issue-labels-updated="onIssueLabelsUpdated"
@issue-status-fetch="onIssueStatusFetch" @issue-status-fetch="onIssueStatusFetch"
@issue-status-updated="onIssueStatusUpdated" @issue-status-updated="onIssueStatusUpdated"
@sidebar-toggle="toggleSidebar" @sidebar-toggle="toggleSidebar"
......
...@@ -20,9 +20,6 @@ export default { ...@@ -20,9 +20,6 @@ export default {
}, },
mixins: [glFeatureFlagsMixin()], mixins: [glFeatureFlagsMixin()],
inject: { inject: {
issueLabelsPath: {
default: null,
},
issuesListPath: { issuesListPath: {
default: null, default: null,
}, },
...@@ -41,11 +38,6 @@ export default { ...@@ -41,11 +38,6 @@ export default {
required: false, required: false,
default: false, default: false,
}, },
isUpdatingLabels: {
type: Boolean,
required: false,
default: false,
},
isUpdatingStatus: { isUpdatingStatus: {
type: Boolean, type: Boolean,
required: false, required: false,
...@@ -57,11 +49,6 @@ export default { ...@@ -57,11 +49,6 @@ export default {
default: () => [], default: () => [],
}, },
}, },
data() {
return {
isEditingLabels: false,
};
},
computed: { computed: {
assignee() { assignee() {
// Jira issues have at most 1 assignee // Jira issues have at most 1 assignee
...@@ -70,9 +57,6 @@ export default { ...@@ -70,9 +57,6 @@ export default {
reference() { reference() {
return this.issue.references?.relative; return this.issue.references?.relative;
}, },
canUpdateLabels() {
return this.glFeatures.jiraIssueDetailsEditLabels;
},
canUpdateStatus() { canUpdateStatus() {
return this.glFeatures.jiraIssueDetailsEditStatus; return this.glFeatures.jiraIssueDetailsEditStatus;
}, },
...@@ -108,18 +92,6 @@ export default { ...@@ -108,18 +92,6 @@ export default {
}); });
} }
}, },
onIssueLabelsClose() {
this.isEditingLabels = false;
},
onIssueLabelsToggle() {
this.expandSidebarAndOpenDropdown();
this.afterSidebarTransitioned(() => {
this.isEditingLabels = true;
});
},
onIssueLabelsUpdated(labels) {
this.$emit('issue-labels-updated', labels);
},
onIssueStatusFetch() { onIssueStatusFetch() {
this.$emit('issue-status-fetch'); this.$emit('issue-status-fetch');
}, },
...@@ -149,20 +121,13 @@ export default { ...@@ -149,20 +121,13 @@ export default {
@issue-field-updated="onIssueStatusUpdated" @issue-field-updated="onIssueStatusUpdated"
/> />
<labels-select <labels-select
:allow-label-edit="canUpdateLabels"
:allow-multiselect="true"
:allow-scoped-labels="true" :allow-scoped-labels="true"
:selected-labels="issue.labels" :selected-labels="issue.labels"
:labels-fetch-path="issueLabelsPath"
:labels-filter-base-path="issuesListPath" :labels-filter-base-path="issuesListPath"
:labels-filter-param="$options.labelsFilterParam" :labels-filter-param="$options.labelsFilterParam"
:labels-select-in-progress="isUpdatingLabels"
:is-editing="isEditingLabels"
variant="sidebar" variant="sidebar"
class="block labels js-labels-block" class="block labels js-labels-block"
@onDropdownClose="onIssueLabelsClose" @toggleCollapse="expandSidebarAndOpenDropdown"
@toggleCollapse="onIssueLabelsToggle"
@updateSelectedLabels="onIssueLabelsUpdated"
> >
{{ __('None') }} {{ __('None') }}
</labels-select> </labels-select>
......
...@@ -9,12 +9,11 @@ export default function initJiraIssueShow({ mountPointSelector }) { ...@@ -9,12 +9,11 @@ export default function initJiraIssueShow({ mountPointSelector }) {
return null; return null;
} }
const { issueLabelsPath, issuesShowPath, issuesListPath } = mountPointEl.dataset; const { issuesShowPath, issuesListPath } = mountPointEl.dataset;
return new Vue({ return new Vue({
el: mountPointEl, el: mountPointEl,
provide: { provide: {
issueLabelsPath,
issuesShowPath, issuesShowPath,
issuesListPath, issuesListPath,
isClassicSidebar: true, isClassicSidebar: true,
......
...@@ -15,7 +15,6 @@ module Projects ...@@ -15,7 +15,6 @@ module Projects
before_action :check_feature_enabled! before_action :check_feature_enabled!
before_action only: :show do before_action only: :show do
push_frontend_feature_flag(:jira_issue_details_edit_status, project, default_enabled: :yaml) push_frontend_feature_flag(:jira_issue_details_edit_status, project, default_enabled: :yaml)
push_frontend_feature_flag(:jira_issue_details_edit_labels, project, default_enabled: :yaml)
end end
rescue_from ::Projects::Integrations::Jira::IssuesFinder::Error, with: :render_error rescue_from ::Projects::Integrations::Jira::IssuesFinder::Error, with: :render_error
...@@ -44,11 +43,6 @@ module Projects ...@@ -44,11 +43,6 @@ module Projects
end end
end end
def labels
# This implementation is just to mock the endpoint, to be implemented https://gitlab.com/gitlab-org/gitlab/-/issues/330778
render json: issue_json[:labels]
end
private private
def visitor_id def visitor_id
......
...@@ -53,7 +53,6 @@ module EE ...@@ -53,7 +53,6 @@ module EE
def jira_issues_show_data def jira_issues_show_data
{ {
issue_labels_path: labels_project_integrations_jira_issue_path(@project, params[:id]),
issues_show_path: project_integrations_jira_issue_path(@project, params[:id], format: :json), issues_show_path: project_integrations_jira_issue_path(@project, params[:id], format: :json),
issues_list_path: project_integrations_jira_issues_path(@project) issues_list_path: project_integrations_jira_issues_path(@project)
} }
......
...@@ -32,7 +32,6 @@ module Integrations ...@@ -32,7 +32,6 @@ module Integrations
expose :labels do |jira_issue| expose :labels do |jira_issue|
jira_issue.labels.map do |name| jira_issue.labels.map do |name|
{ {
id: name,
title: name, title: name,
name: name, name: name,
color: '#0052CC', color: '#0052CC',
......
...@@ -112,11 +112,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do ...@@ -112,11 +112,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
namespace :integrations do namespace :integrations do
namespace :jira do namespace :jira do
resources :issues, only: [:index, :show] do resources :issues, only: [:index, :show]
member do
get :labels
end
end
end end
namespace :zentao do namespace :zentao do
......
...@@ -120,22 +120,6 @@ describe('JiraIssuesShow', () => { ...@@ -120,22 +120,6 @@ describe('JiraIssuesShow', () => {
await waitForPromises(); await waitForPromises();
}); });
it('updates issue labels on issue-labels-updated', async () => {
const updateIssueSpy = jest.spyOn(JiraIssuesShowApi, 'updateIssue').mockResolvedValue();
const labels = [{ id: 'ecosystem' }];
findJiraIssueSidebar().vm.$emit('issue-labels-updated', labels);
await wrapper.vm.$nextTick();
expect(updateIssueSpy).toHaveBeenCalledWith(expect.any(Object), { labels });
expect(findJiraIssueSidebar().props('isUpdatingLabels')).toBe(true);
await waitForPromises();
expect(findJiraIssueSidebar().props('isUpdatingLabels')).toBe(false);
});
it('fetches issue statuses on issue-status-fetch', async () => { it('fetches issue statuses on issue-status-fetch', async () => {
const fetchIssueStatusesSpy = jest const fetchIssueStatusesSpy = jest
.spyOn(JiraIssuesShowApi, 'fetchIssueStatuses') .spyOn(JiraIssuesShowApi, 'fetchIssueStatuses')
......
...@@ -102,7 +102,6 @@ RSpec.describe EE::IntegrationsHelper do ...@@ -102,7 +102,6 @@ RSpec.describe EE::IntegrationsHelper do
it 'includes Jira issues show data' do it 'includes Jira issues show data' do
is_expected.to include( is_expected.to include(
issue_labels_path: "/#{project.full_path}/-/integrations/jira/issues/FE-1/labels",
issues_show_path: "/#{project.full_path}/-/integrations/jira/issues/FE-1.json", issues_show_path: "/#{project.full_path}/-/integrations/jira/issues/FE-1.json",
issues_list_path: "/#{project.full_path}/-/integrations/jira/issues" issues_list_path: "/#{project.full_path}/-/integrations/jira/issues"
) )
......
...@@ -86,7 +86,6 @@ RSpec.describe Integrations::JiraSerializers::IssueDetailEntity do ...@@ -86,7 +86,6 @@ RSpec.describe Integrations::JiraSerializers::IssueDetailEntity do
state: 'closed', state: 'closed',
labels: [ labels: [
{ {
id: 'backend',
title: 'backend', title: 'backend',
name: 'backend', name: 'backend',
color: '#0052CC', color: '#0052CC',
......
...@@ -53,7 +53,6 @@ RSpec.describe Integrations::JiraSerializers::IssueEntity do ...@@ -53,7 +53,6 @@ RSpec.describe Integrations::JiraSerializers::IssueEntity do
status: 'To Do', status: 'To Do',
labels: [ labels: [
{ {
id: 'backend',
title: 'backend', title: 'backend',
name: 'backend', name: 'backend',
color: '#0052CC', color: '#0052CC',
......
...@@ -19586,9 +19586,6 @@ msgstr "" ...@@ -19586,9 +19586,6 @@ msgstr ""
msgid "JiraService|Failed to load Jira issue. View the issue in Jira, or reload the page." msgid "JiraService|Failed to load Jira issue. View the issue in Jira, or reload the page."
msgstr "" msgstr ""
msgid "JiraService|Failed to update Jira issue labels. View the issue in Jira, or reload the page."
msgstr ""
msgid "JiraService|Failed to update Jira issue status. View the issue in Jira, or reload the page." msgid "JiraService|Failed to update Jira issue status. View the issue in Jira, or reload the page."
msgstr "" msgstr ""
......
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