Commit 7ec364c4 authored by Illya Klymov's avatar Illya Klymov

Merge branch 'remove-design-managment-todo-button-ff' into 'master'

Remove Design todo button feature flag

See merge request gitlab-org/gitlab!43971
parents 0eac5c3e 36cabfec
......@@ -71,14 +71,6 @@ export default {
resolvedCommentsToggleIcon() {
return this.resolvedDiscussionsExpanded ? 'chevron-down' : 'chevron-right';
},
showTodoButton() {
return this.glFeatures.designManagementTodoButton;
},
sidebarWrapperClass() {
return {
'gl-pt-0': this.showTodoButton,
};
},
},
watch: {
isResolvedCommentsPopoverHidden(newVal) {
......@@ -121,9 +113,8 @@ export default {
</script>
<template>
<div class="image-notes" :class="sidebarWrapperClass" @click="handleSidebarClick">
<div class="image-notes gl-pt-0" @click="handleSidebarClick">
<div
v-if="showTodoButton"
class="gl-py-4 gl-mb-4 gl-display-flex gl-justify-content-space-between gl-align-items-center gl-border-b-1 gl-border-b-solid gl-border-b-gray-100"
>
<span>{{ __('To Do') }}</span>
......
......@@ -44,7 +44,6 @@ class Projects::IssuesController < Projects::ApplicationController
push_frontend_feature_flag(:vue_issuable_sidebar, project.group)
push_frontend_feature_flag(:tribute_autocomplete, @project)
push_frontend_feature_flag(:vue_issuables_list, project)
push_frontend_feature_flag(:design_management_todo_button, project, default_enabled: true)
push_frontend_feature_flag(:vue_sidebar_labels, @project)
end
......
---
name: design_management_todo_button
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/39935
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/245074
group: group::knowledge
type: development
default_enabled: true
......@@ -226,37 +226,12 @@ available in the **Resolved Comment** area at the bottom of the right sidebar.
## Add to dos for designs
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/198439) in GitLab 13.4.
> - It's [deployed behind a feature flag](../../feature_flags.md), enabled by default.
> - It's enabled on GitLab.com.
> - It's recommended for production use.
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#enable-or-disable-the-design-to-do-button). **(CORE ONLY)**
CAUTION: **Warning:**
This feature might not be available to you. Check the **version history** note above for details.
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/245074) in **GitLab 13.5**
Add a to do for a design by clicking **Add a To-Do** on the design sidebar:
![To-Do button](img/design_todo_button_v13_4.png)
### Enable or disable the design to-do button **(CORE ONLY)**
The **Add a To-Do** button for Designs is under development but ready for production use. It is
deployed behind a feature flag that is **enabled by default**.
[GitLab administrators with access to the GitLab Rails console](../../../administration/feature_flags.md)
can enable it.
To enable it:
```ruby
Feature.enable(:design_management_todo_button)
```
To disable it:
```ruby
Feature.disable(:design_management_todo_button)
```
## Referring to designs in Markdown
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/217160) in **GitLab 13.1**.
......
......@@ -43,7 +43,7 @@ describe('Design management design sidebar component', () => {
const findNewDiscussionDisclaimer = () =>
wrapper.find('[data-testid="new-discussion-disclaimer"]');
function createComponent(props = {}, { enableTodoButton } = {}) {
function createComponent(props = {}) {
wrapper = shallowMount(DesignSidebar, {
propsData: {
design,
......@@ -58,9 +58,6 @@ describe('Design management design sidebar component', () => {
},
},
stubs: { GlPopover },
provide: {
glFeatures: { designManagementTodoButton: enableTodoButton },
},
});
}
......@@ -80,6 +77,12 @@ describe('Design management design sidebar component', () => {
expect(findParticipants().props('participants')).toHaveLength(1);
});
it('renders To-Do button', () => {
createComponent();
expect(wrapper.find(DesignTodoButton).exists()).toBe(true);
});
describe('when has no discussions', () => {
beforeEach(() => {
createComponent({
......@@ -245,23 +248,4 @@ describe('Design management design sidebar component', () => {
expect(Cookies.set).toHaveBeenCalledWith(cookieKey, 'true', { expires: 365 * 10 });
});
});
it('does not render To-Do button by default', () => {
createComponent();
expect(wrapper.find(DesignTodoButton).exists()).toBe(false);
});
describe('when `design_management_todo_button` feature flag is enabled', () => {
beforeEach(() => {
createComponent({}, { enableTodoButton: true });
});
it('renders sidebar root element with no top padding', () => {
expect(wrapper.classes()).toContain('gl-pt-0');
});
it('renders To-Do button', () => {
expect(wrapper.find(DesignTodoButton).exists()).toBe(true);
});
});
});
......@@ -30,9 +30,19 @@ exports[`Design management design index page renders design index 1`] = `
</div>
<div
class="image-notes"
class="image-notes gl-pt-0"
>
<!---->
<div
class="gl-py-4 gl-mb-4 gl-display-flex gl-justify-content-space-between gl-align-items-center gl-border-b-1 gl-border-b-solid gl-border-b-gray-100"
>
<span>
To Do
</span>
<design-todo-button-stub
design="[object Object]"
/>
</div>
<h2
class="gl-font-weight-bold gl-mt-0"
......@@ -180,9 +190,19 @@ exports[`Design management design index page with error GlAlert is rendered in c
</div>
<div
class="image-notes"
class="image-notes gl-pt-0"
>
<!---->
<div
class="gl-py-4 gl-mb-4 gl-display-flex gl-justify-content-space-between gl-align-items-center gl-border-b-1 gl-border-b-solid gl-border-b-gray-100"
>
<span>
To Do
</span>
<design-todo-button-stub
design="[object Object]"
/>
</div>
<h2
class="gl-font-weight-bold gl-mt-0"
......
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