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
0e2c5803
Commit
0e2c5803
authored
Mar 23, 2021
by
David O'Regan
Committed by
Illya Klymov
Mar 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "timezones don't encode special characters properly"
parent
a474f44a
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
12 deletions
+27
-12
ee/app/assets/javascripts/oncall_schedules/components/add_edit_schedule_form.vue
...ts/oncall_schedules/components/add_edit_schedule_form.vue
+11
-2
ee/changelogs/unreleased/324713-schedule-description.yml
ee/changelogs/unreleased/324713-schedule-description.yml
+5
-0
ee/spec/frontend/oncall_schedule/__snapshots__/add_edit_schedule_form_spec.js.snap
...chedule/__snapshots__/add_edit_schedule_form_spec.js.snap
+6
-5
ee/spec/frontend/oncall_schedule/add_edit_schedule_form_spec.js
...c/frontend/oncall_schedule/add_edit_schedule_form_spec.js
+1
-1
ee/spec/frontend/oncall_schedule/mocks/mock_timezones.json
ee/spec/frontend/oncall_schedule/mocks/mock_timezones.json
+4
-4
No files found.
ee/app/assets/javascripts/oncall_schedules/components/add_edit_schedule_form.vue
View file @
0e2c5803
<
script
>
<
script
>
import
{
import
{
GlIcon
,
GlForm
,
GlForm
,
GlFormGroup
,
GlFormGroup
,
GlFormInput
,
GlFormInput
,
GlDropdown
,
GlDropdown
,
GlDropdownItem
,
GlDropdownItem
,
GlSearchBoxByType
,
GlSearchBoxByType
,
GlSafeHtmlDirective
as
SafeHtml
,
}
from
'
@gitlab/ui
'
;
}
from
'
@gitlab/ui
'
;
import
{
isEqual
,
isEmpty
}
from
'
lodash
'
;
import
{
isEqual
,
isEmpty
}
from
'
lodash
'
;
import
{
s__
,
__
}
from
'
~/locale
'
;
import
{
s__
,
__
}
from
'
~/locale
'
;
...
@@ -39,6 +41,7 @@ export const i18n = {
...
@@ -39,6 +41,7 @@ export const i18n = {
export
default
{
export
default
{
i18n
,
i18n
,
components
:
{
components
:
{
GlIcon
,
GlForm
,
GlForm
,
GlFormGroup
,
GlFormGroup
,
GlFormInput
,
GlFormInput
,
...
@@ -46,6 +49,9 @@ export default {
...
@@ -46,6 +49,9 @@ export default {
GlDropdownItem
,
GlDropdownItem
,
GlSearchBoxByType
,
GlSearchBoxByType
,
},
},
directives
:
{
SafeHtml
,
},
inject
:
[
'
projectPath
'
,
'
timezones
'
],
inject
:
[
'
projectPath
'
,
'
timezones
'
],
props
:
{
props
:
{
form
:
{
form
:
{
...
@@ -138,12 +144,15 @@ export default {
...
@@ -138,12 +144,15 @@ export default {
>
>
<gl-dropdown
<gl-dropdown
id=
"schedule-timezone"
id=
"schedule-timezone"
:text=
"selectedTimezone"
class=
"timezone-dropdown gl-w-full"
class=
"timezone-dropdown gl-w-full"
:header-text=
"$options.i18n.selectTimezone"
:header-text=
"$options.i18n.selectTimezone"
:class=
"
{ 'invalid-dropdown': !validationState.timezone }"
:class=
"
{ 'invalid-dropdown': !validationState.timezone }"
@hide="$emit('update-schedule-form', { type: 'timezone', value: selectedDropdownTimezone })"
@hide="$emit('update-schedule-form', { type: 'timezone', value: selectedDropdownTimezone })"
>
>
<template
#button-content
>
<span
v-safe-html=
"selectedTimezone"
class=
"gl-new-dropdown-button-text"
></span>
<gl-icon
class=
"dropdown-chevron"
name=
"chevron-down"
/>
</
template
>
<gl-search-box-by-type
v-model.trim=
"tzSearchTerm"
/>
<gl-search-box-by-type
v-model.trim=
"tzSearchTerm"
/>
<gl-dropdown-item
<gl-dropdown-item
v-for=
"tz in filteredTimezones"
v-for=
"tz in filteredTimezones"
...
@@ -152,7 +161,7 @@ export default {
...
@@ -152,7 +161,7 @@ export default {
is-check-item
is-check-item
@
click=
"setTimezone(tz)"
@
click=
"setTimezone(tz)"
>
>
<span
class=
"gl-white-space-nowrap"
>
{{
getFormattedTimezone
(
tz
)
}}
</span>
<span
v-safe-html=
"getFormattedTimezone(tz)"
class=
"gl-white-space-nowrap"
>
</span>
</gl-dropdown-item>
</gl-dropdown-item>
<gl-dropdown-item
v-if=
"noResults"
>
<gl-dropdown-item
v-if=
"noResults"
>
{{ $options.i18n.noResults }}
{{ $options.i18n.noResults }}
...
...
ee/changelogs/unreleased/324713-schedule-description.yml
0 → 100644
View file @
0e2c5803
---
title
:
Allow oncall schedule timezones to encode special characters correctly
merge_request
:
56792
author
:
type
:
fixed
ee/spec/frontend/oncall_schedule/__snapshots__/add_edit_schedule_form_spec.js.snap
View file @
0e2c5803
...
@@ -45,9 +45,10 @@ exports[`AddEditScheduleForm renders modal layout 1`] = `
...
@@ -45,9 +45,10 @@ exports[`AddEditScheduleForm renders modal layout 1`] = `
hideheaderborder="true"
hideheaderborder="true"
id="schedule-timezone"
id="schedule-timezone"
size="medium"
size="medium"
text="
(UTC -12:00) -12 International Date Line West
"
text=""
variant="default"
variant="default"
>
>
<gl-search-box-by-type-stub
<gl-search-box-by-type-stub
clearbuttontitle="Clear"
clearbuttontitle="Clear"
value=""
value=""
...
@@ -111,7 +112,7 @@ exports[`AddEditScheduleForm renders modal layout 1`] = `
...
@@ -111,7 +112,7 @@ exports[`AddEditScheduleForm renders modal layout 1`] = `
<span
<span
class="gl-white-space-nowrap"
class="gl-white-space-nowrap"
>
>
(UTC -10:00) HST Hawaii
(UTC -7:00) PT Pacific Time (US & Canada)
</span>
</span>
</gl-dropdown-item-stub>
</gl-dropdown-item-stub>
...
...
ee/spec/frontend/oncall_schedule/add_edit_schedule_form_spec.js
View file @
0e2c5803
...
@@ -84,7 +84,7 @@ describe('AddEditScheduleForm', () => {
...
@@ -84,7 +84,7 @@ describe('AddEditScheduleForm', () => {
describe
(
'
timezones filtering
'
,
()
=>
{
describe
(
'
timezones filtering
'
,
()
=>
{
it
(
'
should filter options based on search term
'
,
async
()
=>
{
it
(
'
should filter options based on search term
'
,
async
()
=>
{
const
searchTerm
=
'
Hawaii
'
;
const
searchTerm
=
'
Pacific
'
;
findTimezoneSearchBox
().
vm
.
$emit
(
'
input
'
,
searchTerm
);
findTimezoneSearchBox
().
vm
.
$emit
(
'
input
'
,
searchTerm
);
await
wrapper
.
vm
.
$nextTick
();
await
wrapper
.
vm
.
$nextTick
();
const
options
=
findDropdownOptions
();
const
options
=
findDropdownOptions
();
...
...
ee/spec/frontend/oncall_schedule/mocks/mock_timezones.json
View file @
0e2c5803
...
@@ -18,9 +18,9 @@
...
@@ -18,9 +18,9 @@
"formatted_offset"
:
"-11:00"
"formatted_offset"
:
"-11:00"
},
},
{
{
"identifier"
:
"Pacific/
Honolulu
"
,
"identifier"
:
"Pacific/
US/Canada
"
,
"name"
:
"
Hawaii
"
,
"name"
:
"
Pacific Time (US & Canada)
"
,
"abbr"
:
"
HS
T"
,
"abbr"
:
"
P
T"
,
"formatted_offset"
:
"-
10
:00"
"formatted_offset"
:
"-
7
:00"
}
}
]
]
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