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
Hide 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
>
import
{
GlIcon
,
GlForm
,
GlFormGroup
,
GlFormInput
,
GlDropdown
,
GlDropdownItem
,
GlSearchBoxByType
,
GlSafeHtmlDirective
as
SafeHtml
,
}
from
'
@gitlab/ui
'
;
import
{
isEqual
,
isEmpty
}
from
'
lodash
'
;
import
{
s__
,
__
}
from
'
~/locale
'
;
...
...
@@ -39,6 +41,7 @@ export const i18n = {
export
default
{
i18n
,
components
:
{
GlIcon
,
GlForm
,
GlFormGroup
,
GlFormInput
,
...
...
@@ -46,6 +49,9 @@ export default {
GlDropdownItem
,
GlSearchBoxByType
,
},
directives
:
{
SafeHtml
,
},
inject
:
[
'
projectPath
'
,
'
timezones
'
],
props
:
{
form
:
{
...
...
@@ -138,12 +144,15 @@ export default {
>
<gl-dropdown
id=
"schedule-timezone"
:text=
"selectedTimezone"
class=
"timezone-dropdown gl-w-full"
:header-text=
"$options.i18n.selectTimezone"
:class=
"
{ 'invalid-dropdown': !validationState.timezone }"
@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-dropdown-item
v-for=
"tz in filteredTimezones"
...
...
@@ -152,7 +161,7 @@ export default {
is-check-item
@
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
v-if=
"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`] = `
hideheaderborder="true"
id="schedule-timezone"
size="medium"
text="
(UTC -12:00) -12 International Date Line West
"
text=""
variant="default"
>
<gl-search-box-by-type-stub
clearbuttontitle="Clear"
value=""
...
...
@@ -66,7 +67,7 @@ exports[`AddEditScheduleForm renders modal layout 1`] = `
<span
class="gl-white-space-nowrap"
>
(UTC -12:00) -12 International Date Line West
(UTC -12:00) -12 International Date Line West
</span>
</gl-dropdown-item-stub>
<gl-dropdown-item-stub
...
...
@@ -81,7 +82,7 @@ exports[`AddEditScheduleForm renders modal layout 1`] = `
<span
class="gl-white-space-nowrap"
>
(UTC -11:00) SST American Samoa
(UTC -11:00) SST American Samoa
</span>
</gl-dropdown-item-stub>
<gl-dropdown-item-stub
...
...
@@ -96,7 +97,7 @@ exports[`AddEditScheduleForm renders modal layout 1`] = `
<span
class="gl-white-space-nowrap"
>
(UTC -11:00) SST Midway Island
(UTC -11:00) SST Midway Island
</span>
</gl-dropdown-item-stub>
<gl-dropdown-item-stub
...
...
@@ -111,7 +112,7 @@ exports[`AddEditScheduleForm renders modal layout 1`] = `
<span
class="gl-white-space-nowrap"
>
(UTC -10:00) HST Hawaii
(UTC -7:00) PT Pacific Time (US & Canada)
</span>
</gl-dropdown-item-stub>
...
...
ee/spec/frontend/oncall_schedule/add_edit_schedule_form_spec.js
View file @
0e2c5803
...
...
@@ -84,7 +84,7 @@ describe('AddEditScheduleForm', () => {
describe
(
'
timezones filtering
'
,
()
=>
{
it
(
'
should filter options based on search term
'
,
async
()
=>
{
const
searchTerm
=
'
Hawaii
'
;
const
searchTerm
=
'
Pacific
'
;
findTimezoneSearchBox
().
vm
.
$emit
(
'
input
'
,
searchTerm
);
await
wrapper
.
vm
.
$nextTick
();
const
options
=
findDropdownOptions
();
...
...
ee/spec/frontend/oncall_schedule/mocks/mock_timezones.json
View file @
0e2c5803
...
...
@@ -18,9 +18,9 @@
"formatted_offset"
:
"-11:00"
},
{
"identifier"
:
"Pacific/
Honolulu
"
,
"name"
:
"
Hawaii
"
,
"abbr"
:
"
HS
T"
,
"formatted_offset"
:
"-
10
:00"
"identifier"
:
"Pacific/
US/Canada
"
,
"name"
:
"
Pacific Time (US & Canada)
"
,
"abbr"
:
"
P
T"
,
"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