You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by nb...@apache.org on 2020/10/23 14:50:22 UTC
[atlas] branch branch-2.0 updated: ATLAS-3984 Add UI Date Timezone
and UI Date Format in Session api
This is an automated email from the ASF dual-hosted git repository.
nbonte pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new 4b0bd1c ATLAS-3984 Add UI Date Timezone and UI Date Format in Session api
4b0bd1c is described below
commit 4b0bd1c2308608e679757f21a9feec33a1ff0d5e
Author: Mandar Ambawane <ma...@freestoneinfotech.com>
AuthorDate: Thu Oct 22 10:58:59 2020 +0530
ATLAS-3984 Add UI Date Timezone and UI Date Format in Session api
Signed-off-by: Nikhil P Bonte <nb...@apache.org>
(cherry picked from commit 90f5b4add36b8a006393d8fa92fa4ba93f49f309)
---
.../org/apache/atlas/web/resources/AdminResource.java | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java b/webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java
index 59af513..f6a20c0 100755
--- a/webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java
+++ b/webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java
@@ -133,6 +133,9 @@ public class AdminResource {
private static final String DEFAULT_EDITABLE_ENTITY_TYPES = "hdfs_path";
private static final String DEFAULT_UI_VERSION = "atlas.ui.default.version";
private static final String UI_VERSION_V2 = "v2";
+ private static final String UI_DATE_TIMEZONE_FORMAT_ENABLED = "atlas.ui.date.timezone.format.enabled";
+ private static final String UI_DATE_FORMAT = "atlas.ui.date.format";
+ private static final String UI_DATE_DEFAULT_FORMAT = "MM/DD/YYYY hh:mm:ss A";
private static final List TIMEZONE_LIST = Arrays.asList(TimeZone.getAvailableIDs());
@Context
@@ -159,6 +162,8 @@ public class AdminResource {
private final AtlasAuditService auditService;
private final String defaultUIVersion;
private final EntityAuditRepository auditRepository;
+ private final boolean isTimezoneFormatEnabled;
+ private final String uiDateFormat;
static {
try {
@@ -191,9 +196,13 @@ public class AdminResource {
this.auditRepository = auditRepository;
if (atlasProperties != null) {
- defaultUIVersion = atlasProperties.getString(DEFAULT_UI_VERSION, UI_VERSION_V2);
+ this.defaultUIVersion = atlasProperties.getString(DEFAULT_UI_VERSION, UI_VERSION_V2);
+ this.isTimezoneFormatEnabled = atlasProperties.getBoolean(UI_DATE_TIMEZONE_FORMAT_ENABLED, true);
+ this.uiDateFormat = atlasProperties.getString(UI_DATE_FORMAT, UI_DATE_DEFAULT_FORMAT);
} else {
- defaultUIVersion = UI_VERSION_V2;
+ this.defaultUIVersion = UI_VERSION_V2;
+ this.isTimezoneFormatEnabled = true;
+ this.uiDateFormat = UI_DATE_DEFAULT_FORMAT;
}
}
@@ -339,6 +348,8 @@ public class AdminResource {
responseData.put("userName", userName);
responseData.put("groups", groups);
responseData.put("timezones", TIMEZONE_LIST);
+ responseData.put(UI_DATE_TIMEZONE_FORMAT_ENABLED, isTimezoneFormatEnabled);
+ responseData.put(UI_DATE_FORMAT, uiDateFormat);
response = Response.ok(AtlasJson.toV1Json(responseData)).build();