Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
193f439d
Commit
193f439d
authored
Jan 19, 2021
by
Samantha Ming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert Approval Rules to use GlAccordion
Issue:
https://gitlab.com/gitlab-org/gitlab/-/issues/293729
parent
abce3cae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
40 deletions
+14
-40
ee/app/assets/javascripts/approvals/components/mr_edit/app.vue
...p/assets/javascripts/approvals/components/mr_edit/app.vue
+14
-40
No files found.
ee/app/assets/javascripts/approvals/components/mr_edit/app.vue
View file @
193f439d
<
script
>
import
{
uniqueId
}
from
'
lodash
'
;
import
{
GlIcon
,
GlButton
,
GlCollapse
,
GlCollapseToggleDirective
,
GlSafeHtmlDirective
,
}
from
'
@gitlab/ui
'
;
import
{
GlSafeHtmlDirective
,
GlAccordion
,
GlAccordionItem
}
from
'
@gitlab/ui
'
;
import
{
mapState
}
from
'
vuex
'
;
import
glFeatureFlagsMixin
from
'
~/vue_shared/mixins/gl_feature_flags_mixin
'
;
import
{
__
,
n__
,
sprintf
}
from
'
~/locale
'
;
import
{
__
,
n__
,
sprintf
,
s__
}
from
'
~/locale
'
;
import
App
from
'
../app.vue
'
;
import
MrRules
from
'
./mr_rules.vue
'
;
import
MrRulesHiddenInputs
from
'
./mr_rules_hidden_inputs.vue
'
;
export
default
{
components
:
{
GlIcon
,
GlButton
,
GlCollapse
,
GlAccordion
,
GlAccordionItem
,
App
,
MrRules
,
MrRulesHiddenInputs
,
},
directives
:
{
CollapseToggle
:
GlCollapseToggleDirective
,
SafeHtml
:
GlSafeHtmlDirective
,
},
mixins
:
[
glFeatureFlagsMixin
()],
data
()
{
return
{
collapseId
:
uniqueId
(
'
approval-rules-expandable-section-
'
),
isCollapsed
:
false
,
};
},
computed
:
{
...
mapState
({
rules
:
(
state
)
=>
state
.
approvals
.
rules
,
canOverride
:
(
state
)
=>
state
.
settings
.
canOverride
,
}),
toggleIcon
()
{
return
this
.
isCollapsed
?
'
chevron-down
'
:
'
chevron-right
'
;
accordionTitle
()
{
return
s__
(
'
ApprovalRule|Approval rules
'
)
;
},
isCollapseFeatureEnabled
()
{
return
this
.
glFeatures
.
mergeRequestReviewers
&&
this
.
glFeatures
.
mrCollapsedApprovalRules
;
...
...
@@ -120,26 +105,15 @@ export default {
class=
"gl-mb-0 gl-text-gray-500"
data-testid=
"collapsedSummaryText"
></p>
<gl-button
v-if=
"canOverride"
v-collapse-toggle=
"collapseId"
variant=
"link"
button-text-classes=
"flex"
>
<gl-icon
:name=
"toggleIcon"
class=
"mr-1"
/>
<span>
{{
s__
(
'
ApprovalRule|Approval rules
'
)
}}
</span>
</gl-button>
<gl-collapse
:id=
"collapseId"
v-model=
"isCollapsed"
class=
"gl-mt-3 gl-ml-5 gl-mb-5 gl-transition-medium"
>
<app>
<mr-rules
slot=
"rules"
/>
<mr-rules-hidden-inputs
slot=
"footer"
/>
</app>
</gl-collapse>
<gl-accordion>
<gl-accordion-item
:title=
"accordionTitle"
>
<app>
<mr-rules
slot=
"rules"
/>
<mr-rules-hidden-inputs
slot=
"footer"
/>
</app>
</gl-accordion-item>
</gl-accordion>
</div>
<app
v-else
>
<mr-rules
slot=
"rules"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment