From 8016599d39f11295e4893a1a247575c22aa219a8 Mon Sep 17 00:00:00 2001 From: Dinuka De Silva Date: Wed, 16 Feb 2022 18:12:52 -0500 Subject: [PATCH 1/2] Remove unnecessary logs --- .../input-select-users-or-groups.vue | 11 -------- src/lib/components/pages/TenantEntities.vue | 3 --- .../components/pages/TenantEntityTypes.vue | 1 - src/lib/components/pages/TenantGroups.vue | 1 - src/lib/components/pages/TenantNewGroup.vue | 1 - src/lib/components/pages/TenantNewRole.vue | 1 - src/lib/components/pages/TenantRoles.vue | 1 - src/lib/components/pages/TenantUser.vue | 2 -- src/lib/components/pages/TenantUsers.vue | 1 - .../custos-service-entities/index.js | 2 -- .../custos-service/custos-service-groups.js | 2 -- .../custos-service/custos-service-identity.js | 1 - .../custos-service/custos-service-sharing.js | 2 -- .../custos-service/custos-service-tenants.js | 2 -- .../custos-service/custos-service-users.js | 3 --- src/lib/store/modules/auth.store.js | 1 - src/lib/store/modules/group.store.js | 1 - src/lib/store/modules/sharing.store.js | 1 - src/lib/store/modules/tenant.store.js | 17 ++---------- src/lib/store/modules/user.store.js | 2 -- src/router.js | 27 ------------------- 21 files changed, 2 insertions(+), 81 deletions(-) diff --git a/src/lib/components/input-fields/input-select-users-or-groups.vue b/src/lib/components/input-fields/input-select-users-or-groups.vue index 4cdc443f..48ccb34f 100644 --- a/src/lib/components/input-fields/input-select-users-or-groups.vue +++ b/src/lib/components/input-fields/input-select-users-or-groups.vue @@ -48,17 +48,6 @@ export default { return _typeheadData; }, - // typeheadDataSerializer() { - // return (obj) => { - // console.log("typeheadDataSerializer", obj) - // if (obj.username) { - // return obj.username; - // } else { - // // return obj.name; - // return `GROUP ${obj.name}`; - // } - // }; - // }, users() { if (this.allowUsers) { return this.$store.getters["user/getUsers"]({ diff --git a/src/lib/components/pages/TenantEntities.vue b/src/lib/components/pages/TenantEntities.vue index b09694f8..687c2f9e 100644 --- a/src/lib/components/pages/TenantEntities.vue +++ b/src/lib/components/pages/TenantEntities.vue @@ -159,7 +159,6 @@ export default { }, computed: { clientId() { - console.log("this.$route.params : ", this.$route.params); return this.$route.params.clientId; }, allEntities() { @@ -197,8 +196,6 @@ export default { } } - console.log("this.entityIds : ", entityIds); - this.entityIds = entityIds; this.entityMap = entityMap; this.entityIndent = entityIndent; diff --git a/src/lib/components/pages/TenantEntityTypes.vue b/src/lib/components/pages/TenantEntityTypes.vue index f1eb6d5b..fb2ae271 100644 --- a/src/lib/components/pages/TenantEntityTypes.vue +++ b/src/lib/components/pages/TenantEntityTypes.vue @@ -62,7 +62,6 @@ export default { }, computed: { clientId() { - console.log("this.$route.params : ", this.$route.params); return this.$route.params.clientId; }, entityTypes() { diff --git a/src/lib/components/pages/TenantGroups.vue b/src/lib/components/pages/TenantGroups.vue index 1d689cd8..19f2494c 100644 --- a/src/lib/components/pages/TenantGroups.vue +++ b/src/lib/components/pages/TenantGroups.vue @@ -74,7 +74,6 @@ export default { }, computed: { clientId() { - console.log("this.$route.params : ", this.$route.params); return this.$route.params.clientId; }, groups() { diff --git a/src/lib/components/pages/TenantNewGroup.vue b/src/lib/components/pages/TenantNewGroup.vue index ed1a2005..b2320e74 100644 --- a/src/lib/components/pages/TenantNewGroup.vue +++ b/src/lib/components/pages/TenantNewGroup.vue @@ -56,7 +56,6 @@ export default { }, computed: { clientId() { - console.log("this.$route.params : ", this.$route.params); return this.$route.params.clientId; }, inputState() { diff --git a/src/lib/components/pages/TenantNewRole.vue b/src/lib/components/pages/TenantNewRole.vue index 0aab7adb..b22c80bd 100644 --- a/src/lib/components/pages/TenantNewRole.vue +++ b/src/lib/components/pages/TenantNewRole.vue @@ -91,7 +91,6 @@ export default { } }, clientId() { - console.log("this.$route.params : ", this.$route.params); return this.$route.params.clientId; }, breadcrumbLinks() { diff --git a/src/lib/components/pages/TenantRoles.vue b/src/lib/components/pages/TenantRoles.vue index f417438e..c1d444c8 100644 --- a/src/lib/components/pages/TenantRoles.vue +++ b/src/lib/components/pages/TenantRoles.vue @@ -74,7 +74,6 @@ export default { }, computed: { clientId() { - console.log("this.$route.params : ", this.$route.params); return this.$route.params.clientId; }, roles() { diff --git a/src/lib/components/pages/TenantUser.vue b/src/lib/components/pages/TenantUser.vue index 3451ab35..a00e1764 100644 --- a/src/lib/components/pages/TenantUser.vue +++ b/src/lib/components/pages/TenantUser.vue @@ -347,7 +347,6 @@ export default { watch: { user() { if (this.user) { - console.log("########## user watch") this.firstName = this.user.firstName; this.lastName = this.user.lastName; this.email = this.user.email; @@ -366,7 +365,6 @@ export default { this.$store.dispatch("tenant/fetchTenantRoles", {clientId: this.clientId, clientLevel: false}); if (this.user) { - console.log("########## user watch") this.firstName = this.user.firstName; this.lastName = this.user.lastName; this.email = this.user.email; diff --git a/src/lib/components/pages/TenantUsers.vue b/src/lib/components/pages/TenantUsers.vue index ac5fca17..40273d45 100644 --- a/src/lib/components/pages/TenantUsers.vue +++ b/src/lib/components/pages/TenantUsers.vue @@ -89,7 +89,6 @@ export default { }, computed: { clientId() { - console.log("this.$route.params : ", this.$route.params); return this.$route.params.clientId; }, tenant() { diff --git a/src/lib/service/custos-service/custos-service-entities/index.js b/src/lib/service/custos-service/custos-service-entities/index.js index a0df7c74..f90dc75f 100644 --- a/src/lib/service/custos-service/custos-service-entities/index.js +++ b/src/lib/service/custos-service/custos-service-entities/index.js @@ -99,9 +99,7 @@ export default class CustosEntities { "client_id": clientId, "owner_id": ownerId } - // ).then(({data: entity_array}) => entity_array); ).then((res) => { - console.log(" $$$$$$$ getEntities ", res); return res.data.entity_array; }); } diff --git a/src/lib/service/custos-service/custos-service-groups.js b/src/lib/service/custos-service/custos-service-groups.js index 37e9bc9e..6940c51d 100644 --- a/src/lib/service/custos-service/custos-service-groups.js +++ b/src/lib/service/custos-service/custos-service-groups.js @@ -97,8 +97,6 @@ export default class CustosGroups { * @return {Promise>} */ getAllGroups({offset = 0, limit = 50, groupId = null, tenantId = null, clientId = null, username} = {}) { - console.log("sfsdfsdf", {offset, limit, groupId, tenantId, clientId}) - if (username) { return this.custosService.axiosInstanceWithTokenAuthorization.get( `${CustosService.ENDPOINTS.GROUPS}/user/group/memberships`, diff --git a/src/lib/service/custos-service/custos-service-identity.js b/src/lib/service/custos-service/custos-service-identity.js index 44a56a1c..f8234b8e 100644 --- a/src/lib/service/custos-service/custos-service-identity.js +++ b/src/lib/service/custos-service/custos-service-identity.js @@ -122,7 +122,6 @@ export default class CustosIdentity { } getClientSecret({clientId}) { - console.log("##### getClientSecret : ", clientId); return this.custosService.axiosInstanceWithTokenAuthorization.get( `${CustosService.ENDPOINTS.IDENTITY}/credentials`, { diff --git a/src/lib/service/custos-service/custos-service-sharing.js b/src/lib/service/custos-service/custos-service-sharing.js index a173a88c..5a8f39b2 100644 --- a/src/lib/service/custos-service/custos-service-sharing.js +++ b/src/lib/service/custos-service/custos-service-sharing.js @@ -95,8 +95,6 @@ export default class CustosSharing { } ).then(({data: {shared_data}}) => shared_data); - console.log(" res : ", res); - return res; } diff --git a/src/lib/service/custos-service/custos-service-tenants.js b/src/lib/service/custos-service/custos-service-tenants.js index 9a870876..b12afa86 100644 --- a/src/lib/service/custos-service/custos-service-tenants.js +++ b/src/lib/service/custos-service/custos-service-tenants.js @@ -16,8 +16,6 @@ export default class CustosTenants { } fetchTenants({limit, offset, status, parentTenantId, parentClientId, parentClientSecret, requesterEmail}) { - console.log("fetchTenants ", {limit, offset, status, parentTenantId, parentClientSecret, requesterEmail}) - let url = `${CustosService.ENDPOINTS.TENANTS}/tenants` const params = { limit: limit, diff --git a/src/lib/service/custos-service/custos-service-users.js b/src/lib/service/custos-service/custos-service-users.js index 27b75809..7d7155c8 100644 --- a/src/lib/service/custos-service/custos-service-users.js +++ b/src/lib/service/custos-service/custos-service-users.js @@ -95,7 +95,6 @@ export default class CustosUsers { * @return {Promise>} */ addUserAttribute({clientId, attributes, usernames}) { - console.log("addUserAttribute : ", {clientId, attributes, usernames}); return this.custosService.axiosInstanceWithTokenAuthorization.post( `${CustosService.ENDPOINTS.USERS}/attributes`, { @@ -134,8 +133,6 @@ export default class CustosUsers { * @return {Promise>} */ async addRolesToUser({clientId, roles, usernames, clientLevel = false}) { - // const axiosInstance = await this.custosService.getAxiosInstanceWithClientAuthorization({clientId}); - console.log(" addRolesToUser ", {clientId, roles, usernames, clientLevel}); const axiosInstance = await this.custosService.axiosInstanceWithTokenAuthorization; return axiosInstance.post( `${CustosService.ENDPOINTS.USERS}/users/roles`, diff --git a/src/lib/store/modules/auth.store.js b/src/lib/store/modules/auth.store.js index 8ccd86e6..f088f8d7 100644 --- a/src/lib/store/modules/auth.store.js +++ b/src/lib/store/modules/auth.store.js @@ -31,7 +31,6 @@ const actions = { url += `&kc_idp_hint=oidc`; } - console.log("CI LOGON : ", url); window.location.href = url; }, async authenticateUsingCode({commit}, {code}) { diff --git a/src/lib/store/modules/group.store.js b/src/lib/store/modules/group.store.js index 18363fed..be78648c 100644 --- a/src/lib/store/modules/group.store.js +++ b/src/lib/store/modules/group.store.js @@ -158,7 +158,6 @@ const getters = { getGroups(state, getters) { return ({offset = 0, limit = 50, groupId = null, tenantId = null, clientId = null, username} = {}) => { const queryString = JSON.stringify({offset, limit, groupId, tenantId, clientId, username}); - console.log("getGroups : ", queryString); if (state.groupListMap[queryString]) { return state.groupListMap[queryString].map(groupId => getters.getGroup({groupId})); } else { diff --git a/src/lib/store/modules/sharing.store.js b/src/lib/store/modules/sharing.store.js index fdb44a02..bd5ab2eb 100644 --- a/src/lib/store/modules/sharing.store.js +++ b/src/lib/store/modules/sharing.store.js @@ -46,7 +46,6 @@ const actions = { }, async fetchEntityTypes({commit}, {clientId}) { const entityTypes = await custosService.sharing.getEntityTypes({clientId}); - console.log("##### fetchEntityTypes : ", entityTypes); const entityTypeIds = entityTypes.map(({id, name, description}) => { commit('SET_ENTITY_TYPE', {clientId, id, name, description}); diff --git a/src/lib/store/modules/tenant.store.js b/src/lib/store/modules/tenant.store.js index e4f8e80e..5f216940 100644 --- a/src/lib/store/modules/tenant.store.js +++ b/src/lib/store/modules/tenant.store.js @@ -17,20 +17,13 @@ const state = getDefaultState(); const actions = { async fetchTenantSecret({commit}, {clientId}) { const clientSecret = await custosService.identity.getClientSecret({clientId}); - console.log("STORE : fetchTenantSecret ", clientSecret); commit('SET_TENANT_SECRET', {clientId, clientSecret}); }, async fetchTenants({commit, rootGetters}, {limit, offset, status, requesterEmail, parentTenantId, parentClientId}) { const params = {limit, offset, status, requesterEmail, parentTenantId, parentClientId}; - - console.log("STORE : fetchTenants ", params); const queryString = JSON.stringify(params); - // const username = rootGetters["auth/currentUsername"]; - // await dispatch("user/fetchUsers", {username}, {root: true}); - // const requesterEmail = rootGetters["user/getUser"]({username}).email; - let {tenant, total_num_of_tenants} = await custosService.tenants.fetchTenants(params); const tenantIds = tenant.map(({tenant_id, tenant_status, client_name, domain, client_id, parent_tenant_id, admin_username, requester_email}) => { let type = "CHILD_TENANT"; @@ -71,12 +64,7 @@ const actions = { async fetchTenant({commit, rootGetters}, {clientId}) { let tenant = await custosService.tenants.fetchTenant({clientId}); - console.log("----- fetchTenant : ", tenant); -// admin_email: "hasithanjo2work@gmail.com" -// admin_first_name: "Hasitha" -// admin_last_name: "Jayasundara" -// admin_password: "" -// admin_username: "hasithanjo2work@gmail.com" + const { admin_username, admin_first_name, admin_last_name, admin_email, tenant_id, tenant_status, client_name, domain, @@ -278,10 +266,9 @@ const getters = { getTenants(state, getters) { return ({limit, offset, status, requesterEmail, parentTenantId, parentClientId}) => { const queryString = JSON.stringify({limit, offset, status, requesterEmail, parentTenantId, parentClientId}); - console.log("###### getTenants : ", queryString) if (state.tenantsListMap[queryString]) { const r = state.tenantsListMap[queryString].map(tenantId => getters.getTenant({tenantId})); - console.log("getTenants ==== ", r) + return r } else { return null; diff --git a/src/lib/store/modules/user.store.js b/src/lib/store/modules/user.store.js index 4c9e7844..7b1b05a5 100644 --- a/src/lib/store/modules/user.store.js +++ b/src/lib/store/modules/user.store.js @@ -177,7 +177,6 @@ const mutations = { const getters = { getUser: (state) => ({clientId, username}) => { if (state.userMap[clientId] && state.userMap[clientId][username]) { - console.log("####### state.userMap[username] : ", state.userMap[clientId][username]) return state.userMap[clientId][username]; } else { return null; @@ -187,7 +186,6 @@ const getters = { return ({username = null, offset = 0, limit = 10, groupId = null, tenantId = null, clientId = null}) => { const params = {username, offset, limit, groupId, tenantId, clientId}; const queryString = JSON.stringify(params); - console.log("######## getUsers ", queryString) if (state.userListMap[clientId] && state.userListMap[clientId][queryString]) { const usernames = state.userListMap[clientId][queryString]; return usernames.map(username => getters.getUser({clientId, username})); diff --git a/src/router.js b/src/router.js index ac57666c..0ff6e49b 100644 --- a/src/router.js +++ b/src/router.js @@ -215,25 +215,11 @@ export default new Router({ ] }) -// async function validate(next) { -// if (await store.getters["auth/authenticated"] === true) { -// // You can use store variable here to access globalError or commit mutation -// console.log("Authenticationed") -// next(true) -// } else { -// console.log("NOT Authenticationed") -// next('/') -// } -// } - async function _validateAuthenticationBeforeEnter(to, from, next) { await store.dispatch('auth/refreshAuthentication'); const authenticated = store.getters['auth/authenticated']; - - console.log("store ", store) if (!authenticated) { - console.log("NOT authenticated"); // next(true); next('/'); } else { @@ -247,19 +233,6 @@ async function _validateAuthenticationBeforeEnter(to, from, next) { await store.dispatch("tenant/fetchTenant", {clientId: custosService.clientId}); } - console.log("YES authenticated " + store.getters["user/getUser"]({username})); next(true); } } - -// async function _validateSuperAdminAuthenticationBeforeEnter(to, from, next) { -// await _validateAuthenticationBeforeEnter(to, from, async (nextArg) => { -// await store.dispatch("tenant/fetchTenant", {clientId: custosService.clientId}); -// const appTenant = store.getters["tenant/getTenant"]({clientId: custosService.clientId}); -// -// // const username = store.getters["auth/currentUsername"]; -// -// console.log("@@@@@@@@ appTenant : ", appTenant); -// next(nextArg); -// }); -// } From 1d417ca17558939bc289e02190e5278189effcec Mon Sep 17 00:00:00 2001 From: Dinuka De Silva Date: Wed, 16 Feb 2022 18:24:53 -0500 Subject: [PATCH 2/2] 0.1.7 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index c53fbc57..a53cb503 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "airavata-custos-portal", - "version": "0.1.6", + "version": "0.1.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 62c315de..f3c94e7a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "airavata-custos-portal", - "version": "0.1.6", + "version": "0.1.7", "private": true, "main": "src/lib/index.js", "scripts": {