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
8f661028
Commit
8f661028
authored
Feb 24, 2021
by
David O'Regan
Committed by
Paul Slaughter
Mar 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix(oncallschedules): replace GlToken with plain div
reduce code complexity and remove unneeded code
parent
7dae08d1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
45 deletions
+37
-45
ee/app/assets/javascripts/oncall_schedules/components/rotations/components/rotation_assignee.vue
...les/components/rotations/components/rotation_assignee.vue
+10
-8
ee/spec/frontend/oncall_schedule/rotations/components/rotation_assignee_spec.js
...l_schedule/rotations/components/rotation_assignee_spec.js
+2
-2
ee/spec/frontend/oncall_schedule/schedule/components/__snapshots__/rotations_list_section_spec.js.snap
...ponents/__snapshots__/rotations_list_section_spec.js.snap
+25
-35
No files found.
ee/app/assets/javascripts/oncall_schedules/components/rotations/components/rotation_assignee.vue
View file @
8f661028
<
script
>
<
script
>
import
{
Gl
Token
,
Gl
Avatar
,
GlPopover
}
from
'
@gitlab/ui
'
;
import
{
GlAvatar
,
GlPopover
}
from
'
@gitlab/ui
'
;
import
{
formatDate
}
from
'
~/lib/utils/datetime_utility
'
;
import
{
formatDate
}
from
'
~/lib/utils/datetime_utility
'
;
import
{
truncate
}
from
'
~/lib/utils/text_utility
'
;
import
{
truncate
}
from
'
~/lib/utils/text_utility
'
;
import
{
__
,
sprintf
}
from
'
~/locale
'
;
import
{
__
,
sprintf
}
from
'
~/locale
'
;
...
@@ -10,11 +10,13 @@ export const SHIFT_WIDTHS = {
...
@@ -10,11 +10,13 @@ export const SHIFT_WIDTHS = {
xs
:
40
,
xs
:
40
,
};
};
const
ROTATION_CENTER_CLASS
=
'
gl-display-flex gl-justify-content-center gl-align-items-center
'
;
export
default
{
export
default
{
ROTATION_CENTER_CLASS
,
components
:
{
components
:
{
GlAvatar
,
GlAvatar
,
GlPopover
,
GlPopover
,
GlToken
,
},
},
props
:
{
props
:
{
assignee
:
{
assignee
:
{
...
@@ -72,19 +74,19 @@ export default {
...
@@ -72,19 +74,19 @@ export default {
<
template
>
<
template
>
<div
class=
"gl-absolute gl-h-7 gl-mt-3"
:style=
"rotationAssigneeStyle"
>
<div
class=
"gl-absolute gl-h-7 gl-mt-3"
:style=
"rotationAssigneeStyle"
>
<
gl-token
<
div
:id=
"rotationAssigneeUniqueID"
:id=
"rotationAssigneeUniqueID"
class=
"gl-
w-full gl-h-6 gl-align-items-center
"
class=
"gl-
h-6
"
:class=
"
chevronClass
"
:class=
"
[chevronClass, $options.ROTATION_CENTER_CLASS]
"
:view-only=
"tru
e"
data-testid=
"rotation-assigne
e"
>
>
<div
class=
"gl-
display-flex gl-text-white gl-font-weight-normal
"
>
<div
class=
"gl-
text-white"
:class=
"$options.ROTATION_CENTER_CLASS
"
>
<gl-avatar
:src=
"assignee.user.avatarUrl"
:size=
"16"
/>
<gl-avatar
:src=
"assignee.user.avatarUrl"
:size=
"16"
/>
<span
v-if=
"!rotationMobileView"
class=
"gl-ml-2"
data-testid=
"rotation-assignee-name"
>
{{
<span
v-if=
"!rotationMobileView"
class=
"gl-ml-2"
data-testid=
"rotation-assignee-name"
>
{{
assigneeName
assigneeName
}}
</span>
}}
</span>
</div>
</div>
</
gl-token
>
</
div
>
<gl-popover
<gl-popover
:target=
"rotationAssigneeUniqueID"
:target=
"rotationAssigneeUniqueID"
:title=
"assignee.user.username"
:title=
"assignee.user.username"
...
...
ee/spec/frontend/oncall_schedule/rotations/components/rotation_assignee_spec.js
View file @
8f661028
import
{
Gl
Token
,
Gl
Avatar
,
GlPopover
}
from
'
@gitlab/ui
'
;
import
{
GlAvatar
,
GlPopover
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
RotationAssignee
,
{
import
RotationAssignee
,
{
SHIFT_WIDTHS
,
SHIFT_WIDTHS
,
...
@@ -13,7 +13,7 @@ describe('RotationAssignee', () => {
...
@@ -13,7 +13,7 @@ describe('RotationAssignee', () => {
const
shiftWidth
=
100
;
const
shiftWidth
=
100
;
const
assignee
=
mockRotations
[
0
].
shifts
.
nodes
[
0
];
const
assignee
=
mockRotations
[
0
].
shifts
.
nodes
[
0
];
const
findToken
=
()
=>
wrapper
.
find
Component
(
GlToken
);
const
findToken
=
()
=>
wrapper
.
find
ByTestId
(
'
rotation-assignee
'
);
const
findAvatar
=
()
=>
wrapper
.
findComponent
(
GlAvatar
);
const
findAvatar
=
()
=>
wrapper
.
findComponent
(
GlAvatar
);
const
findPopOver
=
()
=>
wrapper
.
findComponent
(
GlPopover
);
const
findPopOver
=
()
=>
wrapper
.
findComponent
(
GlPopover
);
const
findStartsAt
=
()
=>
wrapper
.
findByTestId
(
'
rotation-assignee-starts-at
'
);
const
findStartsAt
=
()
=>
wrapper
.
findByTestId
(
'
rotation-assignee-starts-at
'
);
...
...
ee/spec/frontend/oncall_schedule/schedule/components/__snapshots__/rotations_list_section_spec.js.snap
View file @
8f661028
...
@@ -80,28 +80,23 @@ exports[`RotationsListSectionComponent when the timeframe includes today renders
...
@@ -80,28 +80,23 @@ exports[`RotationsListSectionComponent when the timeframe includes today renders
class="gl-absolute gl-h-7 gl-mt-3"
class="gl-absolute gl-h-7 gl-mt-3"
style="left: 0px; width: -2px;"
style="left: 0px; width: -2px;"
>
>
<span
<div
class="gl-w-full gl-h-6 gl-align-items-center gl-token gl-token-default-variant gl-bg-data-viz-blue-500"
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-12"
id="1-12"
>
>
<
span
<
div
class="gl-t
oken-content
"
class="gl-t
ext-white gl-display-flex gl-justify-content-center gl-align-items-center
"
>
>
<div
<img
class="gl-display-flex gl-text-white gl-font-weight-normal"
alt="avatar"
>
class="gl-avatar gl-avatar-circle gl-avatar-s16"
<img
src="/url"
alt="avatar"
/>
class="gl-avatar gl-avatar-circle gl-avatar-s16"
src="/url"
/>
<!---->
</div>
<!---->
<!---->
</
span
>
</
div
>
</
span
>
</
div
>
<div
<div
class="gl-popover"
class="gl-popover"
...
@@ -125,28 +120,23 @@ exports[`RotationsListSectionComponent when the timeframe includes today renders
...
@@ -125,28 +120,23 @@ exports[`RotationsListSectionComponent when the timeframe includes today renders
class="gl-absolute gl-h-7 gl-mt-3"
class="gl-absolute gl-h-7 gl-mt-3"
style="left: 0px; width: -2px;"
style="left: 0px; width: -2px;"
>
>
<span
<div
class="gl-w-full gl-h-6 gl-align-items-center gl-token gl-token-default-variant gl-bg-data-viz-orange-500"
class="gl-h-6 gl-bg-data-viz-orange-500 gl-display-flex gl-justify-content-center gl-align-items-center"
id="2-17"
data-testid="rotation-assignee"
id="2-16"
>
>
<
span
<
div
class="gl-t
oken-content
"
class="gl-t
ext-white gl-display-flex gl-justify-content-center gl-align-items-center
"
>
>
<div
<img
class="gl-display-flex gl-text-white gl-font-weight-normal"
alt="avatar"
>
class="gl-avatar gl-avatar-circle gl-avatar-s16"
<img
src="/url"
alt="avatar"
/>
class="gl-avatar gl-avatar-circle gl-avatar-s16"
src="/url"
/>
<!---->
</div>
<!---->
<!---->
</
span
>
</
div
>
</
span
>
</
div
>
<div
<div
class="gl-popover"
class="gl-popover"
...
...
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