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
cd28d49e
Commit
cd28d49e
authored
Mar 18, 2021
by
David O'Regan
Committed by
Savas Vedova
Mar 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: update oncall rotation name to truncate
parent
cee98bf9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
20 deletions
+47
-20
ee/app/assets/javascripts/oncall_schedules/components/schedule/components/rotations_list_section.vue
...components/schedule/components/rotations_list_section.vue
+8
-2
ee/changelogs/unreleased/324714-long-name-overlap.yml
ee/changelogs/unreleased/324714-long-name-overlap.yml
+5
-0
ee/spec/frontend/oncall_schedule/schedule/components/__snapshots__/rotations_list_section_spec.js.snap
...ponents/__snapshots__/rotations_list_section_spec.js.snap
+3
-1
ee/spec/frontend/oncall_schedule/schedule/components/rotations_list_section_spec.js
...hedule/schedule/components/rotations_list_section_spec.js
+31
-17
No files found.
ee/app/assets/javascripts/oncall_schedules/components/schedule/components/rotations_list_section.vue
View file @
cd28d49e
...
@@ -108,7 +108,7 @@ export default {
...
@@ -108,7 +108,7 @@ export default {
<span
<span
class=
"details-cell gl-display-flex gl-justify-content-space-between gl-align-items-center gl-pl-3"
class=
"details-cell gl-display-flex gl-justify-content-space-between gl-align-items-center gl-pl-3"
>
>
<span
class=
"gl-text-truncate
d
"
>
{{
$options
.
i18n
.
addRotationLabel
}}
</span>
<span
class=
"gl-text-truncate"
>
{{
$options
.
i18n
.
addRotationLabel
}}
</span>
</span>
</span>
<span
<span
v-for=
"(timeframeItem, index) in timeframeToDraw"
v-for=
"(timeframeItem, index) in timeframeToDraw"
...
@@ -125,7 +125,13 @@ export default {
...
@@ -125,7 +125,13 @@ export default {
<span
<span
class=
"details-cell gl-display-flex gl-justify-content-space-between gl-align-items-center gl-pl-3"
class=
"details-cell gl-display-flex gl-justify-content-space-between gl-align-items-center gl-pl-3"
>
>
<span
class=
"gl-text-truncated"
>
{{
rotation
.
name
}}
</span>
<span
v-gl-tooltip=
"
{ boundary: 'viewport', title: rotation.name }"
class="gl-text-truncate"
:aria-label="rotation.name"
:data-testid="`rotation-name-${rotation.id}`"
>
{{
rotation
.
name
}}
</span
>
<gl-button-group
class=
"gl-px-2"
>
<gl-button-group
class=
"gl-px-2"
>
<gl-button
<gl-button
v-gl-modal=
"$options.editRotationModalId"
v-gl-modal=
"$options.editRotationModalId"
...
...
ee/changelogs/unreleased/324714-long-name-overlap.yml
0 → 100644
View file @
cd28d49e
---
title
:
Update oncall schedule rotation names to truncate if they are too long
merge_request
:
56762
author
:
type
:
fixed
ee/spec/frontend/oncall_schedule/schedule/components/__snapshots__/rotations_list_section_spec.js.snap
View file @
cd28d49e
...
@@ -12,7 +12,9 @@ exports[`RotationsListSectionComponent when the timeframe includes today renders
...
@@ -12,7 +12,9 @@ exports[`RotationsListSectionComponent when the timeframe includes today renders
class="details-cell gl-display-flex gl-justify-content-space-between gl-align-items-center gl-pl-3"
class="details-cell gl-display-flex gl-justify-content-space-between gl-align-items-center gl-pl-3"
>
>
<span
<span
class="gl-text-truncated"
aria-label="Rotation 242"
class="gl-text-truncate"
data-testid="rotation-name-gid://gitlab/IncidentManagement::OncallRotation/2"
>
>
Rotation 242
Rotation 242
</span>
</span>
...
...
ee/spec/frontend/oncall_schedule/schedule/components/rotations_list_section_spec.js
View file @
cd28d49e
...
@@ -6,6 +6,8 @@ import RotationsListSection from 'ee/oncall_schedules/components/schedule/compon
...
@@ -6,6 +6,8 @@ import RotationsListSection from 'ee/oncall_schedules/components/schedule/compon
import
{
getTimeframeForWeeksView
}
from
'
ee/oncall_schedules/components/schedule/utils
'
;
import
{
getTimeframeForWeeksView
}
from
'
ee/oncall_schedules/components/schedule/utils
'
;
import
{
PRESET_TYPES
}
from
'
ee/oncall_schedules/constants
'
;
import
{
PRESET_TYPES
}
from
'
ee/oncall_schedules/constants
'
;
import
{
useFakeDate
}
from
'
helpers/fake_date
'
;
import
{
useFakeDate
}
from
'
helpers/fake_date
'
;
import
{
createMockDirective
,
getBinding
}
from
'
helpers/vue_mock_directive
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
scheduleIid
}
from
'
../../mocks/apollo_mock
'
;
import
{
scheduleIid
}
from
'
../../mocks/apollo_mock
'
;
import
mockRotations
from
'
../../mocks/mock_rotation.json
'
;
import
mockRotations
from
'
../../mocks/mock_rotation.json
'
;
...
@@ -19,7 +21,8 @@ describe('RotationsListSectionComponent', () => {
...
@@ -19,7 +21,8 @@ describe('RotationsListSectionComponent', () => {
presetType
=
PRESET_TYPES
.
WEEKS
,
presetType
=
PRESET_TYPES
.
WEEKS
,
timeframe
=
mockTimeframeWeeks
,
timeframe
=
mockTimeframeWeeks
,
}
=
{})
{
}
=
{})
{
wrapper
=
mount
(
RotationsListSection
,
{
wrapper
=
extendedWrapper
(
mount
(
RotationsListSection
,
{
propsData
:
{
propsData
:
{
presetType
,
presetType
,
timeframe
,
timeframe
,
...
@@ -32,13 +35,18 @@ describe('RotationsListSectionComponent', () => {
...
@@ -32,13 +35,18 @@ describe('RotationsListSectionComponent', () => {
stubs
:
{
stubs
:
{
GlCard
,
GlCard
,
},
},
});
directives
:
{
GlTooltip
:
createMockDirective
(),
},
}),
);
}
}
const
findTimelineCells
=
()
=>
wrapper
.
findAll
(
'
[data-testid="timeline-cell"]
'
);
const
findTimelineCells
=
()
=>
wrapper
.
findAll
ByTestId
(
'
timeline-cell
'
);
const
findRotationAssignees
=
()
=>
wrapper
.
findAllComponents
(
RotationsAssignee
);
const
findRotationAssignees
=
()
=>
wrapper
.
findAllComponents
(
RotationsAssignee
);
const
findCurrentDayIndicatorContent
=
()
=>
const
findCurrentDayIndicatorContent
=
()
=>
wrapper
.
findByTestId
(
'
current-day-indicator
'
);
wrapper
.
find
(
'
[data-testid="current-day-indicator"]
'
);
const
findRotationName
=
(
id
)
=>
wrapper
.
findByTestId
(
`rotation-name-
${
id
}
`
);
const
findRotationNameTooltip
=
(
id
)
=>
getBinding
(
findRotationName
(
id
).
element
,
'
gl-tooltip
'
);
afterEach
(()
=>
{
afterEach
(()
=>
{
if
(
wrapper
)
{
if
(
wrapper
)
{
...
@@ -75,6 +83,12 @@ describe('RotationsListSectionComponent', () => {
...
@@ -75,6 +83,12 @@ describe('RotationsListSectionComponent', () => {
mockRotations
[
0
].
shifts
.
nodes
[
0
].
participant
.
user
,
mockRotations
[
0
].
shifts
.
nodes
[
0
].
participant
.
user
,
);
);
});
});
it
(
'
renders a tooltip with the rotation name
'
,
()
=>
{
const
rotationNameTT
=
findRotationNameTooltip
(
mockRotations
[
0
].
id
);
expect
(
rotationNameTT
.
value
).
toBeDefined
();
expect
(
rotationNameTT
.
value
.
title
).
toBe
(
mockRotations
[
0
].
name
);
});
});
});
describe
(
'
when the timeframe does not include today
'
,
()
=>
{
describe
(
'
when the timeframe does not include today
'
,
()
=>
{
...
...
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