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
27934e2b
Commit
27934e2b
authored
Mar 16, 2021
by
Tristan Read
Committed by
Ezekiel Kigbo
Mar 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix on-call edit form formatting issue
parent
57733910
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
29 deletions
+16
-29
ee/app/assets/javascripts/oncall_schedules/components/rotations/components/add_edit_rotation_form.vue
...omponents/rotations/components/add_edit_rotation_form.vue
+2
-14
ee/app/assets/javascripts/oncall_schedules/utils/common_utils.js
...assets/javascripts/oncall_schedules/utils/common_utils.js
+1
-1
ee/spec/frontend/oncall_schedule/common_utils_spec.js
ee/spec/frontend/oncall_schedule/common_utils_spec.js
+9
-2
ee/spec/frontend/oncall_schedule/rotations/components/add_edit_rotation_form_spec.js
...edule/rotations/components/add_edit_rotation_form_spec.js
+4
-12
No files found.
ee/app/assets/javascripts/oncall_schedules/components/rotations/components/add_edit_rotation_form.vue
View file @
27934e2b
...
...
@@ -198,12 +198,6 @@ export default {
class=
"gl-w-full"
:value=
"formattedDate"
:placeholder=
"__(`YYYY-MM-DD`)"
@
blur=
"
$emit('update-rotation-form',
{
type: 'startsAt.date',
value: $event.target.value,
})
"
/>
</
template
>
</gl-datepicker>
...
...
@@ -261,12 +255,6 @@ export default {
class=
"gl-w-full"
:value=
"formattedDate"
:placeholder=
"__(`YYYY-MM-DD`)"
@
blur=
"
$emit('update-rotation-form',
{
type: 'endsAt.date',
value: $event.target.value,
})
"
/>
</
template
>
</gl-datepicker>
...
...
@@ -326,7 +314,7 @@ export default {
class=
"gl-px-3"
>
<gl-dropdown-item
v-for=
"
time
in $options.HOURS_IN_DAY"
v-for=
"
(_, time)
in $options.HOURS_IN_DAY"
:key=
"time"
:is-checked=
"form.restrictedTo.startTime === time"
is-check-item
...
...
@@ -346,7 +334,7 @@ export default {
class=
"gl-px-3"
>
<gl-dropdown-item
v-for=
"
time
in $options.HOURS_IN_DAY"
v-for=
"
(_, time)
in $options.HOURS_IN_DAY"
:key=
"time"
:is-checked=
"form.restrictedTo.endTime === time"
is-check-item
...
...
ee/app/assets/javascripts/oncall_schedules/utils/common_utils.js
View file @
27934e2b
...
...
@@ -73,7 +73,7 @@ export const parseRotationDate = (dateTimeString, scheduleTimezone) => {
month
:
'
2-digit
'
,
day
:
'
2-digit
'
,
hour
:
'
2-digit
'
,
hour
12
:
false
,
// The time picker uses 24 hour time
hour
Cycle
:
'
h23
'
,
timeZone
:
scheduleTimezone
,
timeZoneName
:
'
long
'
,
};
...
...
ee/spec/frontend/oncall_schedule/common_utils_spec.js
View file @
27934e2b
...
...
@@ -31,14 +31,21 @@ describe('getParticipantsForSave', () => {
});
describe
(
'
parseRotationDate
'
,
()
=>
{
const
scheduleTimezone
=
'
Pacific/Honolulu
'
;
// UTC -10
it
(
'
parses a rotation date according to the supplied timezone
'
,
()
=>
{
const
dateTimeString
=
'
2021-01-12T05:04:56.333Z
'
;
const
scheduleTimezone
=
'
Pacific/Honolulu
'
;
const
rotationDate
=
parseRotationDate
(
dateTimeString
,
scheduleTimezone
);
expect
(
rotationDate
).
toStrictEqual
({
date
:
new
Date
(
'
2021-01-11T00:00:00.000Z
'
),
time
:
19
});
});
it
(
'
parses a rotation date at midnight without exceeding 24 hours
'
,
()
=>
{
const
dateTimeString
=
'
2021-01-12T10:00:00.000Z
'
;
const
rotationDate
=
parseRotationDate
(
dateTimeString
,
scheduleTimezone
);
expect
(
rotationDate
).
toStrictEqual
({
date
:
new
Date
(
'
2021-01-12T00:00:00.000Z
'
),
time
:
0
});
});
});
describe
(
'
parseHour
'
,
()
=>
{
...
...
ee/spec/frontend/oncall_schedule/rotations/components/add_edit_rotation_form_spec.js
View file @
27934e2b
...
...
@@ -227,8 +227,8 @@ describe('AddEditRotationForm', () => {
findRestrictedToOptions
().
at
(
timeTo
).
vm
.
$emit
(
'
click
'
);
const
emittedEvent
=
wrapper
.
emitted
(
'
update-rotation-form
'
);
expect
(
emittedEvent
).
toHaveLength
(
2
);
expect
(
emittedEvent
[
0
][
0
]).
toEqual
({
type
:
'
restrictedTo.startTime
'
,
value
:
timeFrom
+
1
});
expect
(
emittedEvent
[
1
][
0
]).
toEqual
({
type
:
'
restrictedTo.endTime
'
,
value
:
timeTo
+
1
});
expect
(
emittedEvent
[
0
][
0
]).
toEqual
({
type
:
'
restrictedTo.startTime
'
,
value
:
timeFrom
});
expect
(
emittedEvent
[
1
][
0
]).
toEqual
({
type
:
'
restrictedTo.endTime
'
,
value
:
timeTo
});
});
it
(
'
should add a checkmark to a selected restricted FROM time
'
,
async
()
=>
{
...
...
@@ -241,16 +241,8 @@ describe('AddEditRotationForm', () => {
},
},
});
expect
(
findRestrictedFromOptions
()
.
at
(
timeFrom
-
1
)
.
props
(
'
isChecked
'
),
).
toBe
(
true
);
expect
(
findRestrictedToOptions
()
.
at
(
timeTo
-
1
)
.
props
(
'
isChecked
'
),
).
toBe
(
true
);
expect
(
findRestrictedFromOptions
().
at
(
timeFrom
).
props
(
'
isChecked
'
)).
toBe
(
true
);
expect
(
findRestrictedToOptions
().
at
(
timeTo
).
props
(
'
isChecked
'
)).
toBe
(
true
);
});
});
});
...
...
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