-
Notifications
You must be signed in to change notification settings - Fork 10
feat: add manager profile pages #618
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
Draft
Seranged
wants to merge
10
commits into
development
Choose a base branch
from
feature/lite-256-dedicated-profile-page-for-curators-risk-managers
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c8b411b
feat: add manager profile pages
Seranged 8ae47ff
fix: make manager links keyboard accessible
Seranged 5a1fb34
fix: use manager label metadata
Seranged 5e0b98f
fix: simplify manager profiles
Seranged 1143381
fix: remove manager links count
Seranged 96fbd76
fix: align manager profile header
Seranged e964bbe
fix: position manager back button
Seranged d4790da
fix: center manager back button
Seranged 9bf6ef3
fix: simplify manager profile summary
Seranged ed47cdb
fix: clarify manager profile links
Seranged File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| <script setup lang="ts"> | ||
| import type { EulerLabelEntity } from '~/entities/euler/labels' | ||
| import { getEulerLabelEntityLogo } from '~/entities/euler/labels' | ||
| import { getEulerLabelEntityDisplayName, getEulerLabelEntitySlug, getManagerProfilePath } from '~/utils/manager-profile' | ||
|
|
||
| const props = withDefaults(defineProps<{ | ||
| entities: EulerLabelEntity[] | ||
| label?: string | ||
| showAvatar?: boolean | ||
| spanLink?: boolean | ||
| textClass?: string | ||
| avatarClass?: string | ||
| dataKey?: string | ||
| dataField?: string | ||
| disabled?: boolean | ||
| }>(), { | ||
| label: '', | ||
| showAvatar: true, | ||
| spanLink: false, | ||
| textClass: 'text-p2 text-content-primary hover:text-accent-600 underline transition-colors', | ||
| avatarClass: 'icon--20', | ||
| dataKey: '', | ||
| dataField: '', | ||
| disabled: false, | ||
| }) | ||
|
|
||
| const { entities: entityMap } = useEulerLabels() | ||
| const route = useRoute() | ||
|
|
||
| const displayName = computed(() => props.label || getEulerLabelEntityDisplayName(props.entities)) | ||
| const entityLogos = computed(() => props.entities.map(entity => getEulerLabelEntityLogo(entity.logo))) | ||
| const primarySlug = computed(() => { | ||
| const first = props.entities[0] | ||
| return first ? getEulerLabelEntitySlug(entityMap, first) : '' | ||
| }) | ||
| const to = computed(() => ({ | ||
| path: getManagerProfilePath(primarySlug.value), | ||
| query: { network: route.query.network }, | ||
| })) | ||
| const isLinked = computed(() => Boolean(primarySlug.value) && props.entities.length === 1 && !props.disabled) | ||
| const fallbackTextClass = computed(() => | ||
| props.textClass.replace('hover:text-accent-600 underline transition-colors', ''), | ||
| ) | ||
|
|
||
| const goToManager = () => { | ||
| if (!isLinked.value) return | ||
| void navigateTo(to.value) | ||
| } | ||
|
|
||
| const onSpanKeydown = (event: KeyboardEvent) => { | ||
| if (event.key !== 'Enter' && event.key !== ' ') return | ||
| event.preventDefault() | ||
| event.stopPropagation() | ||
| goToManager() | ||
| } | ||
| </script> | ||
|
|
||
| <template> | ||
| <span class="inline-flex min-w-0 items-center gap-6"> | ||
| <BaseAvatar | ||
| v-if="showAvatar" | ||
| :class="avatarClass" | ||
| :label="displayName" | ||
| :src="entityLogos" | ||
| /> | ||
| <span | ||
| v-if="spanLink && isLinked" | ||
| role="link" | ||
| tabindex="0" | ||
| :class="textClass" | ||
| :data-id="dataKey && dataField ? 'data-point' : undefined" | ||
| :data-key="dataKey || undefined" | ||
| :data-field="dataField || undefined" | ||
| :data-value="displayName" | ||
| @click.stop.prevent="goToManager" | ||
| @keydown="onSpanKeydown" | ||
| >{{ displayName }}</span> | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| <NuxtLink | ||
| v-else-if="isLinked" | ||
| :to="to" | ||
| :class="textClass" | ||
| :data-id="dataKey && dataField ? 'data-point' : undefined" | ||
| :data-key="dataKey || undefined" | ||
| :data-field="dataField || undefined" | ||
| :data-value="displayName" | ||
| >{{ displayName }}</NuxtLink> | ||
| <span | ||
| v-else | ||
| :class="fallbackTextClass" | ||
| :data-id="dataKey && dataField ? 'data-point' : undefined" | ||
| :data-key="dataKey || undefined" | ||
| :data-field="dataField || undefined" | ||
| :data-value="displayName" | ||
| >{{ displayName }}</span> | ||
| </span> | ||
| </template> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Suggestion:
spanLinkmakes the manager destination mouse-clickable, but it renders as a plain<span>with nohref,role="link",tabindex, or keyboard handler. Most of the new vault-card call sites use this mode to avoid nested anchors, so keyboard and screen-reader users do not get the same navigation affordance as mouse users. Consider making the span mode an accessible link-like control (for examplerole="link",tabindex="0", and Enter/Space handling) or otherwise restructuring the card/link relationship so the shared component stays accessible everywhere.