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

feat: add link to label #924

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
ed5fc28
fix: allow voting power indicator to shrink
wa0x6e Oct 19, 2024
8c53c1a
feat: add labels filter to proposals
wa0x6e Oct 18, 2024
55fb47b
Merge branch 'ui-shrink-voting-power-indicator' into feat-filters-pro…
wa0x6e Oct 19, 2024
2fd0d0c
fix: improve filters UI
wa0x6e Oct 19, 2024
b83eb3d
feat: persist proposals filters in query param
wa0x6e Oct 19, 2024
0859c15
fix: allow voting power indicator to shrink
wa0x6e Oct 19, 2024
928e679
Merge branch 'ui-shrink-voting-power-indicator' into feat-filters-pro…
wa0x6e Oct 19, 2024
0f8fa8e
feat: link proposal label to filtered proposals page
wa0x6e Oct 19, 2024
184b1d5
fix: proposal list should react to url change
wa0x6e Oct 19, 2024
e99900c
fix: proposals list should refresh on url labels changer
wa0x6e Oct 19, 2024
9fde2a5
fix: standardize spacing in editor sidebar
wa0x6e Oct 21, 2024
60e6c6a
Merge branch 'standardize-editor-sidebar-spacing' into refactor-propo…
wa0x6e Oct 21, 2024
c5523fc
refactor: refactor proposals labels component
wa0x6e Oct 21, 2024
240f846
Merge branch 'master' into standardize-editor-sidebar-spacing
wa0x6e Oct 21, 2024
1fe593e
Merge branch 'standardize-editor-sidebar-spacing' into refactor-propo…
wa0x6e Oct 21, 2024
4b2e2a8
Merge branch 'master' into feat-filters-proposals-by-label
wa0x6e Oct 21, 2024
7b73a4f
Merge branch 'refactor-proposal-labels-components' into feat-filters-…
wa0x6e Oct 21, 2024
89e2f33
Merge branch 'feat-filters-proposals-by-label' of https://github.com/…
wa0x6e Oct 21, 2024
7096eb4
Merge branch 'refactor-proposal-labels-components' into feat-filters-…
wa0x6e Oct 21, 2024
7d20268
Merge branch 'master' into refactor-proposal-labels-components
wa0x6e Oct 21, 2024
d1913ad
Merge branch 'refactor-proposal-labels-components' into feat-filters-…
wa0x6e Oct 21, 2024
8b222fb
feat: persist state filter in url
wa0x6e Oct 21, 2024
567adb2
Merge branch 'master' into persist-state-filter-in-url
wa0x6e Oct 21, 2024
6dbc1b9
fix: reduce label height to keep same line height as proposal title
wa0x6e Oct 21, 2024
9ada0de
fix: use line height to control label height
wa0x6e Oct 21, 2024
af9e21b
Merge branch 'master' into refactor-proposal-labels-components
wa0x6e Oct 21, 2024
e059c86
Merge branch 'master' into feat-filters-proposals-by-label
wa0x6e Oct 21, 2024
bedf9d6
Merge branch 'refactor-proposal-labels-components' into feat-filters-…
wa0x6e Oct 21, 2024
62e0d65
revert: revert changes
wa0x6e Oct 21, 2024
2419ef7
Merge branch 'persist-state-filter-in-url' into feat-filters-proposal…
wa0x6e Oct 21, 2024
b56d40d
fix: decrease spacing
wa0x6e Oct 21, 2024
21c09ed
fix: remove duplicate watcher
wa0x6e Oct 21, 2024
a7167d6
fix: improve responsive layout
wa0x6e Oct 22, 2024
af07dfc
fix: ignore invalid label id from query param
wa0x6e Oct 22, 2024
1e24af3
fix: enable outline on labels filter button
wa0x6e Oct 22, 2024
36eb0b4
fix: fix left margin on combobox
wa0x6e Oct 22, 2024
98a7b2c
Merge branch 'master' into feat-filters-proposals-by-label
wa0x6e Oct 22, 2024
b700825
perf: improve labels validation
wa0x6e Oct 22, 2024
ceeeab2
fix: prevent event bubbling
wa0x6e Oct 22, 2024
39903ff
fix: fix combobox min width on small screen
wa0x6e Oct 22, 2024
bde0c83
feat: add link to label
wa0x6e Oct 22, 2024
e269e4f
fix: fix spacing
wa0x6e Oct 22, 2024
d549f68
Merge branch 'master' into feat-filters-proposals-by-label
ChaituVR Oct 23, 2024
51291a9
Merge branch 'feat-filters-proposals-by-label' into feat-add-link-to-…
ChaituVR Oct 23, 2024
9f3a31d
Merge branch 'master' into feat-add-link-to-labels
wa0x6e Nov 3, 2024
af1c22b
fix: use simple notation for doublons query params
wa0x6e Nov 3, 2024
f32d009
refactor: move the optional to check to AppLink
wa0x6e Nov 3, 2024
703fefc
Merge branch 'master' into feat-add-link-to-labels
wa0x6e Nov 3, 2024
1d8986c
Merge branch 'master' into feat-add-link-to-labels
ChaituVR Nov 4, 2024
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: 7 additions & 2 deletions apps/ui/src/components/AppLink.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<script lang="ts" setup>
import { RouteLocationRaw, RouterLinkProps } from 'vue-router';

