Skip to content

Commit a2f9e24

Browse files
authored
Merge branch 'develop' into implement/refreshToken
2 parents b21a8fd + e12e7e6 commit a2f9e24

File tree

16 files changed

+124
-69
lines changed

16 files changed

+124
-69
lines changed

src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
<i class="fas fa-book-open nav-icon" style="height: 18px; font-size: 18px; width: 18px;"></i>
119119
</b-nav-item>
120120

121-
<b-nav-item-dropdown right v-if="getIsLoggedOut" title="Profile">
121+
<b-nav-item-dropdown right v-if="getIsLoggedOut" title="Profile" menu-class="dropDownPopup">
122122
<template #button-content>
123123
<img
124124
v-if="userDetails?.profileIcon"

src/assets/css/gblStyle.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ a {
131131
top: 0;
132132
}
133133

134-
.sericeCard{
134+
.serviceCard{
135135
border-radius: 8px;
136136
box-shadow: 0 0 2rem 0 rgba(136, 152, 170, .15);
137137
position: relative;
@@ -147,4 +147,10 @@ a {
147147
background-clip: border-box;
148148
border: 1px solid rgba(0, 0, 0, .125);
149149
}
150+
151+
.dropDownPopup {
152+
box-shadow: var(--dropdown-menu-elevation, 0 1px 10px 0 rgba(0, 0, 0, .25));
153+
border-radius: 8px;
154+
border: 0px solid grey;
155+
}
150156

src/components/login/mfa/SetupMfa.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<load-ing :active.sync="isLoading" :can-cancel="true" :is-full-page="true"></load-ing>
55

66
<h4>Setup Authenticator as a MFA method</h4>
7-
<div style="width: 50%;" class="sericeCard">
7+
<div style="width: 50%;" class="serviceCard">
88
<ul >
99
<li style="padding: 15px;">
1010
<div>

src/components/teams/AdminTeams.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<div class="d-flex align-items-center">
3737
<b-badge pill variant="warning">{{ role.permissions.length }}
3838
permissions</b-badge>
39-
<b-dropdown size="sm" variant="link" toggle-class="text-decoration-none" no-caret
39+
<b-dropdown size="sm" variant="link" toggle-class="text-decoration-none" menu-class="dropDownPopup"
4040
dropleft>
4141
<template #button-content>
4242
<b-icon style="color:grey" icon="list" aria-hidden="true"></b-icon>

src/components/teams/TeamUser.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<b-badge pill variant="warning" class="mx-1" v-else>
3535
<span class="mx-1" style="color: white">Pending </span></b-badge>
3636

37-
<b-dropdown class="m-2" size="sm" variant="link" toggle-class="text-decoration-none" no-caret dropleft>
37+
<b-dropdown class="m-2" size="sm" variant="link" toggle-class="text-decoration-none" menu-class="dropDownPopup" no-caret dropleft>
3838
<template #button-content>
3939
<b-icon style="color: grey" icon="list" aria-hidden="true"></b-icon>
4040
</template>
@@ -52,9 +52,12 @@
5252
</b-dropdown-group>
5353

5454

55-
<b-dropdown-item-button style="text-align: left" @click="copyToClip(`${$config.app.url}/#/studio/settings?ref=invitions`, 'Invitation Url')"><i
55+
<b-dropdown-item-button v-if="mode !== 'Admin'" style="text-align: left" @click="copyToClip(`${$config.app.url}/#/studio/settings?ref=invitions`, 'Invitation Url')"><i
5656
class="far fa-copy mt-1" aria-hidden="true"></i> Invite Url
5757
</b-dropdown-item-button>
58+
<b-dropdown-item-button v-if="mode == 'Admin'" style="text-align: left" @click="copyToClip(inviteCode, 'Invition Code')"><i
59+
class="far fa-copy mt-1" aria-hidden="true"></i> Invition Code
60+
</b-dropdown-item-button>
5861
<b-dropdown-item-button v-if="deleteMemberMenu" style="text-align: left" @click="deleteAMember()"><i
5962
class="fa fa-trash mt-1"></i> Delete Member</b-dropdown-item-button>
6063
<b-dropdown-item-button v-if="mode == 'Admin'" style="text-align: left" @click="acceptedInvition()"><b-icon

src/mixins/utils.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,12 @@ export default {
129129
return "https://api.dicebear.com/7.x/identicon/svg?seed=" + name;
130130
},
131131
formatTimeRemaining(targetDate) {
132+
if (!targetDate || isNaN(new Date(targetDate).getTime())) {
133+
return 'InActive';
134+
}
132135
const now = new Date(); // Get current date
133136
const expiry = new Date(targetDate); // Convert target date to Date object
134137
const diffInSeconds = Math.floor((expiry - now) / 1000); // Get the difference in seconds
135-
136138
// If the target date is in the past
137139
if (diffInSeconds <= 0) {
138140
return 'Expired';

src/store/mainStore.js

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ const mainStore = {
294294
throw new Error(resp?.message?.join(',') || resp?.message);
295295
} else if ('statusCode' in resp && resp.statusCode !== 200 && resp.statusCode !== 201) {
296296
throw new Error(resp.message)
297+
297298
}
298299

299300
dispatch('getPeopleMembers')
@@ -306,6 +307,7 @@ const mainStore = {
306307
const url = `${apiServerBaseUrl}/people/invite/accept/${payload}`;
307308
const resp = await RequestHandler(url, 'POST', {}, UtilsMixin.methods.getHeader(getters.getAuthToken))
308309

310+
309311
if (!resp || Array.isArray(resp.message)) {
310312
throw new Error(resp?.message?.join(',') || resp?.message);
311313
} else if ('statusCode' in resp && resp.statusCode !== 200 && resp.statusCode !== 201) {
@@ -323,13 +325,15 @@ const mainStore = {
323325
'DELETE',
324326
{
325327
emailId: payload
328+
326329
},
327330
UtilsMixin.methods.getHeader(getters.getAuthToken),
328331
)
329332
if (!resp || Array.isArray(resp.message)) {
330333
throw new Error(resp?.message?.join(',') || resp?.message);
331334
} else if ('statusCode' in resp && resp.statusCode !== 200 && resp.statusCode !== 201) {
332335
throw new Error(resp.message)
336+
333337
}
334338
await dispatch('getPeopleMembers');
335339
return resp;
@@ -338,12 +342,14 @@ const mainStore = {
338342

339343
getPeopleMembers: async ({ getters, commit }) => {
340344
const url = `${apiServerBaseUrl}/people`;
345+
341346
const response = await RequestHandler(url, 'GET', {},
342347
UtilsMixin.methods.getHeader(getters.getAuthToken)
343348
)
344349
if (Array.isArray(response)) {
345350
commit('setAdminMembers', response)
346351
return response;
352+
347353
}
348354
const message = Array.isArray(response?.message)
349355
? response.message.join(', ')
@@ -355,10 +361,12 @@ const mainStore = {
355361

356362
getInvitions: async ({ getters, commit }) => {
357363
const url = `${apiServerBaseUrl}/people/invites`;
364+
358365
const resp = await RequestHandler(url, 'GET', {}, UtilsMixin.methods.getHeader(getters.getAuthToken))
359366
if (Array.isArray(resp)) {
360367
commit('setMyInvitions', resp)
361368
return resp;
369+
362370
}
363371

364372
const message = Array.isArray(resp?.message)
@@ -373,6 +381,7 @@ const mainStore = {
373381
attachMemberToARole: async ({ getters, dispatch }, payload) => {
374382

375383
const url = `${apiServerBaseUrl}/people/roles/attach`;
384+
376385
const resp = await RequestHandler(url,
377386
'POST',
378387
payload,
@@ -384,6 +393,7 @@ const mainStore = {
384393
throw new Error(resp?.message?.join(',') || resp?.message);
385394
} else if ('statusCode' in resp && resp?.statusCode !== 200 && resp?.statusCode !== 201) {
386395
throw new Error(resp.message)
396+
387397
}
388398

389399
dispatch('getPeopleMembers')
@@ -393,6 +403,7 @@ const mainStore = {
393403
switchToAdmin: async ({ getters }, payload) => {
394404

395405
const url = `${apiServerBaseUrl}/people/admin/login`;
406+
396407
const resp = await RequestHandler(url,
397408
'POST',
398409
payload,
@@ -402,6 +413,7 @@ const mainStore = {
402413
throw new Error(resp?.message?.join(',') || resp?.message);
403414
} else if ('statusCode' in resp && (resp.statusCode !== 200 || 201)) {
404415
throw new Error(resp.message)
416+
405417
}
406418
return resp;
407419
},
@@ -410,6 +422,7 @@ const mainStore = {
410422

411423
getMyRolesAction: async ({ getters, commit }) => {
412424
const url = `${apiServerBaseUrl}/roles`;
425+
413426
const resp = await RequestHandler(url,
414427
'GET',
415428
{},
@@ -418,6 +431,7 @@ const mainStore = {
418431
if (Array.isArray(resp)) {
419432
commit('setAllRoles', resp)
420433
return resp;
434+
421435
}
422436
const message = Array.isArray(resp?.message)
423437
? resp.message.join(', ')
@@ -431,6 +445,7 @@ const mainStore = {
431445
createARole: async ({ getters, dispatch }, payload) => {
432446

433447
const url = `${apiServerBaseUrl}/roles`;
448+
]
434449
const resp = await RequestHandler(url,
435450
'POST',
436451
payload,
@@ -441,6 +456,7 @@ const mainStore = {
441456
throw new Error(resp?.message?.join(',') || resp?.message);
442457
} else if ('statusCode' in resp && resp.statusCode !== 200 && resp.statusCode !== 201) {
443458
throw new Error(resp.message)
459+
444460
}
445461

446462
dispatch('getMyRolesAction')
@@ -459,6 +475,7 @@ const mainStore = {
459475
throw new Error(resp?.message?.join(',') || resp?.message);
460476
} else if ('statusCode' in resp && resp.statusCode !== 200 && resp.statusCode !== 201) {
461477
throw new Error(resp.message)
478+
]
462479
}
463480

464481
dispatch('getMyRolesAction')
@@ -468,11 +485,13 @@ const mainStore = {
468485

469486
updateARole: async ({ getters, dispatch }, payload) => {
470487
const url = `${apiServerBaseUrl}/roles/${payload._id}`;
488+
]
471489
const resp = await RequestHandler(url, 'PATCH', payload, UtilsMixin.methods.getHeader(getters.getAuthToken))
472490
if (!resp && Array.isArray(resp.message)) {
473491
throw new Error(resp?.message?.join(',') || resp?.message);
474492
} else if ('statusCode' in resp && resp?.statusCode !== 200 && resp?.statusCode !== 201) {
475493
throw new Error(resp.message)
494+
476495
}
477496
dispatch('getMyRolesAction')
478497
return resp;
@@ -539,6 +558,7 @@ const mainStore = {
539558

540559
if (!twoFactorAuthenticationCode) throw new Error('MFA PIN must be provided')
541560
const url = `${apiServerBaseUrl}/auth/mfa/verify`;
561+
542562
const resp = await RequestHandler(url, 'POST', {
543563
authenticatorType,
544564
twoFactorAuthenticationCode
@@ -548,6 +568,7 @@ const mainStore = {
548568

549569
if (!resp || Array.isArray(resp.message)) {
550570
throw new Error(resp.message.join(','));
571+
551572
}
552573

553574
return resp;
@@ -564,7 +585,8 @@ const mainStore = {
564585
fetch(url, {
565586
method: 'POST',
566587
headers,
567-
body: JSON.stringify(payload)
588+
body: JSON.stringify(payload),
589+
credentials: 'include',
568590
})
569591
.then(response => response.json())
570592
.then(json => {
@@ -604,7 +626,8 @@ const mainStore = {
604626
fetch(url, {
605627
method: 'PUT',
606628
headers,
607-
body: JSON.stringify(payload)
629+
body: JSON.stringify(payload),
630+
credentials: 'include',
608631
}).then(response => {
609632
return response.json()
610633
}).then(json => {
@@ -634,6 +657,7 @@ const mainStore = {
634657
fetch(url, {
635658
method: 'DELETE',
636659
headers,
660+
credentials: 'include',
637661
}).then(response => response.json()).then(json => {
638662
if (json.error) {
639663
return reject(new Error(json.message.join(' ')))
@@ -694,6 +718,7 @@ const mainStore = {
694718
throw new Error(`Could not fetch accesstoken for service ${serviceId}`)
695719
}
696720

721+
697722
} catch (e) {
698723
throw new Error(`Error while updating an app: ${e.message}`);
699724
}
@@ -728,6 +753,7 @@ const mainStore = {
728753
fetch(url, {
729754
method: 'POST',
730755
headers,
756+
credentials: 'include',
731757
})
732758
.then(response => response.json())
733759
.then(json => {
@@ -792,7 +818,7 @@ const mainStore = {
792818
headers
793819
}).then(response => response.json()).then(json => {
794820
if (json.error) {
795-
return reject(new Error(json.error.join(' ')))
821+
return reject(new Error(json.error?.details.join(' ') || json.error.join(' ')))
796822
}
797823
commit('insertSessions', json.data.sessionDetails);
798824
resolve()
@@ -843,7 +869,7 @@ const mainStore = {
843869
body: JSON.stringify(payload),
844870
}).then(response => response.json()).then(json => {
845871
if (json.error) {
846-
return reject(new Error(json.error.join(' ')))
872+
return reject(new Error(json.error?.details.join(' ') || json.error.join(' ')))
847873
}
848874
commit('setOnChainConfig', json.data);
849875
resolve(json.data)
@@ -868,7 +894,7 @@ const mainStore = {
868894
body: JSON.stringify(payload),
869895
}).then(response => response.json()).then(json => {
870896
if (json.error) {
871-
return reject(new Error(json.error.join(' ')))
897+
return reject(new Error(json.error?.details.join(' ') || json.error.join(' ')))
872898
}
873899
// restting
874900
commit('setOnChainConfig', {});
@@ -893,7 +919,7 @@ const mainStore = {
893919
headers,
894920
}).then(response => response.json()).then(json => {
895921
if (json.error) {
896-
return reject(new Error(json.error.details.join(' ')))
922+
return reject(new Error(json.error?.details.join(' ') || json.error.join(' ')))
897923
}
898924
dispatch('fetchAppsOnChainConfigs')
899925
resolve(json)
@@ -923,7 +949,7 @@ const mainStore = {
923949
body: JSON.stringify(data),
924950
}).then(response => response.json()).then(json => {
925951
if (json.error) {
926-
return reject(new Error(json.error.join(' ')))
952+
return reject(new Error(json.error?.details.join(' ') || json.error.join(' ')))
927953
}
928954
commit('setWidgetConfig', json.data);
929955
resolve(json.data)
@@ -948,7 +974,7 @@ const mainStore = {
948974
}).then(response => response.json()).then(json => {
949975
if (json) {
950976
if (json.error) {
951-
return reject(new Error(json.error.join(' ')))
977+
return reject(new Error(json.error?.details.join(' ') || json.error.join(' ')))
952978
} else {
953979
commit('setWidgetConfig', json.data);
954980
return resolve()
@@ -980,7 +1006,7 @@ const mainStore = {
9801006
body: JSON.stringify(data),
9811007
}).then(response => response.json()).then(json => {
9821008
if (json.error) {
983-
return reject(new Error(json.error.join(' ')))
1009+
return reject(new Error(json.error?.details.join(' ') || json.error.join(' ')))
9841010
}
9851011
// restting
9861012
commit('setWidgetConfig', json.data);
@@ -1145,7 +1171,7 @@ const mainStore = {
11451171
headers
11461172
}).then(response => response.json()).then(json => {
11471173
if (json.error) {
1148-
return reject(new Error(json.error.join(' ')))
1174+
return reject(new Error(json.error?.details.join(' ') || json.error.join(' ')))
11491175
}
11501176

11511177
if (json.data && Object.keys(json.data)?.length > 0) {

0 commit comments

Comments
 (0)