Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

feat(ecosystem): tier filters and new header #3443

Merged
merged 32 commits into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
37d45d6
feat(ecosystem): remove tier tabs
techtolentino Jul 20, 2023
1f4b6cb
feat(ecosystem): add tier filters
techtolentino Jul 20, 2023
88f2146
feat(ecosystem): update page header and add assets
techtolentino Jul 20, 2023
289b768
feat(ecosystem): remove tier tabs
techtolentino Jul 20, 2023
d9eac76
feat(ecosystem): add tier filters
techtolentino Jul 20, 2023
cc7450b
feat(ecosystem): update page header and add assets
techtolentino Jul 20, 2023
dbe9d05
Merge branch 'main' into feat/ecosystem-update-filters-and-page-header
techtolentino Jul 21, 2023
4334f66
Merge branch 'feat/ecosystem-update-filters-and-page-header' of githu…
techtolentino Jul 21, 2023
2c1e53d
feat(ecosystem): abstract reusable layout into component
techtolentino Jul 21, 2023
db16fb9
Merge branch 'main' into feat/ecosystem-update-filters-and-page-header
y4izus Jul 24, 2023
6e12aa9
Merge branch 'main' into feat/ecosystem-update-filters-and-page-header
y4izus Jul 24, 2023
25b64de
Merge branch 'main' into feat/ecosystem-update-filters-and-page-header
techtolentino Jul 24, 2023
0620737
Merge branch 'main' into feat/ecosystem-update-filters-and-page-header
y4izus Jul 25, 2023
5de73ad
Merge branch 'main' into feat/ecosystem-update-filters-and-page-header
techtolentino Jul 26, 2023
c13a3ad
feat(ecosystem): update leadspace card titles
techtolentino Jul 26, 2023
c505567
feat(ecosystem): remove extra paragraph
techtolentino Jul 27, 2023
dd6877c
feat(join-with-cards): relocate component to Ui directory
techtolentino Jul 27, 2023
83cbb3b
feat(ecosystem): update styles, types, and prop
techtolentino Jul 28, 2023
d5335c0
Merge branch 'main' into feat/ecosystem-update-filters-and-page-header
eddybrando Jul 28, 2023
672a12a
Update components/Ui/UiJoinWithCards.vue
techtolentino Jul 28, 2023
781589b
Update pages/ecosystem.vue
techtolentino Jul 28, 2023
17d4752
feat(ecosystem): update link variable in use
techtolentino Jul 28, 2023
6da3ba7
feat(ecosystem): fix merge conflict
techtolentino Jul 28, 2023
afa73a9
Merge branch 'main' into feat/ecosystem-update-filters-and-page-header
eddybrando Jul 31, 2023
1e038dd
feat(ecosystem): update copy
techtolentino Jul 31, 2023
36360dd
Merge branch 'main' into feat/ecosystem-update-filters-and-page-header
techtolentino Jul 31, 2023
b2adfb1
feat(ecosystem): update copy
techtolentino Jul 31, 2023
ca4e00e
Merge branch 'feat/ecosystem-update-filters-and-page-header' of githu…
techtolentino Jul 31, 2023
3c5a319
Merge branch 'main' into feat/ecosystem-update-filters-and-page-header
y4izus Aug 1, 2023
31309bb
Merge branch 'main' into feat/ecosystem-update-filters-and-page-header
techtolentino Aug 1, 2023
a6245ff
Merge branch 'main' into feat/ecosystem-update-filters-and-page-header
eddybrando Aug 1, 2023
bedb0e2
Merge branch 'main' into feat/ecosystem-update-filters-and-page-header
techtolentino Aug 1, 2023
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
86 changes: 86 additions & 0 deletions components/Ecosystem/EcosystemJoin.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<template>
techtolentino marked this conversation as resolved.
Show resolved Hide resolved
<section class="cds--grid">
<div class="cds--row">
<article
class="cds--col-lg-4 cds--col-md-4 ecosystem-join__feature ecosystem-join__intro"
>
<p>
The Ecosystem consists of projects, tools, utilities, libraries and
tutorials from a broad community of developers and researchers. The
goal of the Ecosystem is to celebrate, support and accelerate
development of quantum technologies using Qiskit.
</p>
<UiCta
is-wider
:label="EcosystemJoinLink.label"
:segment="EcosystemJoinLink.segment"
:url="EcosystemJoinLink.url"
/>
</article>
<div
v-for="tier in tiers"
:key="tier.name"
class="cds--col-lg-4 cds--col-md-4 ecosystem-join__feature"
>
<UiCompactFeature
:description="tier.description"
:icon="tier.icon"
:title="tier.name"
/>
</div>
</div>
</section>
</template>

<script setup lang="ts">
import { EcosystemJoinLink } from "~/constants/links";

const tiers = [
{
name: "Main",
description: "The main Qiskit packages maintained by IBM Quantum.",
icon: "quantum.svg",
},
{
name: "Extensions",
description: "IBM Quantum supported Qiskit extensions.",
icon: "transform--02.svg",
},
{
name: "Community",
description:
"Software packages supported by the Qiskit community, not maintained by IBM Quantum.",
icon: "group.svg",
},
];
</script>

