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
f244d7b6
Commit
f244d7b6
authored
Jul 23, 2021
by
Olena Horal-Koretska
Committed by
Kushal Pandya
Jul 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix card jumping content on collapse
parent
8876a83e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
6 deletions
+48
-6
ee/app/assets/javascripts/escalation_policies/components/escalation_policy.vue
...ipts/escalation_policies/components/escalation_policy.vue
+7
-2
ee/app/assets/javascripts/oncall_schedules/components/oncall_schedule.vue
...vascripts/oncall_schedules/components/oncall_schedule.vue
+7
-2
ee/spec/frontend/escalation_policies/__snapshots__/escalation_policy_spec.js.snap
...ion_policies/__snapshots__/escalation_policy_spec.js.snap
+1
-1
ee/spec/frontend/escalation_policies/escalation_policy_spec.js
...ec/frontend/escalation_policies/escalation_policy_spec.js
+18
-1
ee/spec/frontend/oncall_schedule/oncall_schedule_spec.js
ee/spec/frontend/oncall_schedule/oncall_schedule_spec.js
+15
-0
No files found.
ee/app/assets/javascripts/escalation_policies/components/escalation_policy.vue
View file @
f244d7b6
...
@@ -70,6 +70,7 @@ export default {
...
@@ -70,6 +70,7 @@ export default {
data
()
{
data
()
{
return
{
return
{
isPolicyVisible
:
this
.
index
===
0
,
isPolicyVisible
:
this
.
index
===
0
,
bodyClass
:
''
,
};
};
},
},
computed
:
{
computed
:
{
...
@@ -94,7 +95,7 @@ export default {
...
@@ -94,7 +95,7 @@ export default {
<gl-card
<gl-card
class=
"gl-mt-5"
class=
"gl-mt-5"
:class=
"
{ 'gl-border-bottom-0': !isPolicyVisible }"
:class=
"
{ 'gl-border-bottom-0': !isPolicyVisible }"
:body-class="
{ 'gl-p-0': !isPolicyVisible }
"
:body-class="
bodyClass
"
:header-class="{ 'gl-py-3': true, 'gl-rounded-base': !isPolicyVisible }"
:header-class="{ 'gl-py-3': true, 'gl-rounded-base': !isPolicyVisible }"
>
>
<template
#header
>
<template
#header
>
...
@@ -129,7 +130,11 @@ export default {
...
@@ -129,7 +130,11 @@ export default {
</gl-button-group>
</gl-button-group>
</div>
</div>
</
template
>
</
template
>
<gl-collapse
:visible=
"isPolicyVisible"
>
<gl-collapse
:visible=
"isPolicyVisible"
@
hidden=
"bodyClass = 'gl-p-0'"
@
show=
"bodyClass = 'gl-p-5'"
>
<p
v-if=
"policy.description"
class=
"gl-text-gray-500 gl-mb-5"
>
<p
v-if=
"policy.description"
class=
"gl-text-gray-500 gl-mb-5"
>
{{ policy.description }}
{{ policy.description }}
</p>
</p>
...
...
ee/app/assets/javascripts/oncall_schedules/components/oncall_schedule.vue
View file @
f244d7b6
...
@@ -125,6 +125,7 @@ export default {
...
@@ -125,6 +125,7 @@ export default {
rotations
:
this
.
schedule
.
rotations
.
nodes
,
rotations
:
this
.
schedule
.
rotations
.
nodes
,
rotationToUpdate
:
{},
rotationToUpdate
:
{},
scheduleVisible
:
this
.
scheduleIndex
===
0
,
scheduleVisible
:
this
.
scheduleIndex
===
0
,
bodyClass
:
this
.
scheduleIndex
===
0
?
'
gl-p-5
'
:
'
gl-p-0
'
,
};
};
},
},
computed
:
{
computed
:
{
...
@@ -236,7 +237,7 @@ export default {
...
@@ -236,7 +237,7 @@ export default {
<gl-card
<gl-card
class=
"gl-mt-5"
class=
"gl-mt-5"
:class=
"
{ 'gl-border-bottom-0': !scheduleVisible }"
:class=
"
{ 'gl-border-bottom-0': !scheduleVisible }"
:body-class="
{ 'gl-p-0': !scheduleVisible }
"
:body-class="
bodyClass
"
:header-class="{ 'gl-py-3': true, 'gl-rounded-small': !scheduleVisible }"
:header-class="{ 'gl-py-3': true, 'gl-rounded-small': !scheduleVisible }"
>
>
<template
#header
>
<template
#header
>
...
@@ -270,7 +271,11 @@ export default {
...
@@ -270,7 +271,11 @@ export default {
</gl-button-group>
</gl-button-group>
</div>
</div>
</
template
>
</
template
>
<gl-collapse
:visible=
"scheduleVisible"
>
<gl-collapse
:visible=
"scheduleVisible"
@
hidden=
"bodyClass = 'gl-p-0'"
@
show=
"bodyClass = 'gl-p-5'"
>
<p
class=
"gl-text-gray-500 gl-mb-5"
data-testid=
"scheduleBody"
>
<p
class=
"gl-text-gray-500 gl-mb-5"
data-testid=
"scheduleBody"
>
{{ scheduleInfo }}
{{ scheduleInfo }}
</p>
</p>
...
...
ee/spec/frontend/escalation_policies/__snapshots__/escalation_policy_spec.js.snap
View file @
f244d7b6
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
exports[`EscalationPolicy renders a policy with rules 1`] = `
exports[`EscalationPolicy renders a policy with rules 1`] = `
<div>
<div>
<gl-card-stub
<gl-card-stub
bodyclass="
[object Object]
"
bodyclass=""
class="gl-mt-5"
class="gl-mt-5"
footerclass=""
footerclass=""
headerclass="[object Object]"
headerclass="[object Object]"
...
...
ee/spec/frontend/escalation_policies/escalation_policy_spec.js
View file @
f244d7b6
import
{
GlSprintf
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
GlSprintf
,
GlIcon
,
GlCard
,
GlCollapse
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
cloneDeep
}
from
'
lodash
'
;
import
{
cloneDeep
}
from
'
lodash
'
;
import
{
nextTick
}
from
'
vue
'
;
import
EditEscalationPolicyModal
from
'
ee/escalation_policies/components/add_edit_escalation_policy_modal.vue
'
;
import
EditEscalationPolicyModal
from
'
ee/escalation_policies/components/add_edit_escalation_policy_modal.vue
'
;
import
DeleteEscalationPolicyModal
from
'
ee/escalation_policies/components/delete_escalation_policy_modal.vue
'
;
import
DeleteEscalationPolicyModal
from
'
ee/escalation_policies/components/delete_escalation_policy_modal.vue
'
;
import
EscalationPolicy
,
{
i18n
}
from
'
ee/escalation_policies/components/escalation_policy.vue
'
;
import
EscalationPolicy
,
{
i18n
}
from
'
ee/escalation_policies/components/escalation_policy.vue
'
;
...
@@ -39,6 +40,8 @@ describe('EscalationPolicy', () => {
...
@@ -39,6 +40,8 @@ describe('EscalationPolicy', () => {
const
findDeleteModal
=
()
=>
wrapper
.
findComponent
(
DeleteEscalationPolicyModal
);
const
findDeleteModal
=
()
=>
wrapper
.
findComponent
(
DeleteEscalationPolicyModal
);
const
findEditModal
=
()
=>
wrapper
.
findComponent
(
EditEscalationPolicyModal
);
const
findEditModal
=
()
=>
wrapper
.
findComponent
(
EditEscalationPolicyModal
);
const
findWarningIcon
=
()
=>
wrapper
.
findComponent
(
GlIcon
);
const
findWarningIcon
=
()
=>
wrapper
.
findComponent
(
GlIcon
);
const
findGlCard
=
()
=>
wrapper
.
findComponent
(
GlCard
);
const
findGlCollapse
=
()
=>
wrapper
.
findComponent
(
GlCollapse
);
it
(
'
renders a policy with rules
'
,
()
=>
{
it
(
'
renders a policy with rules
'
,
()
=>
{
expect
(
wrapper
.
element
).
toMatchSnapshot
();
expect
(
wrapper
.
element
).
toMatchSnapshot
();
...
@@ -78,4 +81,18 @@ describe('EscalationPolicy', () => {
...
@@ -78,4 +81,18 @@ describe('EscalationPolicy', () => {
});
});
});
});
});
});
describe
(
'
Card collapsing behavior
'
,
()
=>
{
it
(
'
adds content body padding when it is expanded
'
,
async
()
=>
{
findGlCollapse
().
vm
.
$emit
(
'
show
'
);
await
nextTick
();
expect
(
findGlCard
().
props
(
'
bodyClass
'
)).
toBe
(
'
gl-p-5
'
);
});
it
(
'
removes content body padding when it is collapsed
'
,
async
()
=>
{
findGlCollapse
().
vm
.
$emit
(
'
hidden
'
);
await
nextTick
();
expect
(
findGlCard
().
props
(
'
bodyClass
'
)).
toBe
(
'
gl-p-0
'
);
});
});
});
});
ee/spec/frontend/oncall_schedule/oncall_schedule_spec.js
View file @
f244d7b6
...
@@ -102,6 +102,7 @@ describe('On-call schedule', () => {
...
@@ -102,6 +102,7 @@ describe('On-call schedule', () => {
const
findLoadPreviousTimeframeBtn
=
()
=>
wrapper
.
findByTestId
(
'
previous-timeframe-btn
'
);
const
findLoadPreviousTimeframeBtn
=
()
=>
wrapper
.
findByTestId
(
'
previous-timeframe-btn
'
);
const
findLoadNextTimeframeBtn
=
()
=>
wrapper
.
findByTestId
(
'
next-timeframe-btn
'
);
const
findLoadNextTimeframeBtn
=
()
=>
wrapper
.
findByTestId
(
'
next-timeframe-btn
'
);
const
findCollapsible
=
()
=>
wrapper
.
findComponent
(
GlCollapse
);
const
findCollapsible
=
()
=>
wrapper
.
findComponent
(
GlCollapse
);
const
findGlCard
=
()
=>
wrapper
.
findComponent
(
GlCard
);
const
findCollapsibleIcon
=
()
=>
wrapper
.
findComponent
(
GlIcon
);
const
findCollapsibleIcon
=
()
=>
wrapper
.
findComponent
(
GlIcon
);
it
(
'
shows schedule title
'
,
()
=>
{
it
(
'
shows schedule title
'
,
()
=>
{
...
@@ -256,6 +257,20 @@ describe('On-call schedule', () => {
...
@@ -256,6 +257,20 @@ describe('On-call schedule', () => {
});
});
});
});
describe
(
'
Card collapsing behavior
'
,
()
=>
{
it
(
'
adds content body padding when it is expanded
'
,
async
()
=>
{
findCollapsible
().
vm
.
$emit
(
'
show
'
);
await
nextTick
();
expect
(
findGlCard
().
props
(
'
bodyClass
'
)).
toBe
(
'
gl-p-5
'
);
});
it
(
'
removes content body padding when it is collapsed
'
,
async
()
=>
{
findCollapsible
().
vm
.
$emit
(
'
hidden
'
);
await
nextTick
();
expect
(
findGlCard
().
props
(
'
bodyClass
'
)).
toBe
(
'
gl-p-0
'
);
});
});
describe
(
'
with Apollo mock
'
,
()
=>
{
describe
(
'
with Apollo mock
'
,
()
=>
{
it
(
'
renders rotations list from API response when resolved
'
,
async
()
=>
{
it
(
'
renders rotations list from API response when resolved
'
,
async
()
=>
{
createComponent
();
createComponent
();
...
...
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