Skip to content

Commit 5b2ccf6

Browse files
authored
Merge pull request #634 from shuhaib-aot/main-7.0.1-to-develop
Main 7.0.1 to develop
2 parents 379000c + cb0dc6f commit 5b2ccf6

File tree

5 files changed

+25
-13
lines changed

5 files changed

+25
-13
lines changed

forms-flow-nav/src/constants/constants.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -187,20 +187,20 @@ export const OPERATIONS = {
187187
export const PageSizes = [5, 10, 25, 50, 100, "all"];
188188

189189
// draft config
190-
const DRAFT_POLLING_RATE_FROM_ENV =
191-
(window._env_ && window._env_.REACT_APP_DRAFT_POLLING_RATE)
190+
const DRAFT_POLLING_RATE_FROM_ENV = window._env_?.REACT_APP_DRAFT_POLLING_RATE;
192191

193192
export const DRAFT_POLLING_RATE = DRAFT_POLLING_RATE_FROM_ENV
194193
? Number(DRAFT_POLLING_RATE_FROM_ENV)
195194
: null;
196-
const DRAFT_ENABLED_VARIABLE =
197-
(window._env_ && window._env_.REACT_APP_DRAFT_ENABLED) ||
198-
false;
195+
const DRAFT_ENABLED_VARIABLE = window._env_?.REACT_APP_DRAFT_ENABLED ||false;
199196
export const DRAFT_ENABLED =
200197
DRAFT_ENABLED_VARIABLE === "true" || DRAFT_ENABLED_VARIABLE === true
201198
? true
202199
: false;
203200

204201
// This is to check if the application is running in enterprise mode or not
205-
export const IS_ENTERPRISE =
206-
(window._env_ && window._env_.REACT_APP_IS_ENTERPRISE) || false;
202+
export const IS_ENTERPRISE = window._env_?.REACT_APP_IS_ENTERPRISE || false;
203+
204+
205+
export const USER_NAME_DISPLAY_CLAIM =
206+
window._env_?.REACT_APP_USER_NAME_DISPLAY_CLAIM;

forms-flow-nav/src/sidenav/Sidebar.jsx

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import "./Sidebar.scss";
22
import Accordion from "react-bootstrap/Accordion";
3-
import React, { useEffect, useState } from "react";
3+
import React, { useEffect, useMemo, useState } from "react";
44
import { useHistory ,useLocation } from "react-router-dom";
55
import { useTranslation } from "react-i18next";
66
import {
@@ -12,7 +12,8 @@ import {
1212
ENABLE_APPLICATIONS_MODULE,
1313
ENABLE_TASKS_MODULE,
1414
ENABLE_INTEGRATION_PREMIUM,
15-
IS_ENTERPRISE
15+
IS_ENTERPRISE,
16+
USER_NAME_DISPLAY_CLAIM
1617
} from "../constants/constants";
1718
import { StorageService, StyleServices } from "@formsflow/service";
1819
import i18n from "../resourceBundles/i18n";
@@ -81,7 +82,6 @@ const Sidebar = React.memo(({ props, sidenavHeight="100%" }) => {
8182
const tenantKey = tenant?.tenantId;
8283
const formTenant = form?.tenantKey;
8384
const [showProfile, setShowProfile] = useState(false);
84-
const hideLogo = StyleServices?.getCSSVariable("--hide-formsflow-logo")?.toLowerCase();
8585
const { t } = useTranslation();
8686
const currentLocation = useLocation();
8787

@@ -127,6 +127,7 @@ const Sidebar = React.memo(({ props, sidenavHeight="100%" }) => {
127127
const isAuthenticated = instance?.isAuthenticated();
128128
const showApplications = setShowApplications(userDetail?.groups);
129129
const [activeKey,setActiveKey] = useState(0);
130+
const hideLogo = StyleServices?.getCSSVariable("--hide-formsflow-logo")?.toLowerCase();
130131

131132
const getInitials = (name) => {
132133
if (!name) return "";
@@ -135,7 +136,16 @@ const Sidebar = React.memo(({ props, sidenavHeight="100%" }) => {
135136
return initials.substring(0, 2).toUpperCase(); // Get the first two initials
136137
};
137138

138-
const userName = userDetail?.name || userDetail?.preferred_username || "";
139+
140+
// fetch the username form the user details
141+
const userName = useMemo(()=>{
142+
const value = userDetail[USER_NAME_DISPLAY_CLAIM] || userDetail?.name || userDetail?.preferred_username || "";
143+
if(Array.isArray(value)){
144+
return value.length > 0 ? value[0] : "";
145+
}
146+
return value;
147+
},[userDetail]);
148+
139149
const initials = getInitials(userName);
140150

141151
React.useEffect(() => {

forms-flow-service/src/keycloak/KeycloakService.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ class KeycloakService {
167167
});
168168
this.refreshToken();
169169
}
170+
170171
} else {
171172
this.logout();
172173
}

forms-flow-service/src/request/requestService.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ class RequestService {
2121

2222
instance.interceptors.response.use(
2323
(response: AxiosResponse) => {
24-
console.log(response);
2524
return response;
2625
},
2726
async (error: AxiosError) => {

forms-flow-theme/scss/_forms.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,8 @@ select option:hover {
447447
}
448448
}
449449

450+
451+
450452
.valiation-astrisk {
451453
color: $primary;
452454
}
@@ -750,4 +752,4 @@ span.text-danger,
750752
display: flex;
751753
align-items: center;
752754
}
753-
}
755+
}

0 commit comments

Comments
 (0)