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
|
|
@ -17,6 +17,7 @@ const ACTIVITY_TYPES = [
|
|||
'slack_invited',
|
||||
'email_sent',
|
||||
'community_connections_updated',
|
||||
'community_ecology_updated',
|
||||
'connection_requested',
|
||||
'connection_confirmed',
|
||||
'tag_suggested'
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
import mongoose from 'mongoose'
|
||||
|
||||
const connectionSchema = new mongoose.Schema({
|
||||
initiator: { type: mongoose.Schema.Types.ObjectId, ref: 'Member', required: true },
|
||||
recipient: { type: mongoose.Schema.Types.ObjectId, ref: 'Member', required: true },
|
||||
status: { type: String, enum: ['pending', 'confirmed'], default: 'pending' },
|
||||
matchingTags: [
|
||||
{
|
||||
tagSlug: String,
|
||||
initiatorState: { type: String, enum: ['help', 'interested', 'seeking'] },
|
||||
recipientState: { type: String, enum: ['help', 'interested', 'seeking'] },
|
||||
},
|
||||
],
|
||||
hiddenBy: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Member' }],
|
||||
createdAt: { type: Date, default: Date.now },
|
||||
confirmedAt: Date,
|
||||
})
|
||||
|
||||
connectionSchema.index({ initiator: 1, recipient: 1 }, { unique: true })
|
||||
connectionSchema.index({ recipient: 1, status: 1 })
|
||||
|
||||
export default mongoose.models.Connection || mongoose.model('Connection', connectionSchema)
|
||||
|
|
@ -69,29 +69,10 @@ const memberSchema = new mongoose.Schema({
|
|||
website: String,
|
||||
other: String,
|
||||
},
|
||||
offering: {
|
||||
text: String,
|
||||
tags: [String],
|
||||
},
|
||||
lookingFor: {
|
||||
text: String,
|
||||
tags: [String],
|
||||
},
|
||||
showInDirectory: { type: Boolean, default: true },
|
||||
|
||||
// Peer support settings
|
||||
peerSupport: {
|
||||
enabled: { type: Boolean, default: false },
|
||||
skillTopics: [String], // Auto-populated from offering.tags, editable
|
||||
supportTopics: [String], // Curated conversational/emotional support topics
|
||||
availability: String,
|
||||
personalMessage: String,
|
||||
slackUsername: String,
|
||||
slackDMChannelId: String, // DM channel ID for direct messaging
|
||||
},
|
||||
|
||||
craftTags: [String],
|
||||
communityConnections: {
|
||||
communityEcology: {
|
||||
topics: [
|
||||
{
|
||||
tagSlug: String,
|
||||
|
|
@ -142,22 +123,12 @@ const memberSchema = new mongoose.Schema({
|
|||
enum: ["public", "members", "private"],
|
||||
default: "members",
|
||||
},
|
||||
offering: {
|
||||
type: String,
|
||||
enum: ["public", "members", "private"],
|
||||
default: "members",
|
||||
},
|
||||
lookingFor: {
|
||||
type: String,
|
||||
enum: ["public", "members", "private"],
|
||||
default: "members",
|
||||
},
|
||||
craftTags: {
|
||||
type: String,
|
||||
enum: ["public", "members", "private"],
|
||||
default: "members",
|
||||
},
|
||||
communityConnections: {
|
||||
communityEcology: {
|
||||
type: String,
|
||||
enum: ["public", "members", "private"],
|
||||
default: "members",
|
||||
|
|
@ -167,8 +138,6 @@ const memberSchema = new mongoose.Schema({
|
|||
notifications: {
|
||||
events: { type: Boolean, default: true },
|
||||
updates: { type: Boolean, default: true },
|
||||
peerRequests: { type: Boolean, default: true },
|
||||
connectionRequests: { type: Boolean, default: true },
|
||||
},
|
||||
|
||||
inviteEmailSent: { type: Boolean, default: false },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue