summaryrefslogtreecommitdiff
path: root/web/src/reducers
diff options
context:
space:
mode:
authorAndy Ladjadj <andy.ladjadj@adevinta.com>2020-04-17 20:48:33 +0200
committerMonty Taylor <mordred@inaugust.com>2020-05-20 16:54:54 -0500
commit86eba8b05d5a3f913ba7e255565e8cd5d20fea35 (patch)
tree8c2a498836c8bab1db16808a5e4e300ee9afac42 /web/src/reducers
parent349991c5686b47c72fed1cd8123f8caf72ac422e (diff)
downloadzuul-86eba8b05d5a3f913ba7e255565e8cd5d20fea35.tar.gz
Add new timezone selector in web interface
- the default value keep UTC - the timezone is saved in cookie in zuul_timezone_string - the render format is YYYY-MM-DD HH:mm:ss Change-Id: Ib4ac2af4194ac2722c5574577661f4ddda8cc398
Diffstat (limited to 'web/src/reducers')
-rw-r--r--web/src/reducers/index.js12
-rw-r--r--web/src/reducers/timezone.js22
2 files changed, 29 insertions, 5 deletions
diff --git a/web/src/reducers/index.js b/web/src/reducers/index.js
index 18abb44e3..84fe8e6fd 100644
--- a/web/src/reducers/index.js
+++ b/web/src/reducers/index.js
@@ -24,30 +24,32 @@ import jobs from './jobs'
import labels from './labels'
import logfile from './logfile'
import nodes from './nodes'
+import openapi from './openapi'
import project from './project'
import projects from './projects'
import status from './status'
import tenant from './tenant'
import tenants from './tenants'
-import openapi from './openapi'
+import timezone from './timezone'
const reducers = {
- change,
build,
+ change,
+ configErrors,
+ errors,
info,
job,
jobs,
labels,
logfile,
nodes,
+ openapi,
project,
projects,
- configErrors,
- errors,
status,
tenant,
tenants,
- openapi,
+ timezone,
}
export default combineReducers(reducers)
diff --git a/web/src/reducers/timezone.js b/web/src/reducers/timezone.js
new file mode 100644
index 000000000..c382ab0d3
--- /dev/null
+++ b/web/src/reducers/timezone.js
@@ -0,0 +1,22 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License. You may obtain
+// a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations
+// under the License.
+
+import { TIMEZONE_SET } from '../actions/timezone'
+
+export default (state = 'UTC', action) => {
+ switch (action.type) {
+ case TIMEZONE_SET:
+ return action.timezone
+ default:
+ return state
+ }
+ }