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
485de1fe
Commit
485de1fe
authored
Sep 23, 2021
by
peterhegman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove option to clear time zone dropdown
Per UX reviewer feedback
parent
4840ed7f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
30 deletions
+1
-30
app/assets/javascripts/pages/projects/pipeline_schedules/shared/components/timezone_dropdown.js
...pipeline_schedules/shared/components/timezone_dropdown.js
+1
-16
spec/frontend/pages/projects/pipeline_schedules/shared/components/timezone_dropdown_spec.js
...ine_schedules/shared/components/timezone_dropdown_spec.js
+0
-14
No files found.
app/assets/javascripts/pages/projects/pipeline_schedules/shared/components/timezone_dropdown.js
View file @
485de1fe
...
...
@@ -17,13 +17,7 @@ export const formatUtcOffset = (offset) => {
return
`
${
prefix
}
${
Math
.
abs
(
offset
/
3600
)}
`
;
};
export
const
formatTimezone
=
(
item
)
=>
{
if
(
Object
.
prototype
.
hasOwnProperty
.
call
(
item
,
'
offset
'
))
{
return
`[UTC
${
formatUtcOffset
(
item
.
offset
)}
]
${
item
.
name
}
`
;
}
return
item
.
name
;
};
export
const
formatTimezone
=
(
item
)
=>
`[UTC
${
formatUtcOffset
(
item
.
offset
)}
]
${
item
.
name
}
`
;
export
const
findTimezoneByIdentifier
=
(
tzList
=
[],
identifier
=
null
)
=>
{
if
(
tzList
&&
tzList
.
length
&&
identifier
&&
identifier
.
length
)
{
...
...
@@ -45,15 +39,6 @@ export default class TimezoneDropdown {
this
.
$input
=
$inputEl
;
this
.
timezoneData
=
this
.
$dropdown
.
data
(
'
data
'
)
||
[];
if
(
allowEmpty
)
{
this
.
timezoneData
=
[
{
name
:
this
.
$dropdownToggle
.
text
(),
},
...
this
.
timezoneData
,
];
}
this
.
onSelectTimezone
=
onSelectTimezone
;
this
.
displayFormat
=
displayFormat
||
defaults
.
displayFormat
;
this
.
allowEmpty
=
allowEmpty
;
...
...
spec/frontend/pages/projects/pipeline_schedules/shared/components/timezone_dropdown_spec.js
View file @
485de1fe
...
...
@@ -81,12 +81,6 @@ describe('Timezone Dropdown', () => {
it
(
'
will default the value of the input to an empty string
'
,
()
=>
{
expect
(
$inputEl
.
val
()).
toBe
(
''
);
});
it
(
'
will add a new dropdown item for selecting an empty value
'
,
()
=>
{
expect
(
$
(
`
${
tzListSel
}
:contains('
${
findDropdownToggleText
().
html
()}
')`
,
$wrapper
).
length
,
).
not
.
toBe
(
0
);
});
});
});
...
...
@@ -202,14 +196,6 @@ describe('Timezone Dropdown', () => {
}),
).
toEqual
(
'
[UTC 0] Accra
'
);
});
it
(
'
returns name when no offset is provided
'
,
()
=>
{
expect
(
formatTimezone
({
name
:
'
Foo bar
'
,
}),
).
toEqual
(
'
Foo bar
'
);
});
});
describe
(
'
findTimezoneByIdentifier
'
,
()
=>
{
...
...
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