const props = defineProps<RouterLinkProps>();
const props = defineProps<
Omit<RouterLinkProps, 'to'> & { to?: RouteLocationRaw }
>();

const { isWhiteLabel } = useWhiteLabel();

Expand Down Expand Up @@ -32,7 +34,10 @@ function normalize(to: RouteLocationRaw) {
</script>

<template>
<router-link :to="normalize(props.to)">
<router-link v-if="props.to" :to="normalize(props.to)">
<slot />
</router-link>
<div v-else>
<slot />
</div>
</template>
27 changes: 25 additions & 2 deletions apps/ui/src/components/ProposalLabels.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ const props = withDefaults(
space: Space;
labels: string[];
inline?: boolean;
withLink?: boolean;
}>(),
{
inline: false
inline: false,
withLink: false
}
);

Expand All @@ -27,6 +29,15 @@ const validLabels = computed(() => {
:key="label.id"
:label="label.name"
:color="label.color"
:to="
withLink
? {
name: 'space-proposals',
params: { space: `${space.network}:${space.id}` },
query: { labels: label.id }
}
: undefined
"
v-bind="$attrs"
class="inline-flex !max-w-[160px] mr-1 last:mr-0"
/>
Expand All @@ -38,7 +49,19 @@ const validLabels = computed(() => {
>
<li v-for="label in validLabels" :key="label.id">
<UiTooltip :title="label.description" class="inline">
<UiProposalLabel :label="label.name" :color="label.color" />
<UiProposalLabel
:label="label.name"
:color="label.color"
:to="
withLink
? {
name: 'space-proposals',
params: { space: `${space.network}:${space.id}` },
query: { labels: label.id }
}
: undefined
"
/>
</UiTooltip>
</li>
</ul>
Expand Down
10 changes: 5 additions & 5 deletions apps/ui/src/components/ProposalsListItemHeading.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ const space = computed(() =>
>
<ProposalIconStatus size="17" :state="proposal.state" class="top-1.5" />
</AppLink>

<div class="min-w-0 my-1 items-center leading-6">
<div class="min-w-0 my-1 items-center leading-6 space-x-2">
<AppLink
v-if="showSpace"
:to="{
Expand All @@ -53,11 +52,10 @@ const space = computed(() =>
space: `${proposal.network}:${proposal.space.id}`
}
}"
class="text-[21px] text-skin-text mr-2 font-bold inline shrink-0"
class="text-[21px] text-skin-text font-bold inline shrink-0"
>
{{ proposal.space.name }}
</AppLink>

<AppLink
:to="{
name: 'space-proposal-overview',
Expand All @@ -66,16 +64,18 @@ const space = computed(() =>
space: `${proposal.network}:${proposal.space.id}`
}
}"
class="space-x-2"
>
<h3
class="text-[21px] inline [overflow-wrap:anywhere] mr-2 min-w-0"
class="text-[21px] inline [overflow-wrap:anywhere] min-w-0"
v-text="proposal.title || `Proposal #${proposal.proposal_id}`"
/>
<ProposalLabels
v-if="space?.labels && proposal.labels.length"
:labels="proposal.labels"
:space="space"
inline
with-link
/>
<IH-check
v-if="
Expand Down
8 changes: 6 additions & 2 deletions apps/ui/src/components/Ui/ProposalLabel.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<script setup lang="ts">
import { RouteLocationNamedRaw } from 'vue-router';

const props = defineProps<{
label: string;
color: string;
to?: RouteLocationNamedRaw;
}>();

const { currentMode } = useUserSkin();
Expand Down Expand Up @@ -46,7 +49,8 @@ function checkColorProximity(color: string): {
</script>

<template>
<div
<AppLink
:to="to"
class="rounded-full w-fit max-w-[220px] shrink-0 flex"
:class="{
border: colorProperties.showBorder
Expand All @@ -60,5 +64,5 @@ function checkColorProximity(color: string): {
class="truncate text-sm leading-[11px] whitespace-nowrap px-2 py-[6px]"
v-text="label"
/>
</div>
</AppLink>
</template>
6 changes: 5 additions & 1 deletion apps/ui/src/views/Proposal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,11 @@ watchEffect(() => {
<IH-tag />
Labels
</h4>
<ProposalLabels :labels="proposal.labels" :space="space" />
<ProposalLabels
:labels="proposal.labels"
:space="space"
with-link
/>
</div>
<div>
<h4 class="mb-2.5 eyebrow flex items-center gap-2">
Expand Down
Loading