Skip to content

Commit

Permalink
fix(orga): fix some styles + orga spaces import
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasRichel committed Oct 29, 2021
1 parent b05ffcf commit 452e1e1
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
}

.list-container {
flex-grow: 1;
display: flex;
flex-direction: column;
padding-bottom: calc(var(--spacing-unit) / 2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,20 @@

<template v-else>
<div class="organization-spaces-import__content">
<BIMDataButton
color="primary"
fill
radius
:disabled="selection.size < 1"
@click="submit"
>
{{ $t("OrganizationSpacesImport.submitButtonText") }}
</BIMDataButton>

<div class="list-title">
{{ $t("OrganizationSpacesImport.spaceListTitle") }}
</div>

<div class="list-container">
<div class="list-item" v-for="space of spaces" :key="space.id">
<BIMDataCheckbox
Expand Down Expand Up @@ -37,17 +48,6 @@
<div class="list-placeholder" v-if="spaces.length === 0">
{{ $t("OrganizationSpacesImport.spaceListPlaceholder") }}
</div>

<BIMDataButton
v-else
color="primary"
fill
radius
:disabled="selection.size < 1"
@click="submit"
>
{{ $t("OrganizationSpacesImport.submitButtonText") }}
</BIMDataButton>
</div>
</template>
</transition>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
}

&__container {
flex-grow: 1;
display: flex;
flex-direction: column;
padding-bottom: calc(var(--spacing-unit) / 2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
}

.list-container {
flex-grow: 1;
display: flex;
flex-direction: column;
padding-bottom: calc(var(--spacing-unit) / 2);
Expand Down
9 changes: 7 additions & 2 deletions src/state/organizations.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const state = reactive({

const resetState = () => {
state.userOrganizations = [];
state.organizationSpaces = {};
state.organizationsSpaces = {};
};

const retrieveUserOrganizations = async () => {
Expand Down Expand Up @@ -60,7 +60,12 @@ const importOrganizationSpaces = async (organization, spaces) => {
OrganizationService.updateSpaceOrganization(space, organization)
)
);
await retrieveOrganizationSpaces(organization);
const updatedOrganizations = [organization].concat(
spaces.map(space => space.organization)
);
await Promise.all(
updatedOrganizations.map(orga => retrieveOrganizationSpaces(orga))
);
return importedSpaces;
};

Expand Down

0 comments on commit 452e1e1

Please sign in to comment.