refactor(community): rename Community Connections → Community Ecology
Simplify the feature to pure discovery (filter by topic, see matching members, copy Slack handle). Drop the connection request/confirm flow entirely — Connection model, 7 API endpoints, useConnections composable, and TagInput component deleted. - Rename communityConnections → communityEcology in schema, API, pages - Delete legacy fields: offering, lookingFor, peerSupport - New /ecology page, /api/ecology/suggestions, community-ecology.patch - Nav: "Connections" → "Ecology", remove pending-count badge - Fix auth/member.get.js missing craftTags + communityEcology - Add community_ecology_updated activity log type - Expose slackHandle conditionally when offerPeerSupport is true - Add migration script at scripts/migrate-to-ecology.js (run before deploy)
This commit is contained in:
parent
9577929e0d
commit
0b3896d984
33 changed files with 1002 additions and 2635 deletions
|
|
@ -183,32 +183,30 @@
|
|||
}}
|
||||
</div>
|
||||
|
||||
<!-- Craft tags (fall back to offering.tags) -->
|
||||
<div
|
||||
v-if="getMemberCraftTags(member).length > 0"
|
||||
v-if="member.craftTags?.length > 0"
|
||||
class="mc-tags"
|
||||
>
|
||||
<span class="tag-label">Craft:</span>
|
||||
<span
|
||||
v-for="tag in getMemberCraftTags(member)"
|
||||
v-for="tag in member.craftTags"
|
||||
:key="tag"
|
||||
class="skill-tag"
|
||||
>{{ craftTagLabel(tag) }}</span
|
||||
>
|
||||
</div>
|
||||
|
||||
<!-- Community connections topics (fall back to lookingFor.tags) -->
|
||||
<div
|
||||
v-if="getMemberConnectionTopics(member).length > 0"
|
||||
v-if="member.communityEcology?.topics?.length > 0"
|
||||
class="mc-looking"
|
||||
>
|
||||
<span
|
||||
v-for="topic in getMemberConnectionTopics(member)"
|
||||
:key="topic.tagSlug || topic"
|
||||
v-for="topic in member.communityEcology.topics"
|
||||
:key="topic.tagSlug"
|
||||
class="connection-topic"
|
||||
>
|
||||
<span class="connection-state">{{ stateLabel(topic.state) }}</span>
|
||||
{{ connectionTagLabel(topic.tagSlug || topic) }}
|
||||
{{ connectionTagLabel(topic.tagSlug) }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
|
@ -319,36 +317,8 @@ const connectionTagLabel = (slug) => {
|
|||
return found ? found.label : slug;
|
||||
};
|
||||
|
||||
// Get craft tags for a member (new field, falling back to offering.tags)
|
||||
const getMemberCraftTags = (member) => {
|
||||
if (member.craftTags && member.craftTags.length > 0) {
|
||||
return member.craftTags;
|
||||
}
|
||||
return member.offering?.tags || [];
|
||||
};
|
||||
|
||||
// Get connection topics for a member (new field, falling back to lookingFor.tags)
|
||||
const getMemberConnectionTopics = (member) => {
|
||||
if (
|
||||
member.communityConnections?.topics &&
|
||||
member.communityConnections.topics.length > 0
|
||||
) {
|
||||
return member.communityConnections.topics;
|
||||
}
|
||||
// Fallback: wrap old lookingFor.tags as plain strings
|
||||
if (member.lookingFor?.tags && member.lookingFor.tags.length > 0) {
|
||||
return member.lookingFor.tags.map((tag) => ({ tagSlug: tag, state: null }));
|
||||
}
|
||||
return [];
|
||||
};
|
||||
|
||||
// Show peer support link (check both old and new fields)
|
||||
const showPeerSupport = (member) => {
|
||||
if (member.communityConnections?.offerPeerSupport) return true;
|
||||
if (member.peerSupport?.enabled && member.peerSupport?.slackUsername)
|
||||
return true;
|
||||
return false;
|
||||
};
|
||||
const showPeerSupport = (member) =>
|
||||
!!member.communityEcology?.offerPeerSupport;
|
||||
|
||||
// Computed: has active filters
|
||||
const hasActiveFilters = computed(() => {
|
||||
|
|
@ -486,10 +456,7 @@ const clearAllFilters = () => {
|
|||
|
||||
// Slack DM functionality
|
||||
const openSlackDM = async (member) => {
|
||||
const username =
|
||||
member.communityConnections?.slackHandle ||
|
||||
member.peerSupport?.slackUsername ||
|
||||
member.name;
|
||||
const username = member.communityEcology?.slackHandle || member.name;
|
||||
|
||||
try {
|
||||
await navigator.clipboard.writeText(username);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue