refactor: update app.vue and various components to improve routing paths, enhance UI consistency, and streamline layout for better user experience

This commit is contained in:
Jennie Robinson Faber 2025-09-11 11:51:48 +01:00
parent b6e8d3b7ec
commit 78af43770c
29 changed files with 1699 additions and 1990 deletions

View file

@ -958,475 +958,13 @@ const formatMembershipAgreementAsMarkdown = (data: any): string => {
// Conflict Resolution Framework formatting - Complete document with all static and dynamic content
const formatConflictResolutionAsText = (data: any): string => {
const formData = data.formData || {};
const cooperativeName = formData.orgName || "[Cooperative Name]";
let content = `${cooperativeName.toUpperCase()} CONFLICT RESOLUTION POLICY\n${"=".repeat(
cooperativeName.length + 30
)}\n\n`;
content += `Framework Created: ${
formData.createdDate || new Date().toISOString().split("T")[0]
}\n`;
if (formData.reviewDate) {
content += `Next Review: ${formData.reviewDate}\n`;
}
content += `\n`;
// Core Values section (if enabled)
if (data.sectionsEnabled?.values !== false) {
content += `OUR VALUES\n----------\n\n`;
content += `This conflict resolution framework is guided by our core values:\n\n`;
if (formData.coreValuesList && formData.coreValuesList.length > 0) {
formData.coreValuesList.forEach((value: string) => {
content += `${value}\n`;
});
content += `\n`;
}
if (formData.customValues) {
content += `${formData.customValues}\n\n`;
}
}
// Resolution Philosophy
const approachDescriptions: { [key: string]: string } = {
restorative:
"We use a restorative/loving justice approach that focuses on healing, understanding root causes, and repairing relationships rather than punishment.",
mediation:
"We use a mediation-first approach where neutral third-party facilitators help parties dialogue and find solutions.",
progressive:
"We use progressive discipline with clear escalation steps and defined consequences for violations.",
hybrid:
"We use a hybrid approach that combines multiple methods based on the type and severity of conflict.",
};
if (formData.approach && approachDescriptions[formData.approach]) {
content += `OUR APPROACH\n------------\n\n`;
content += `${approachDescriptions[formData.approach]}\n\n`;
content += `We do our best to resolve conflicts at the lowest possible escalation step (direct resolution), but agree to escalate conflicts (to assisted resolution) if they are not resolved.\n\n`;
}
// Reflection Process (if enabled)
if (data.sectionsEnabled?.reflection !== false) {
content += `REFLECTION\n----------\n\n`;
content += `Before engaging in direct resolution, we encourage taking time for reflection:\n\n`;
content += `1. Set aside time to think through what happened. What was the other person's behaviour? How did it affect you? Distinguish other people's actions from your feelings about them.\n`;
content += `2. Consider uncertainties or misunderstandings that may have occurred.\n`;
content += `3. Distinguish disagreement from personal hostility. Disagreement and dissent are part of healthy discussion. Hostility is not.\n`;
content += `4. Use your personal support system (friends, family, therapist, etc.) to work through and clarify your perspective.\n`;
content += `5. Ask yourself what part you played, how you could have behaved differently, and what your needs are.\n\n`;
if (formData.customReflectionPrompts) {
content += `Additional Reflection Prompts:\n${formData.customReflectionPrompts}\n\n`;
}
const reflectionTiming =
formData.reflectionPeriod || "Before any escalation";
content += `Reflection Timing: ${reflectionTiming}\n\n`;
}
// Direct Resolution (if enabled)
if (data.sectionsEnabled?.directResolution !== false) {
content += `DIRECT RESOLUTION\n-----------------\n\n`;
content += `A direct resolution process occurs when individuals communicate their concerns and work together to resolve disputes without filing an informal or formal complaint.\n\n`;
content += `Have a Conversation\n-------------------\n\n`;
content += `When there is a disagreement, the involved people should first communicate with each other about their concerns.\n\n`;
content += `1. Choose a time and place to meet that is private and agreeable to both.\n`;
content += `2. Allow reasonable time for the conversation.\n`;
content += `3. The point is mutual understanding, not determining who is right or wrong. This requires patience and willingness to listen without immediately dismissing the other person's perspective.\n`;
content += `4. Express thoughts and feelings directly without belittling or dismissing. Use "I" statements and active listening techniques.\n`;
content += `5. Communicate your wants and needs and make offers and requests.\n`;
content += `6. Learn for the future. Ask questions like, "If what I/you said or did came across that way, what can we do to prevent this from happening in the future?"\n`;
if (formData.documentDirectResolution) {
content += `7. Keep a written record of the resolution agreed to by both parties.\n\n`;
} else {
content += `\n`;
}
// Communication Channels
if (formData.channelsList && formData.channelsList.length > 0) {
content += `Escalating Communication Bandwidth\n-----------------------------------\n\n`;
content += `Whenever a misunderstanding or conflict arises, escalate the bandwidth of the channel:\n\n`;
formData.channelsList.forEach((channel: string, index: number) => {
content += `${index + 1}. ${channel}\n`;
});
content += `\n`;
}
if (formData.requireDirectAttempt) {
content += `NOTE: Direct resolution must be attempted before escalating to assisted resolution, unless safety concerns prevent this.\n\n`;
}
}
// Assisted Resolution
content += `ASSISTED RESOLUTION\n-------------------\n\n`;
content += `If talking things out doesn't work, you can ask a responsible contact person for help in writing.\n\n`;
// Responsible Contact People
if (formData.receiversList && formData.receiversList.length > 0) {
content += `Initial Contact Options:\n`;
formData.receiversList.forEach((receiver: string) => {
content += `${receiver}\n`;
});
content += `\n`;
}
// Mediator Structure
if (formData.mediatorType) {
content += `Mediation/Facilitation Structure: ${formData.mediatorType}\n\n`;
if (formData.supportPeople) {
content += `Support People: Parties may bring a trusted person for emotional support during mediation sessions.\n\n`;
}
}
// Timeline
content += `Response Times:\n`;
if (formData.initialResponse) {
content += `• Initial Response: ${formData.initialResponse}\n`;
}
if (formData.resolutionTarget) {
content += `• Target Resolution: ${formData.resolutionTarget}\n\n`;
}
// Formal Complaints
content += `FORMAL COMPLAINTS\n-----------------\n\n`;
content += `If assisted resolution efforts do not result in an acceptable outcome within a reasonable timeframe, a formal complaint may be filed in writing.\n\n`;
// Required Elements
if (
formData.complaintElementsList &&
formData.complaintElementsList.length > 0
) {
content += `Written Complaint Requirements:\n`;
formData.complaintElementsList.forEach((element: string, index: number) => {
content += `${index + 1}. ${element}\n`;
});
content += `\n`;
}
// Formal Process Timeline
content += `Formal Process Timeline:\n`;
if (formData.formalAcknowledgmentTime) {
content += `• Acknowledgment: ${formData.formalAcknowledgmentTime}\n`;
}
if (formData.formalReviewTime) {
content += `• Review Completion: ${formData.formalReviewTime}\n\n`;
}
if (formData.requireExternalAdvice) {
content += `External Expertise: For complex complaints involving multiple parties or organizational leaders, external legal advice will be sought.\n\n`;
}
// Settlement Documentation
if (formData.requireMinutesOfSettlement) {
content += `Reaching Agreement\n------------------\n\n`;
content += `Any resolution agreed upon must be documented in "Minutes of Settlement" signed by both parties. These agreements will be kept confidential according to our privacy standards.\n\n`;
}
// Consequences and Actions
if (formData.actionsList && formData.actionsList.length > 0) {
content += `POSSIBLE OUTCOMES\n-----------------\n\n`;
content += `Depending on the situation, resolution may include:\n\n`;
formData.actionsList.forEach((action: string) => {
content += `${action}\n`;
});
content += `\n`;
}
if (formData.appealProcess) {
content += `Appeals Process: Parties may request review of decisions through our appeals process.\n\n`;
}
// Documentation and Privacy
if (data.sectionsEnabled?.documentation !== false) {
content += `DOCUMENTATION & PRIVACY\n-----------------------\n\n`;
if (formData.docLevel) {
content += `Documentation Level: ${formData.docLevel}\n\n`;
}
if (formData.confidentiality) {
content += `Confidentiality: ${formData.confidentiality}\n\n`;
}
if (formData.retention) {
content += `Record Retention: ${formData.retention}\n\n`;
}
}
// External Resources (if enabled)
if (data.sectionsEnabled?.externalResources !== false) {
content += `EXTERNAL RESOURCES\n------------------\n\n`;
if (formData.includeHumanRights) {
content += `Individuals who are not satisfied with the outcome of a harassment or discrimination complaint may file a complaint with the Canadian Human Rights Commission or their provincial human rights tribunal.\n\n`;
}
if (formData.additionalResources) {
content += `Additional Resources:\n${formData.additionalResources}\n\n`;
}
}
// Implementation
content += `POLICY MANAGEMENT\n-----------------\n\n`;
if (formData.training) {
content += `Training Requirements:\n${formData.training}\n\n`;
}
content += `Review and Updates:\n`;
if (formData.reviewSchedule) {
content += `This policy will be reviewed ${formData.reviewSchedule.toLowerCase()}.\n\n`;
}
if (formData.amendments) {
content += `Amendment Process: ${formData.amendments}\n\n`;
}
// Acknowledgments
if (formData.acknowledgments) {
content += `Acknowledgments:\n${formData.acknowledgments}\n\n`;
}
return content;
// Use the pre-generated content from the Vue component
return data.content || "No content available";
};
const formatConflictResolutionAsMarkdown = (data: any): string => {
const formData = data.formData || {};
const cooperativeName = formData.orgName || "[Cooperative Name]";
let content = `# ${cooperativeName} Conflict Resolution Policy\n\n`;
content += `*Framework Created: ${
formData.createdDate || new Date().toISOString().split("T")[0]
}*\n`;
if (formData.reviewDate) {
content += `*Next Review: ${formData.reviewDate}*\n`;
}
content += `\n---\n\n`;
// Core Values section (if enabled)
if (data.sectionsEnabled?.values !== false) {
content += `## Our Values\n\n`;
content += `This conflict resolution framework is guided by our core values:\n\n`;
if (formData.coreValuesList && formData.coreValuesList.length > 0) {
formData.coreValuesList.forEach((value: string) => {
content += `- **${value}**\n`;
});
content += `\n`;
}
if (formData.customValues) {
content += `${formData.customValues}\n\n`;
}
}
// Resolution Philosophy
const approachDescriptions: { [key: string]: string } = {
restorative:
"We use a **restorative/loving justice** approach that focuses on healing, understanding root causes, and repairing relationships rather than punishment.",
mediation:
"We use a **mediation-first** approach where neutral third-party facilitators help parties dialogue and find solutions.",
progressive:
"We use **progressive discipline** with clear escalation steps and defined consequences for violations.",
hybrid:
"We use a **hybrid approach** that combines multiple methods based on the type and severity of conflict.",
};
if (formData.approach && approachDescriptions[formData.approach]) {
content += `## Our Approach\n\n`;
content += `${approachDescriptions[formData.approach]}\n\n`;
content += `We do our best to resolve conflicts at the lowest possible escalation step (direct resolution), but agree to escalate conflicts (to assisted resolution) if they are not resolved.\n\n`;
}
// Reflection Process (if enabled)
if (data.sectionsEnabled?.reflection !== false) {
content += `## Reflection\n\n`;
content += `Before engaging in direct resolution, we encourage taking time for reflection:\n\n`;
content += `1. **Set aside time to think** through what happened. What was the other person's behaviour? How did it affect you? *Distinguish other people's **actions** from your **feelings** about them.*\n`;
content += `2. **Consider uncertainties** or misunderstandings that may have occurred.\n`;
content += `3. **Distinguish disagreement from personal hostility.** Disagreement and dissent are part of healthy discussion. Hostility is not.\n`;
content += `4. **Use your personal support system** (friends, family, therapist, etc.) to work through and clarify your perspective.\n`;
content += `5. **Ask yourself** what part you played, how you could have behaved differently, and what your needs are.\n\n`;
if (formData.customReflectionPrompts) {
content += `### Additional Reflection Prompts\n\n`;
content += `${formData.customReflectionPrompts}\n\n`;
}
const reflectionTiming =
formData.reflectionPeriod || "Before any escalation";
content += `**Reflection Timing:** ${reflectionTiming}\n\n`;
}
// Direct Resolution (if enabled)
if (data.sectionsEnabled?.directResolution !== false) {
content += `## Direct Resolution\n\n`;
content += `A *direct resolution* process occurs when individuals communicate their concerns and work together to resolve disputes without filing an informal or formal complaint.\n\n`;
content += `### Have a Conversation\n\n`;
content += `When there is a disagreement, the involved people should first **communicate with each other** about their concerns.\n\n`;
content += `1. **Choose a time and place** to meet that is private and agreeable to both.\n`;
content += `2. **Allow reasonable time** for the conversation.\n`;
content += `3. **The point is mutual understanding**, not determining who is right or wrong. This requires patience and willingness to listen without immediately dismissing the other person's perspective.\n`;
content += `4. **Express thoughts and feelings directly** without belittling or dismissing. Use "I" statements and active listening techniques.\n`;
content += `5. **Communicate your wants and needs** and make offers and requests.\n`;
content += `6. **Learn for the future.** Ask questions like, "If what I/you said or did came across that way, what can we do to prevent this from happening in the future?"\n`;
if (formData.documentDirectResolution) {
content += `7. **Keep a written record** of the resolution agreed to by both parties.\n\n`;
} else {
content += `\n`;
}
// Communication Channels
if (formData.channelsList && formData.channelsList.length > 0) {
content += `### Escalating Communication Bandwidth\n\n`;
content += `Whenever a misunderstanding or conflict arises, **escalate the bandwidth of the channel**:\n\n`;
formData.channelsList.forEach((channel: string, index: number) => {
content += `${index + 1}. ${channel}\n`;
});
content += `\n`;
}
if (formData.requireDirectAttempt) {
content += `> **Note:** Direct resolution must be attempted before escalating to assisted resolution, unless safety concerns prevent this.\n\n`;
}
}
// Assisted Resolution
content += `## Assisted Resolution\n\n`;
content += `If talking things out doesn't work, you can ask a responsible contact person for help in writing.\n\n`;
// Responsible Contact People
if (formData.receiversList && formData.receiversList.length > 0) {
content += `### Initial Contact Options\n\n`;
content += `You can report conflicts to any of the following:\n\n`;
formData.receiversList.forEach((receiver: string) => {
content += `- ${receiver}\n`;
});
content += `\n`;
}
// Mediator Structure
if (formData.mediatorType) {
content += `### Mediation/Facilitation\n\n`;
content += `**Structure:** ${formData.mediatorType}\n\n`;
if (formData.supportPeople) {
content += `**Support People:** Parties may bring a trusted person for emotional support during mediation sessions.\n\n`;
}
}
// Timeline
content += `### Response Times\n\n`;
if (formData.initialResponse) {
content += `- **Initial Response:** ${formData.initialResponse}\n`;
}
if (formData.resolutionTarget) {
content += `- **Target Resolution:** ${formData.resolutionTarget}\n\n`;
}
// Formal Complaints
content += `## Formal Complaints\n\n`;
content += `If assisted resolution efforts do not result in an acceptable outcome within a reasonable timeframe, a *formal complaint* may be filed in writing.\n\n`;
// Required Elements
if (
formData.complaintElementsList &&
formData.complaintElementsList.length > 0
) {
content += `### Written Complaint Requirements\n\n`;
content += `The formal complaint must include:\n\n`;
formData.complaintElementsList.forEach((element: string, index: number) => {
content += `${index + 1}. ${element}\n`;
});
content += `\n`;
}
// Formal Process Timeline
content += `### Formal Process Timeline\n\n`;
if (formData.formalAcknowledgmentTime) {
content += `- **Acknowledgment:** ${formData.formalAcknowledgmentTime}\n`;
}
if (formData.formalReviewTime) {
content += `- **Review Completion:** ${formData.formalReviewTime}\n\n`;
}
if (formData.requireExternalAdvice) {
content += `> **External Expertise:** For complex complaints involving multiple parties or organizational leaders, external legal advice will be sought.\n\n`;
}
// Settlement Documentation
if (formData.requireMinutesOfSettlement) {
content += `### Reaching Agreement\n\n`;
content += `Any resolution agreed upon must be documented in "Minutes of Settlement" signed by both parties. These agreements will be kept confidential according to our privacy standards.\n\n`;
}
// Consequences and Actions
if (formData.actionsList && formData.actionsList.length > 0) {
content += `## Possible Outcomes\n\n`;
content += `Depending on the situation, resolution may include:\n\n`;
formData.actionsList.forEach((action: string) => {
content += `- ${action}\n`;
});
content += `\n`;
}
if (formData.appealProcess) {
content += `### Appeals Process\n\n`;
content += `Parties may request review of decisions through our appeals process.\n\n`;
}
// Documentation and Privacy
if (data.sectionsEnabled?.documentation !== false) {
content += `## Documentation & Privacy\n\n`;
if (formData.docLevel) {
content += `**Documentation Level:** ${formData.docLevel}\n\n`;
}
if (formData.confidentiality) {
content += `**Confidentiality:** ${formData.confidentiality}\n\n`;
}
if (formData.retention) {
content += `**Record Retention:** ${formData.retention}\n\n`;
}
}
// External Resources (if enabled)
if (data.sectionsEnabled?.externalResources !== false) {
content += `## External Resources\n\n`;
if (formData.includeHumanRights) {
content += `Individuals who are not satisfied with the outcome of a harassment or discrimination complaint may file a complaint with the [Canadian Human Rights Commission](https://www.chrc-ccdp.gc.ca/eng) or their provincial human rights tribunal.\n\n`;
}
if (formData.additionalResources) {
content += `### Additional Resources\n\n`;
content += `${formData.additionalResources}\n\n`;
}
}
// Implementation
content += `## Policy Management\n\n`;
if (formData.training) {
content += `### Training Requirements\n\n`;
content += `${formData.training}\n\n`;
}
content += `### Review and Updates\n\n`;
if (formData.reviewSchedule) {
content += `This policy will be reviewed ${formData.reviewSchedule.toLowerCase()}.\n\n`;
}
if (formData.amendments) {
content += `**Amendment Process:** ${formData.amendments}\n\n`;
}
// Acknowledgments
if (formData.acknowledgments) {
content += `### Acknowledgments\n\n`;
content += `${formData.acknowledgments}\n\n`;
}
return content;
// Use the pre-generated content from the Vue component
return data.content || "No content available";
};
// Decision Framework formatting