Skip to content

Commit

Permalink
fix: add a placeholder for empty orga spaces list
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasRichel committed Jan 12, 2022
1 parent a1a4da7 commit 95b50f5
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/generic/carousel-list/CarouselList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default {
slider.value.style.height = `${itemHeight + 2 * sliderPadding}px`;
// Calculate the maximum number of items that can be displayed
// at the same time according to slider width and items height
// at the same time according to slider width and items width
// taking minimum gap into account
const nbDisplayed = Math.floor(contentWidth / (itemWidth + minGap));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,13 @@
overflow-x: hidden;
overflow-y: auto;
}

&__placeholder {
flex-grow: 1;
display: flex;
justify-content: center;
align-items: center;
padding: calc(var(--spacing-unit) * 2);
color: var(--color-granite-light);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<div class="organization-spaces-list__title">
{{ $t("OrganizationSpacesList.spaceListTitle") }}
</div>
<div class="organization-spaces-list__container">
<div class="organization-spaces-list__container" v-if="spaces.length > 0">
<transition-group name="list">
<OrganizationSpaceCard
v-for="space of displayedSpaces"
Expand All @@ -41,6 +41,9 @@
/>
</transition-group>
</div>
<div class="organization-spaces-list__placeholder" v-else>
{{ $t("OrganizationSpacesList.spaceListPlaceholder") }}
</div>
</div>
</template>

Expand All @@ -64,8 +67,12 @@ export default {
const localState = inject("localState");
const spaces = computed(() =>
getOrganizationSpaces(localState.organization)
);
const { filteredList: displayedSpaces, searchText } = useListFilter(
computed(() => getOrganizationSpaces(localState.organization)),
spaces,
space => space.name
);
Expand All @@ -84,6 +91,7 @@ export default {
isSubscriptionEnabled: IS_SUBSCRIPTION_ENABLED,
localState,
searchText,
spaces,
// Methods
goToSubscriptionPro
};
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,8 @@
"importButtonText": "Import space",
"addButtonText": "Add new space",
"searchInputPlaceholder": "Search",
"spaceListTitle": "Account spaces"
"spaceListTitle": "Account spaces",
"spaceListPlaceholder": "No space is attached to this billing account."
},
"ProjectCardLeaveGuard": {
"title": "Leave projet",
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,8 @@
"importButtonText": "Importer un espace",
"addButtonText": "Ajouter un espace",
"searchInputPlaceholder": "Rechercher",
"spaceListTitle": "Liste des espaces rattachés au compte de facturation"
"spaceListTitle": "Liste des espaces rattachés au compte de facturation",
"spaceListPlaceholder": "Aucun espace n'est rattaché à ce compte de facturation."
},

"ProjectCardActionMenu": {
Expand Down

0 comments on commit 95b50f5

Please sign in to comment.