Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefill *Team* input in *Create Project* dialog based on user's team membership #1089

Merged
merged 2 commits into from
Nov 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/views/portfolio/projects/ProjectCreateProjectModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ import { Switch as cSwitch } from '@coreui/vue';
import permissionsMixin from '../../../mixins/permissionsMixin';
import Multiselect from 'vue-multiselect';
import BInputGroupFormSwitch from '@/forms/BInputGroupFormSwitch.vue';
import common from '../../../shared/common';

export default {
name: 'ProjectCreateProjectModal',
Expand Down Expand Up @@ -312,20 +313,20 @@ export default {
async getACLEnabled() {
let url = `${this.$api.BASE_URL}/${this.$api.URL_CONFIG_PROPERTY}/public/access-management/acl.enabled`;
let response = await this.axios.get(url);
this.requiresTeam = response.data.propertyValue.toString();
this.requiresTeam = common.toBoolean(
response.data.propertyValue.toString(),
);
},
async getAvailableTeams() {
let url = `${this.$api.BASE_URL}/${this.$api.URL_TEAM}/visible`;
let response = await this.axios.get(url);
console.log(response.data);
let convertedTeams = response.data.map((team) => {
console.log(team.uuid);
return { text: team.name, value: team.uuid };
});
this.availableTeams = convertedTeams;
this.teams = response.data;
if (this.requiresTeam && this.availableTeams.length == 1) {
this.project.team = teams[0][0].value;
this.project.team = this.availableTeams[0].value;
this.isDisabled = true;
}
this.availableTeams.sort(function (a, b) {
Expand Down
Loading