<style lang="scss" scoped>
@use "~/assets/scss/carbon.scss";

.ecosystem-join {
&__feature {
@include carbon.breakpoint-down(lg) {
margin-bottom: carbon.$spacing-07;
}

@include carbon.breakpoint-up(md) {
height: 14rem;
}

@include carbon.breakpoint-up(lg) {
height: 16.5rem;
}

@include carbon.breakpoint-up(xlg) {
height: 14rem;
}
}

&__intro {
display: flex;
flex-direction: column;
justify-content: space-between;
}
}
</style>
8 changes: 7 additions & 1 deletion constants/links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,10 @@ const SocialMedia: { [key: string]: TextLink } = {
},
} as const;

export { LearnStartLearningUrl, SocialMedia };
const EcosystemJoinLink: TextLink = {
url: "https://github.com/qiskit-community/ecosystem#ecosystem--",
label: "Join the ecosystem",
segment: { cta: "join-the-ecosystem", location: "ecosystem" },
};

export { LearnStartLearningUrl, SocialMedia, EcosystemJoinLink };
192 changes: 71 additions & 121 deletions pages/ecosystem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,46 +11,24 @@
<br />
Qiskit community
</LayoutLeadSpaceFixed>
<EcosystemJoin />
<section id="ecosystem" class="cds--grid ecosystem-page">
<h2>Ecosystem Resources</h2>
<div class="cds--row">
<p class="cds--col-md-5 cds--col-lg-8 cds--col-xlg-7 cds--col-max-6">
The Ecosystem consists of projects, tools, utilities, libraries and
tutorials from a broad community of developers and researchers. The
goal of the Ecosystem is to celebrate, support and accelerate
development of quantum technologies using Qiskit.
</p>
</div>
<UiCta
class="ecosystem-page__header__cta"
:label="joinAction.label"
:url="joinAction.url"
/>
<div class="ecosystem-page__tiers">
<client-only>
<bx-tabs
class="ecosystem-page__tiers__tabs"
trigger-content="Select an item"
value="Main"
@bx-tabs-selected="updateSelectedTab($event.target.value)"
>
<bx-tab
v-for="tierName in tiersNames"
:id="`tab${tierName}`"
:key="tierName"
:target="`panel${tierName}`"
:value="`${tierName}`"
>
{{ `${tierName} (${filteredMembersByTier[tierName].length})` }}
</bx-tab>
</bx-tabs>
<div class="ecosystem-page__tiers__description">
{{ selectedTierDescription }}
</div>
</client-only>
</div>
<UiFiltersResultsLayout>
<UiFiltersResultsLayout class="ecosystem-page__results">
techtolentino marked this conversation as resolved.
Show resolved Hide resolved
<template #filters-on-m-l-screen>
<UiFieldset class="ecosystem-page__categories" label="Tier">
<client-only>
<bx-checkbox
v-for="tier in tiersNames"
:key="tier"
:checked="isTierFilterChecked(tier)"
:label-text="tier"
:value="tier"
@bx-checkbox-changed="
updateTierFilter(tier, $event.target.checked)
"
/>
</client-only>
</UiFieldset>
<UiFieldset class="ecosystem-page__categories" label="Category">
<client-only>
<bx-checkbox
Expand All @@ -67,6 +45,14 @@
</UiFieldset>
</template>
<template #filters-on-s-screen>
<div class="ecosystem-page__tiers__multiselect">
<UiMultiSelect
label="Tiers"
:options="tiersNames"
:value="tierFiltersAsString"
@change-selection="updateTierFilters($event)"
/>
</div>
<div class="ecosystem-page__categories__multiselect">
<UiMultiSelect
label="Category"
Expand Down Expand Up @@ -97,30 +83,17 @@
</bx-dropdown>
</div>
<div class="ecosystem-page__tier-panel">
<div
v-for="tierName in tiersNames"
:id="`panel${tierName}`"
:key="tierName"
role="tabpanel"
:aria-labelledby="`tab${tierName}`"
>
<template v-if="selectedTab === tierName">
<p
v-if="filteredMembersFromSelectedTier.length === 0"
class="cds--col"
>
Try using wider search criteria, or consider
<UiLink v-bind="joinAction">joining the ecosystem.</UiLink>
</p>
<div v-else class="cds--row ecosystem-page__members">
<EcosystemCard
v-for="member in filteredMembersFromSelectedTierSorted"
:key="member.name"
class="cds--col-sm-4 cds--col-xlg-8"
:member="member"
/>
</div>
</template>
<p v-if="filteredMembersSorted.length === 0" class="cds--col">
Try using wider search criteria, or consider
<UiLink v-bind="EcosystemJoinLink">joining the ecosystem.</UiLink>
</p>
<div v-else class="cds--row ecosystem-page__members">
<EcosystemCard
v-for="member in filteredMembersSorted"
:key="member.name"
class="cds--col-sm-4 cds--col-xlg-8"
:member="member"
/>
</div>
</div>
</template>
Expand All @@ -133,20 +106,11 @@
import rawMembers from "~/content/ecosystem/members.json";
import rawTiers from "~/content/ecosystem/tiers.json";
import { Member, Tier } from "~/types/ecosystem";
import { TextLink } from "~/types/links";

