Commit dafd58a1 authored by Paul Slaughter's avatar Paul Slaughter

Merge branch 'remove-scoped-labels-documentation-link' into 'master'

Remove scoped labels documentation link

See merge request gitlab-org/gitlab!28701
parents fe7a1e56 8cb10ebd
......@@ -113,9 +113,6 @@ export default Vue.extend({
// eslint-disable-next-line @gitlab/require-i18n-strings
return `boards.${this.boardId}.${this.list.type}.${this.list.id}`;
},
helpLink() {
return boardsStore.scopedLabels.helpLink;
},
},
watch: {
filter: {
......
......@@ -113,9 +113,6 @@ export default {
// eslint-disable-next-line @gitlab/require-i18n-strings
return `boards.${this.boardId}.${this.list.type}.${this.list.id}`;
},
helpLink() {
return boardsStore.scopedLabels.helpLink;
},
},
watch: {
filter: {
......@@ -286,7 +283,6 @@ export default {
:background-color="list.label.color"
:description="list.label.description"
:scoped="showScopedLabels(list.label)"
:scoped-labels-documentation-link="helpLink"
:size="!list.isExpanded ? 'sm' : ''"
:title="list.label.title"
tooltip-placement="bottom"
......
......@@ -58,11 +58,6 @@ export default {
required: false,
default: false,
},
scopedLabelsDocumentationLink: {
type: String,
required: false,
default: '#',
},
},
data() {
return {
......@@ -208,7 +203,6 @@ export default {
:can-admin-board="canAdminBoard"
:milestone-path="milestonePath"
:labels-path="labelsPath"
:scoped-labels-documentation-link="scopedLabelsDocumentationLink"
:enable-scoped-labels="enableScopedLabels"
:project-id="projectId"
:group-id="groupId"
......
......@@ -70,9 +70,6 @@ export default Vue.extend({
selectedLabels() {
return this.hasLabels ? this.issue.labels.map(l => l.title).join(',') : '';
},
helpLink() {
return boardsStore.scopedLabels.helpLink;
},
},
watch: {
detail: {
......
......@@ -86,11 +86,6 @@ export default {
required: false,
default: false,
},
scopedLabelsDocumentationLink: {
type: String,
required: false,
default: '#',
},
},
data() {
return {
......@@ -348,7 +343,6 @@ export default {
:scoped-issue-board-feature-enabled="scopedIssueBoardFeatureEnabled"
:weights="weights"
:enable-scoped-labels="enabledScopedLabels"
:scoped-labels-documentation-link="scopedLabelsDocumentationLink"
/>
</span>
</div>
......
......@@ -102,9 +102,6 @@ export default {
orderedLabels() {
return sortBy(this.issue.labels.filter(this.isNonListLabel), 'title');
},
helpLink() {
return boardsStore.scopedLabels.helpLink;
},
},
methods: {
isIndexLessThanlimit(index) {
......@@ -181,7 +178,6 @@ export default {
:description="label.description"
size="sm"
:scoped="showScopedLabel(label)"
:scoped-labels-documentation-link="helpLink"
@click="filterByLabel(label)"
/>
</template>
......
......@@ -28,7 +28,6 @@ const boardsStore = {
limitToHours: false,
},
scopedLabels: {
helpLink: '',
enabled: false,
},
filter: {
......
......@@ -55,7 +55,6 @@ export default class LabelsSelect {
})
.get();
const scopedLabels = $dropdown.data('scopedLabels');
const scopedLabelsDocumentationLink = $dropdown.data('scopedLabelsDocumentationLink');
const { handleClick } = options;
$sidebarLabelTooltip.tooltip();
......@@ -104,7 +103,6 @@ export default class LabelsSelect {
labels: sortBy(data.labels, 'title'),
issueUpdateURL,
enableScopedLabels: scopedLabels,
scopedLabelsDocumentationLink,
});
labelCount = data.labels.length;
......@@ -497,14 +495,6 @@ export default class LabelsSelect {
return escapeStr(label.text_color === '#FFFFFF' ? label.color : label.text_color);
};
const infoIconTemplate = template(
[
'<a href="<%= scopedLabelsDocumentationLink %>" class="gl-link gl-label-icon" target="_blank" rel="noopener">',
'<i class="fa fa-question-circle"></i>',
'</a>',
].join(''),
);
const scopedLabelTemplate = template(
[
'<span class="gl-label gl-label-scoped" style="color: <%= escapeStr(label.color) %>;">',
......@@ -516,7 +506,6 @@ export default class LabelsSelect {
'<%- label.title.slice(label.title.lastIndexOf("::") + 2) %>',
'</span>',
'</a>',
'<%= infoIconTemplate({ label, scopedLabelsDocumentationLink, escapeStr }) %>',
'</span>',
].join(''),
);
......@@ -538,7 +527,7 @@ export default class LabelsSelect {
'<% labels.forEach(function(label){ %>',
'<% if (isScopedLabel(label) && enableScopedLabels) { %>',
'<span class="d-inline-block position-relative scoped-label-wrapper">',
'<%= scopedLabelTemplate({ label, issueUpdateURL, isScopedLabel, enableScopedLabels, rightLabelTextColor, infoIconTemplate, scopedLabelsDocumentationLink, tooltipTitleTemplate, escapeStr, linkAttrs: \'data-html="true"\' }) %>',
'<%= scopedLabelTemplate({ label, issueUpdateURL, isScopedLabel, enableScopedLabels, rightLabelTextColor, tooltipTitleTemplate, escapeStr, linkAttrs: \'data-html="true"\' }) %>',
'</span>',
'<% } else { %>',
'<%= labelTemplate({ label, issueUpdateURL, isScopedLabel, enableScopedLabels, tooltipTitleTemplate, escapeStr, linkAttrs: "" }) %>',
......@@ -551,7 +540,6 @@ export default class LabelsSelect {
...tplData,
labelTemplate,
rightLabelTextColor,
infoIconTemplate,
scopedLabelTemplate,
tooltipTitleTemplate,
isScopedLabel,
......
......@@ -80,11 +80,6 @@ export default {
required: false,
default: false,
},
scopedLabelsDocumentationLink: {
type: String,
required: false,
default: '#',
},
},
computed: {
hiddenInputName() {
......@@ -136,7 +131,6 @@ export default {
<dropdown-value
:labels="context.labels"
:label-filter-base-path="labelFilterBasePath"
:scoped-labels-documentation-link="scopedLabelsDocumentationLink"
:enable-scoped-labels="enableScopedLabels"
>
<slot></slot>
......@@ -157,7 +151,6 @@ export default {
:namespace="namespace"
:labels="context.labels"
:show-extra-options="!showCreate"
:scoped-labels-documentation-link="scopedLabelsDocumentationLink"
:enable-scoped-labels="enableScopedLabels"
/>
<div
......
......@@ -36,11 +36,6 @@ export default {
required: false,
default: false,
},
scopedLabelsDocumentationLink: {
type: String,
required: false,
default: '#',
},
},
computed: {
dropdownToggleText() {
......@@ -72,7 +67,6 @@ export default {
:data-namespace-path="namespace"
:data-show-any="showExtraOptions"
:data-scoped-labels="enableScopedLabels"
:data-scoped-labels-documentation-link="scopedLabelsDocumentationLink"
type="button"
class="dropdown-menu-toggle wide js-label-select js-multiselect js-context-config-modal"
data-toggle="dropdown"
......
......@@ -20,11 +20,6 @@ export default {
required: false,
default: false,
},
scopedLabelsDocumentationLink: {
type: String,
required: false,
default: '#',
},
},
computed: {
isEmpty() {
......@@ -64,7 +59,6 @@ export default {
:title="label.title"
:description="label.description"
:scoped="showScopedLabels(label)"
:scoped-labels-documentation-link="scopedLabelsDocumentationLink"
/>
</template>
</div>
......
......@@ -9,12 +9,7 @@ export default {
GlLabel,
},
computed: {
...mapState([
'selectedLabels',
'allowScopedLabels',
'labelsFilterBasePath',
'scopedLabelsDocumentationPath',
]),
...mapState(['selectedLabels', 'allowScopedLabels', 'labelsFilterBasePath']),
},
methods: {
labelFilterUrl(label) {
......@@ -45,7 +40,6 @@ export default {
:background-color="label.color"
:target="labelFilterUrl(label)"
:scoped="scopedLabel(label)"
:scoped-labels-documentation-link="scopedLabelsDocumentationPath"
tooltip-placement="top"
/>
</template>
......
......@@ -67,11 +67,6 @@ export default {
required: false,
default: '',
},
scopedLabelsDocumentationPath: {
type: String,
required: false,
default: '',
},
labelsListTitle: {
type: String,
required: false,
......@@ -113,7 +108,6 @@ export default {
labelsFetchPath: this.labelsFetchPath,
labelsManagePath: this.labelsManagePath,
labelsFilterBasePath: this.labelsFilterBasePath,
scopedLabelsDocumentationPath: this.scopedLabelsDocumentationPath,
labelsListTitle: this.labelsListTitle,
labelsCreateTitle: this.labelsCreateTitle,
footerCreateLabelTitle: this.footerCreateLabelTitle,
......
......@@ -11,7 +11,6 @@ export default () => ({
namespace: '',
labelsFetchPath: '',
labelsFilterBasePath: '',
scopedLabelsDocumentationPath: '#',
// UI Flags
allowLabelCreate: false,
......
......@@ -38,8 +38,7 @@
":description" => "list.label.description",
"tooltipPlacement" => "bottom",
":size" => '(!list.isExpanded ? "sm" : "")',
":scoped" => "showScopedLabels(list.label)",
":scoped-labels-documentation-link" => "helpLink" }
":scoped" => "showScopedLabels(list.label)" }
- if can?(current_user, :admin_list, current_board_parent)
%board-delete{ "inline-template" => true,
......
......@@ -12,8 +12,7 @@
":background-color" => "label.color",
":title" => "label.title",
":description" => "label.description",
":scoped" => "showScopedLabels(label)",
":scoped-labels-documentation-link" => "helpLink" }
":scoped" => "showScopedLabels(label)" }
- if can_admin_issue?
.selectbox
......
......@@ -35,11 +35,6 @@ export default {
type: String,
required: true,
},
scopedLabelsDocumentationLink: {
type: String,
required: false,
default: '#',
},
enableScopedLabels: {
type: Boolean,
required: false,
......@@ -119,7 +114,6 @@ export default {
:context="board"
:labels-path="labelsPath"
:can-edit="canAdminBoard"
:scoped-labels-documentation-link="scopedLabelsDocumentationLink"
:enable-scoped-labels="enableScopedLabels"
ability-name="issue"
@onLabelClick="handleLabelClick"
......
......@@ -168,9 +168,6 @@ export default {
showScopedLabels(label) {
return boardsStoreEE.store.scopedLabels.enabled && isScopedLabel(label);
},
helpLink() {
return boardsStoreEE.store.scopedLabels.helpLink;
},
},
};
</script>
......
......@@ -39,7 +39,6 @@ class BoardsStoreEE {
boardWeight,
weightFeatureAvailable,
scopedLabels,
scopedLabelsDocumentationLink,
},
} = this.$boardApp;
this.store.boardConfig = {
......@@ -53,7 +52,6 @@ class BoardsStoreEE {
this.store.weightFeatureAvailable = parseBoolean(weightFeatureAvailable);
this.store.scopedLabels = {
enabled: parseBoolean(scopedLabels),
helpLink: scopedLabelsDocumentationLink,
};
this.initBoardFilters();
}
......
......@@ -35,7 +35,6 @@ export default {
'labelsWebUrl',
'epicsWebUrl',
'scopedLabels',
'scopedLabelsDocumentationLink',
'epicLabelsSelectInProgress',
]),
epicContext() {
......@@ -118,7 +117,6 @@ export default {
:labels-fetch-path="labelsPath"
:labels-manage-path="labelsWebUrl"
:labels-filter-base-path="epicsWebUrl"
:scoped-labels-documentation-path="scopedLabelsDocumentationLink"
class="block labels js-labels-block"
@updateSelectedLabels="handleUpdateSelectedLabels"
@onDropdownClose="handleDropdownClose"
......
......@@ -25,8 +25,7 @@ module EE
focus_mode_available: true,
weight_feature_available: current_board_parent.feature_available?(:issue_weights).to_s,
show_promotion: show_feature_promotion,
scoped_labels: current_board_parent.feature_available?(:scoped_labels)&.to_s,
scoped_labels_documentation_link: help_page_path('user/project/labels.md', anchor: 'scoped-labels-premium')
scoped_labels: current_board_parent.feature_available?(:scoped_labels)&.to_s
}
super.merge(data)
......
......@@ -30,7 +30,7 @@ module EE
<<~HTML.chomp.html_safe
<span class="d-inline-block position-relative scoped-label-wrapper">
<span class="#{wrapper_classes.join(' ')}" style="color: #{label.color}">#{label_html + scoped_labels_doc_link}</span>
<span class="#{wrapper_classes.join(' ')}" style="color: #{label.color}">#{label_html}</span>
</span>
HTML
end
......@@ -44,8 +44,7 @@ module EE
def label_dropdown_data(edit_context, opts = {})
scoped_labels_fields = {
scoped_labels: edit_context&.feature_available?(:scoped_labels)&.to_s,
scoped_labels_documentation_link: help_page_path('user/project/labels.md', anchor: 'scoped-labels-premium')
scoped_labels: edit_context&.feature_available?(:scoped_labels)&.to_s
}
return super.merge(scoped_labels_fields) unless edit_context.is_a?(Group)
......@@ -70,13 +69,5 @@ module EE
super + ['epics']
end
private
def scoped_labels_doc_link
help_url = ::Gitlab::Routing.url_helpers.help_page_url('user/project/labels.md', anchor: 'scoped-labels-premium')
%(<a href="#{help_url}" class="gl-link gl-label-icon" target="_blank" rel="noopener"><i class="fa fa-question-circle"></i></a>).html_safe
end
end
end
......@@ -78,8 +78,7 @@ class EpicPresenter < Gitlab::View::Presenter::Delegated
labels_path: group_labels_path(group, format: :json, only_group_labels: true, include_ancestor_groups: true),
toggle_subscription_path: toggle_subscription_group_epic_path(group, epic),
labels_web_url: group_labels_path(group),
epics_web_url: group_epics_path(group),
scoped_labels_documentation_link: help_page_path('user/project/labels.md', anchor: 'scoped-labels-premium')
epics_web_url: group_epics_path(group)
}
paths[:todo_delete_path] = dashboard_todo_path(epic_pending_todo) if epic_pending_todo.present?
......
---
title: Remove scoped labels documentation link
merge_request: 28701
author:
type: changed
......@@ -3,7 +3,7 @@
"type": "object",
"required": ["epic_id", "created", "author", "ancestors", "todo_exists", "todo_path", "lock_version",
"state", "namespace", "labels_path", "toggle_subscription_path", "labels_web_url", "epics_web_url",
"scoped_labels", "scoped_labels_documentation_link", "start_date", "start_date_is_fixed", "start_date_fixed",
"scoped_labels", "start_date", "start_date_is_fixed", "start_date_fixed",
"start_date_from_milestones", "start_date_sourcing_milestone_title", "start_date_sourcing_milestone_dates",
"due_date", "due_date_is_fixed", "due_date_fixed",
"due_date_from_milestones", "due_date_sourcing_milestone_title", "due_date_sourcing_milestone_dates"],
......@@ -103,9 +103,6 @@
"scoped_labels": {
"type": "boolean"
},
"scoped_labels_documentation_link": {
"type": "string"
},
"start_date": {
"type": [
"string",
......
......@@ -67,7 +67,6 @@ describe('BoardSettingsSideBar', () => {
removeList: bs.removeList,
scopedLabels: {
enabled: false,
scopedLabelsDocumentationLink: '',
},
};
......
......@@ -13,14 +13,6 @@ describe LabelsHelper do
stub_licensed_features(scoped_labels: true)
end
it 'includes link to scoped labels documentation' do
expect(render_label(scoped_label)).to match(%r(<span.+>#{scoped_label.scoped_label_key}</span><span.+>#{scoped_label.scoped_label_value}</span><a.+>.*question-circle.*</a>)m)
end
it 'does not include link to scoped label documentation for common labels' do
expect(render_label(label)).to match(%r(<span.+><span.+>#{label.name}</span></span>$)m)
end
it 'right text span does not have .gl-label-text-dark class if label color is dark' do
scoped_label.color = '#D10069'
......@@ -56,8 +48,7 @@ describe LabelsHelper do
show_no: "true",
show_any: "true",
default_label: "Labels",
scoped_labels: "false",
scoped_labels_documentation_link: "/help/user/project/labels.md#scoped-labels-premium"
scoped_labels: "false"
}
end
......
......@@ -13,14 +13,13 @@ describe MarkupHelper do
stub_licensed_features(scoped_labels: true)
end
it 'shows proper tooltip and documentation link' do
it 'shows proper tooltip' do
note = build(:note, note: label.to_reference, project: project)
result = first_line_in_markdown(note, :note, nil, project: project)
doc = Nokogiri::HTML.parse(result)
expect(doc.css('.gl-label-link')[0].attr('data-html')).to eq('true')
expect(doc.css('a .fa-question-circle').length).to eq(1)
end
end
end
......
......@@ -18,14 +18,12 @@ describe Banzai::Filter::LabelReferenceFilter do
doc = reference_filter("See #{scoped_label.to_reference}")
expect(doc.css('.gl-label-scoped .gl-label-text').map(&:text)).to eq([scoped_label.scoped_label_key, scoped_label.scoped_label_value])
expect(doc.at_css('a.gl-label-icon')['href']).to eq('http://localhost/help/user/project/labels.md#scoped-labels-premium')
end
it 'renders common label' do
doc = reference_filter("See #{label.to_reference}")
expect(doc.css('.gl-label .gl-label-text').map(&:text)).to eq([label.name])
expect(doc.at_css('a.gl-label-icon')).to be_nil
end
end
......@@ -38,7 +36,6 @@ describe Banzai::Filter::LabelReferenceFilter do
doc = reference_filter("See #{scoped_label.to_reference}")
expect(doc.css('.gl-label .gl-label-text').map(&:text)).to eq([scoped_label.name])
expect(doc.at_css('a.gl-label-icon')).to be_nil
end
end
end
......@@ -45,7 +45,6 @@ describe('LabelsSelect', () => {
labels: mockLabels,
issueUpdateURL: mockUrl,
enableScopedLabels: true,
scopedLabelsDocumentationLink: 'docs-link',
}),
);
});
......@@ -71,10 +70,6 @@ describe('LabelsSelect', () => {
it('generated label item has a gl-label-text class', () => {
expect($labelEl.find('span').hasClass('gl-label-text')).toEqual(true);
});
it('generated label item template does not have gl-label-icon class', () => {
expect($labelEl.find('.gl-label-icon')).toHaveLength(0);
});
});
describe('when scoped label is present', () => {
......@@ -87,7 +82,6 @@ describe('LabelsSelect', () => {
labels: mockScopedLabels,
issueUpdateURL: mockUrl,
enableScopedLabels: true,
scopedLabelsDocumentationLink: 'docs-link',
}),
);
});
......@@ -106,14 +100,6 @@ describe('LabelsSelect', () => {
expect($labelEl.find('a').attr('data-html')).toBe('true');
});
it('generated label item template has question icon', () => {
expect($labelEl.find('i.fa-question-circle')).toHaveLength(1);
});
it('generated label item template has gl-label-icon class', () => {
expect($labelEl.find('.gl-label-icon')).toHaveLength(1);
});
it('generated label item template has correct label styles', () => {
expect($labelEl.find('span.gl-label-text').attr('style')).toBe(
`background-color: ${label.color}; color: ${label.text_color};`,
......@@ -141,7 +127,6 @@ describe('LabelsSelect', () => {
labels: mockScopedLabels2,
issueUpdateURL: mockUrl,
enableScopedLabels: true,
scopedLabelsDocumentationLink: 'docs-link',
}),
);
});
......
......@@ -38,7 +38,6 @@ export const mockConfig = {
labelsFetchPath: '/gitlab-org/my-project/-/labels.json',
labelsManagePath: '/gitlab-org/my-project/-/labels',
labelsFilterBasePath: '/gitlab-org/my-project/issues',
scopedLabelsDocumentationPath: '/help/user/project/labels.md#scoped-labels-premium',
};
export const mockSuggestedColors = {
......
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