Skip to content

Commit

Permalink
Merge pull request #143 from dinukadesilva/02-16-2022-remove-unnecess…
Browse files Browse the repository at this point in the history
…ary-logs

Remove unnecessary logs
  • Loading branch information
isururanawaka authored Feb 16, 2022
2 parents cd72607 + 1d417ca commit d4da721
Show file tree
Hide file tree
Showing 23 changed files with 4 additions and 83 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "airavata-custos-portal",
"version": "0.1.6",
"version": "0.1.7",
"private": true,
"main": "src/lib/index.js",
"scripts": {
Expand Down
11 changes: 0 additions & 11 deletions src/lib/components/input-fields/input-select-users-or-groups.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<small>GROUP </small> ${obj.name}`;
// }
// };
// },
users() {
if (this.allowUsers) {
return this.$store.getters["user/getUsers"]({
Expand Down
3 changes: 0 additions & 3 deletions src/lib/components/pages/TenantEntities.vue
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ export default {
},
computed: {
clientId() {
console.log("this.$route.params : ", this.$route.params);
return this.$route.params.clientId;
},
allEntities() {
Expand Down Expand Up @@ -197,8 +196,6 @@ export default {
}
}
console.log("this.entityIds : ", entityIds);
this.entityIds = entityIds;
this.entityMap = entityMap;
this.entityIndent = entityIndent;
Expand Down
1 change: 0 additions & 1 deletion src/lib/components/pages/TenantEntityTypes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export default {
},
computed: {
clientId() {
console.log("this.$route.params : ", this.$route.params);
return this.$route.params.clientId;
},
entityTypes() {
Expand Down
1 change: 0 additions & 1 deletion src/lib/components/pages/TenantGroups.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ export default {
},
computed: {
clientId() {
console.log("this.$route.params : ", this.$route.params);
return this.$route.params.clientId;
},
groups() {
Expand Down
1 change: 0 additions & 1 deletion src/lib/components/pages/TenantNewGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export default {
},
computed: {
clientId() {
console.log("this.$route.params : ", this.$route.params);
return this.$route.params.clientId;
},
inputState() {
Expand Down
1 change: 0 additions & 1 deletion src/lib/components/pages/TenantNewRole.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ export default {
}
},
clientId() {
console.log("this.$route.params : ", this.$route.params);
return this.$route.params.clientId;
},
breadcrumbLinks() {
Expand Down
1 change: 0 additions & 1 deletion src/lib/components/pages/TenantRoles.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ export default {
},
computed: {
clientId() {
console.log("this.$route.params : ", this.$route.params);
return this.$route.params.clientId;
},
roles() {
Expand Down
2 changes: 0 additions & 2 deletions src/lib/components/pages/TenantUser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/lib/components/pages/TenantUsers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ export default {
},
computed: {
clientId() {
console.log("this.$route.params : ", this.$route.params);
return this.$route.params.clientId;
},
tenant() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
}
Expand Down
2 changes: 0 additions & 2 deletions src/lib/service/custos-service/custos-service-groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ export default class CustosGroups {
* @return {Promise<AxiosResponse<any>>}
*/
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`,
Expand Down
1 change: 0 additions & 1 deletion src/lib/service/custos-service/custos-service-identity.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ export default class CustosIdentity {
}

getClientSecret({clientId}) {
console.log("##### getClientSecret : ", clientId);
return this.custosService.axiosInstanceWithTokenAuthorization.get(
`${CustosService.ENDPOINTS.IDENTITY}/credentials`,
{
Expand Down
2 changes: 0 additions & 2 deletions src/lib/service/custos-service/custos-service-sharing.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ export default class CustosSharing {
}
).then(({data: {shared_data}}) => shared_data);

console.log(" res : ", res);

return res;
}

Expand Down
2 changes: 0 additions & 2 deletions src/lib/service/custos-service/custos-service-tenants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 0 additions & 3 deletions src/lib/service/custos-service/custos-service-users.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ export default class CustosUsers {
* @return {Promise<AxiosResponse<any>>}
*/
addUserAttribute({clientId, attributes, usernames}) {
console.log("addUserAttribute : ", {clientId, attributes, usernames});
return this.custosService.axiosInstanceWithTokenAuthorization.post(
`${CustosService.ENDPOINTS.USERS}/attributes`,
{
Expand Down Expand Up @@ -134,8 +133,6 @@ export default class CustosUsers {
* @return {Promise<AxiosResponse<any>>}
*/
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`,
Expand Down
1 change: 0 additions & 1 deletion src/lib/store/modules/auth.store.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const actions = {
url += `&kc_idp_hint=oidc`;
}

console.log("CI LOGON : ", url);
window.location.href = url;
},
async authenticateUsingCode({commit}, {code}) {
Expand Down
1 change: 0 additions & 1 deletion src/lib/store/modules/group.store.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion src/lib/store/modules/sharing.store.js
Original file line number Diff line number Diff line change
Expand Up @@ -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});

Expand Down
17 changes: 2 additions & 15 deletions src/lib/store/modules/tenant.store.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -71,12 +64,7 @@ const actions = {

async fetchTenant({commit, rootGetters}, {clientId}) {
let tenant = await custosService.tenants.fetchTenant({clientId});
console.log("----- fetchTenant : ", tenant);
// admin_email: "[email protected]"
// admin_first_name: "Hasitha"
// admin_last_name: "Jayasundara"
// admin_password: ""
// admin_username: "[email protected]"

const {
admin_username, admin_first_name, admin_last_name, admin_email,
tenant_id, tenant_status, client_name, domain,
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions src/lib/store/modules/user.store.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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}));
Expand Down
27 changes: 0 additions & 27 deletions src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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);
// });
// }

0 comments on commit d4da721

Please sign in to comment.