interface MembersByTier {
[key: string]: Member[];
}
import { EcosystemJoinLink } from "~/constants/links";

const members = rawMembers as Member[];
const config = useRuntimeConfig();

const joinAction: TextLink = {
url: "https://github.com/qiskit-community/ecosystem#ecosystem--",
label: "Join the ecosystem",
};

definePageMeta({
layout: "default-max",
pageTitle: "Qiskit Ecosystem",
Expand All @@ -173,19 +137,6 @@ useSeoMeta({
*/
const tiers = rawTiers as Tier[];
const tiersNames = tiers.map((tier) => tier.name);
const selectedTab = ref<string>("Main");

const selectedTier = computed<Tier | undefined>(() => {
return tiers.find((tier) => tier.name === selectedTab.value);
});

const selectedTierDescription = computed<string>(() => {
return selectedTier.value?.description ?? "";
});

function updateSelectedTab(tab: string) {
selectedTab.value = tab;
}

/**
* Category filters
Expand All @@ -197,6 +148,8 @@ const categoryFilterOptionsSorted = [

const categoryFilters = ref<string[]>([]);
const categoryFiltersAsString = computed(() => categoryFilters.value.join(","));
const tierFilters = ref<string[]>([]);
const tierFiltersAsString = computed(() => tierFilters.value.join(","));

function updateCategoryFilter(filterValue: string, isChecked: boolean) {
if (isChecked) {
Expand All @@ -219,6 +172,27 @@ function isCategoryFilterChecked(filterValue: string): boolean {
return categoryFilters.value.includes(filterValue);
}

function updateTierFilter(filterValue: string, isChecked: boolean) {
if (isChecked) {
tierFilters.value.push(filterValue);
} else {
const index = tierFilters.value.indexOf(filterValue);
if (index !== -1) {
tierFilters.value.splice(index, 1);
}
}
}

function updateTierFilters(newTierFilters: string) {
const newTierFiltersAsArray =
newTierFilters === "" ? [] : newTierFilters.split(",");
tierFilters.value = newTierFiltersAsArray;
}

function isTierFilterChecked(filterValue: string): boolean {
return tierFiltersAsString.value.includes(filterValue);
}

/**
* Search term
*/
Expand Down Expand Up @@ -248,6 +222,13 @@ const filteredMembers = computed<Member[]>(() => {

let filteredMembers = members;

// Tier filter
if (tierFilters.value.length > 0) {
y4izus marked this conversation as resolved.
Show resolved Hide resolved
filteredMembers = filteredMembers.filter((member) =>
tierFilters.value.some((filter) => member.tier.includes(filter))
);
}

// Category filter
if (categoryFilters.value.length > 0) {
filteredMembers = filteredMembers.filter((member) =>
Expand All @@ -269,31 +250,12 @@ const filteredMembers = computed<Member[]>(() => {
return filteredMembers;
});

const filteredMembersByTier = computed<MembersByTier>(() => {
const result: MembersByTier = {};

tiersNames.forEach((tierName) => {
result[tierName] = filteredMembers.value.filter(
(member) => member.tier === tierName
);
});

return result;
});

const filteredMembersFromSelectedTier = computed<Member[]>(() => {
return filteredMembersByTier.value[selectedTab.value];
});

const filteredMembersFromSelectedTierSorted = computed<Member[]>(() => {
const filteredMembersSorted = computed<Member[]>(() => {
if (selectedSortingOption.value === "stars") {
return filteredMembersFromSelectedTier.value.sort(
(a, b) => b.stars - a.stars
);
return filteredMembers.value.sort((a, b) => b.stars - a.stars);
}

// The list of members is sorted by name by default.
return filteredMembersFromSelectedTier.value;
return filteredMembers.value.sort((a, b) => a.name.localeCompare(b.name));
});
</script>

Expand All @@ -302,14 +264,6 @@ const filteredMembersFromSelectedTierSorted = computed<Member[]>(() => {
@use "~/assets/scss/helpers/classes.scss";

.ecosystem-page {
&__tiers {
margin-top: carbon.$spacing-10;

&__description {
padding-top: carbon.$spacing-05;
}
}

&__tier-panel {
margin-top: carbon.$spacing-07;
}
Expand All @@ -328,12 +282,8 @@ const filteredMembersFromSelectedTierSorted = computed<Member[]>(() => {
}
}

&__toolbar {
margin-top: carbon.$spacing-06;

@include carbon.breakpoint-down(md) {
margin-top: initial;
}
&__results {
margin-top: carbon.$spacing-07;
}

&__search {
Expand Down
3 changes: 3 additions & 0 deletions public/images/icons/group.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions public/images/icons/quantum.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading