in django_airavata/apps/workspace/static/django_airavata_workspace/js/web-components/store.js [201:233]
async initializeGroupResourceProfile({ commit, dispatch, getters, state }) {
await dispatch("loadGroupResourceProfiles");
await dispatch("loadWorkspacePreferences");
let result = getters.groupResourceProfileId;
if (
!getters.groupResourceProfileId ||
!getters.findGroupResourceProfile(getters.groupResourceProfileId)
) {
// Figure out a default value for groupResourceProfileId
if (
getters.findGroupResourceProfile(
state.workspacePreferences.most_recent_group_resource_profile_id
)
) {
result =
state.workspacePreferences.most_recent_group_resource_profile_id;
} else if (state.groupResourceProfiles.length > 0) {
result = state.groupResourceProfiles[0].groupResourceProfileId;
} else {
result = null;
}
}
if (state.experiment) {
commit("updateExperimentGroupResourceProfileId", {
groupResourceProfileId: result,
});
} else {
commit("updateGroupResourceProfileId", {
groupResourceProfileId: result,
});
}
},