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
6c484fd6
Commit
6c484fd6
authored
Mar 03, 2021
by
Paul Slaughter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace _uid reference with uniqueId
We shouldn't access private props
parent
8f661028
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
ee/app/assets/javascripts/oncall_schedules/components/rotations/components/rotation_assignee.vue
...les/components/rotations/components/rotation_assignee.vue
+2
-2
ee/spec/frontend/oncall_schedule/rotations/components/rotation_assignee_spec.js
...l_schedule/rotations/components/rotation_assignee_spec.js
+3
-3
ee/spec/frontend/oncall_schedule/schedule/components/__snapshots__/rotations_list_section_spec.js.snap
...ponents/__snapshots__/rotations_list_section_spec.js.snap
+2
-2
No files found.
ee/app/assets/javascripts/oncall_schedules/components/rotations/components/rotation_assignee.vue
View file @
6c484fd6
<
script
>
import
{
GlAvatar
,
GlPopover
}
from
'
@gitlab/ui
'
;
import
{
uniqueId
}
from
'
lodash
'
;
import
{
formatDate
}
from
'
~/lib/utils/datetime_utility
'
;
import
{
truncate
}
from
'
~/lib/utils/text_utility
'
;
import
{
__
,
sprintf
}
from
'
~/locale
'
;
...
...
@@ -57,8 +58,7 @@ export default {
});
},
rotationAssigneeUniqueID
()
{
const
{
_uid
}
=
this
;
return
`
${
this
.
assignee
.
user
.
id
}
-
${
_uid
}
`
;
return
uniqueId
(
'
rotation-assignee-
'
);
},
rotationMobileView
()
{
return
this
.
shiftWidth
<=
SHIFT_WIDTHS
.
xs
;
...
...
ee/spec/frontend/oncall_schedule/rotations/components/rotation_assignee_spec.js
View file @
6c484fd6
...
...
@@ -8,6 +8,8 @@ import { formatDate } from '~/lib/utils/datetime_utility';
import
{
truncate
}
from
'
~/lib/utils/text_utility
'
;
import
mockRotations
from
'
../../mocks/mock_rotation.json
'
;
jest
.
mock
(
'
lodash/uniqueId
'
,
()
=>
(
prefix
)
=>
`
${
prefix
}
fakeUniqueId`
);
describe
(
'
RotationAssignee
'
,
()
=>
{
let
wrapper
;
...
...
@@ -71,9 +73,7 @@ describe('RotationAssignee', () => {
});
it
(
'
should render an assignee schedule and rotation information in a popover
'
,
()
=>
{
// eslint-disable-next-line no-underscore-dangle
const
UID
=
wrapper
.
vm
.
_uid
;
expect
(
findPopOver
().
attributes
(
'
target
'
)).
toBe
(
`
${
assignee
.
participant
.
user
.
id
}
-
${
UID
}
`
);
expect
(
findPopOver
().
attributes
(
'
target
'
)).
toBe
(
'
rotation-assignee-fakeUniqueId
'
);
expect
(
findStartsAt
().
text
()).
toContain
(
formattedDate
(
assignee
.
startsAt
));
expect
(
findEndsAt
().
text
()).
toContain
(
formattedDate
(
assignee
.
endsAt
));
});
...
...
ee/spec/frontend/oncall_schedule/schedule/components/__snapshots__/rotations_list_section_spec.js.snap
View file @
6c484fd6
...
...
@@ -83,7 +83,7 @@ exports[`RotationsListSectionComponent when the timeframe includes today renders
<div
class="gl-h-6 gl-bg-data-viz-blue-500 gl-display-flex gl-justify-content-center gl-align-items-center"
data-testid="rotation-assignee"
id="
1-1
2"
id="
rotation-assignee-
2"
>
<div
class="gl-text-white gl-display-flex gl-justify-content-center gl-align-items-center"
...
...
@@ -123,7 +123,7 @@ exports[`RotationsListSectionComponent when the timeframe includes today renders
<div
class="gl-h-6 gl-bg-data-viz-orange-500 gl-display-flex gl-justify-content-center gl-align-items-center"
data-testid="rotation-assignee"
id="
2-16
"
id="
rotation-assignee-3
"
>
<div
class="gl-text-white gl-display-flex gl-justify-content-center gl-align-items-center"
...
...
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