mirror of
https://github.com/cssgunc/compass.git
synced 2025-04-06 20:50:17 -04:00
Added dummy data and collection model
This commit is contained in:
parent
df0b0614ac
commit
a689b00163
|
@ -1,4 +1,4 @@
|
|||
import { ListBulletIcon, HashtagIcon, Bars3BottomLeftIcon, EnvelopeIcon, AtSymbolIcon, ClipboardIcon, ArrowsUpDownIcon, ChevronDoubleRightIcon, ChevronDoubleLeftIcon, ChevronRightIcon, ChevronLeftIcon, EyeIcon, EyeSlashIcon, UserIcon, BookOpenIcon, MagnifyingGlassIcon, LinkIcon } from '@heroicons/react/24/solid';
|
||||
import { ListBulletIcon, HashtagIcon, Bars3BottomLeftIcon, EnvelopeIcon, AtSymbolIcon, ClipboardIcon, ArrowsUpDownIcon, ChevronDoubleRightIcon, ChevronDoubleLeftIcon, ChevronRightIcon, ChevronLeftIcon, EyeIcon, EyeSlashIcon, UserIcon, BookOpenIcon, MagnifyingGlassIcon, LinkIcon, ClipboardDocumentCheckIcon } from '@heroicons/react/24/solid';
|
||||
|
||||
export const Icons = {
|
||||
EmailInputIcon: EnvelopeIcon,
|
||||
|
@ -17,10 +17,11 @@ export const Icons = {
|
|||
LinkTableIcon: LinkIcon,
|
||||
TextTableIcon: Bars3BottomLeftIcon,
|
||||
NumberTableIcon: HashtagIcon,
|
||||
MultiselectTableIcon: ListBulletIcon
|
||||
MultiselectTableIcon: ListBulletIcon,
|
||||
RequirementsTableIcon: ClipboardDocumentCheckIcon
|
||||
};
|
||||
|
||||
export enum User {
|
||||
export enum USER {
|
||||
ADMIN,
|
||||
EMPLOYEE,
|
||||
VOLUNTEER
|
||||
|
@ -39,6 +40,12 @@ export enum PROGRAM {
|
|||
COMMUNITY_EDUCATION
|
||||
}
|
||||
|
||||
export enum STATUS {
|
||||
FULL,
|
||||
CLOSED,
|
||||
ACCEPTING_CLIENTS
|
||||
}
|
||||
|
||||
export enum DATATYPE {
|
||||
INTEGER,
|
||||
STRING,
|
||||
|
|
137
compass/utils/functions/mockFetch.ts
Normal file
137
compass/utils/functions/mockFetch.ts
Normal file
|
@ -0,0 +1,137 @@
|
|||
import { PROGRAM, STATUS, USER } from "../constants";
|
||||
|
||||
const serviceEntries = [
|
||||
{
|
||||
name: "Empowerment Workshops",
|
||||
status: [STATUS.ACCEPTING_CLIENTS],
|
||||
summary: "Workshops to empower victims through education and skill-building.",
|
||||
requirements: "Resident of the community and victim of domestic violence.",
|
||||
program: [PROGRAM.DOMESTIC_VIOLENCE, PROGRAM.COMMUNITY_EDUCATION],
|
||||
tags: ["empowerment", "education"],
|
||||
},
|
||||
{
|
||||
name: "Financial Literacy Courses",
|
||||
status: [STATUS.ACCEPTING_CLIENTS, STATUS.FULL],
|
||||
summary: "Courses aimed at improving financial independence for victims.",
|
||||
requirements: "Open to all domestic violence victims.",
|
||||
program: [PROGRAM.ECONOMIC_STABILITY],
|
||||
tags: ["finance", "literacy"],
|
||||
},
|
||||
{
|
||||
name: "Counseling Services",
|
||||
status: [STATUS.ACCEPTING_CLIENTS],
|
||||
summary: "Professional counseling for individuals and families affected by domestic violence.",
|
||||
requirements: "Appointment required.",
|
||||
program: [PROGRAM.DOMESTIC_VIOLENCE],
|
||||
tags: ["counseling", "mental health"],
|
||||
},
|
||||
{
|
||||
name: "Job Placement Program",
|
||||
status: [STATUS.ACCEPTING_CLIENTS],
|
||||
summary: "Assistance with job search and placement for survivors.",
|
||||
requirements: "Must be actively seeking employment.",
|
||||
program: [PROGRAM.ECONOMIC_STABILITY],
|
||||
tags: ["job", "employment"],
|
||||
},
|
||||
{
|
||||
name: "Legal Advocacy",
|
||||
status: [STATUS.FULL],
|
||||
summary: "Legal advice and representation for victims of domestic violence.",
|
||||
requirements: "Legal documentation of domestic violence required.",
|
||||
program: [PROGRAM.DOMESTIC_VIOLENCE],
|
||||
tags: ["legal", "advocacy"],
|
||||
}
|
||||
];
|
||||
|
||||
const resourceEntries = [
|
||||
{
|
||||
name: "Legal Aid Reference",
|
||||
summary: "Comprehensive list of legal resources for victims.",
|
||||
link: "https://legalaid.example.com",
|
||||
program: [PROGRAM.DOMESTIC_VIOLENCE],
|
||||
tags: ["legal", "aid"],
|
||||
},
|
||||
{
|
||||
name: "Shelter Locations",
|
||||
summary: "Directory of safe shelters for victims escaping abuse.",
|
||||
link: "https://shelters.example.com",
|
||||
program: [PROGRAM.DOMESTIC_VIOLENCE],
|
||||
tags: ["shelter", "safety"],
|
||||
},
|
||||
{
|
||||
name: "Support Group Finder",
|
||||
summary: "Find local support groups for survivors of domestic violence.",
|
||||
link: "https://supportgroups.example.com",
|
||||
program: [PROGRAM.COMMUNITY_EDUCATION],
|
||||
tags: ["support", "community"],
|
||||
},
|
||||
{
|
||||
name: "Employment Services",
|
||||
summary: "Resources for job training and placement services.",
|
||||
link: "https://employment.example.com",
|
||||
program: [PROGRAM.ECONOMIC_STABILITY],
|
||||
tags: ["job", "training"],
|
||||
},
|
||||
{
|
||||
name: "Educational Workshops",
|
||||
summary: "Schedule of educational workshops on various topics.",
|
||||
link: "https://workshops.example.com",
|
||||
program: [PROGRAM.COMMUNITY_EDUCATION],
|
||||
tags: ["education", "workshops"],
|
||||
}
|
||||
];
|
||||
|
||||
const userEntries = [
|
||||
{
|
||||
name: "Alex Johnson",
|
||||
role: [USER.VOLUNTEER],
|
||||
email: "alex.johnson@example.com",
|
||||
program: [PROGRAM.DOMESTIC_VIOLENCE],
|
||||
experience: 2,
|
||||
group: "Volunteer Group A",
|
||||
},
|
||||
{
|
||||
name: "Sam Lee",
|
||||
role: [USER.EMPLOYEE],
|
||||
email: "sam.lee@example.com",
|
||||
program: [PROGRAM.ECONOMIC_STABILITY],
|
||||
experience: 5,
|
||||
group: "Economic Support Team",
|
||||
},
|
||||
{
|
||||
name: "Jordan Smith",
|
||||
role: [USER.ADMIN, USER.VOLUNTEER],
|
||||
email: "jordan.smith@example.com",
|
||||
program: [PROGRAM.COMMUNITY_EDUCATION, PROGRAM.DOMESTIC_VIOLENCE],
|
||||
experience: 3,
|
||||
group: "Outreach and Education",
|
||||
},
|
||||
{
|
||||
name: "Casey Martinez",
|
||||
role: [USER.VOLUNTEER],
|
||||
email: "casey.martinez@example.com",
|
||||
program: [PROGRAM.ECONOMIC_STABILITY],
|
||||
experience: 1,
|
||||
group: "Financial Literacy Volunteers",
|
||||
},
|
||||
{
|
||||
name: "Jamie Chung",
|
||||
role: [USER.EMPLOYEE],
|
||||
email: "jamie.chung@example.com",
|
||||
program: [PROGRAM.DOMESTIC_VIOLENCE],
|
||||
experience: 4,
|
||||
group: "Counseling Services Team",
|
||||
}
|
||||
];
|
||||
|
||||
export const mockFetchServices = () => {
|
||||
return serviceEntries;
|
||||
}
|
||||
|
||||
export const mockFetchResources = () => {
|
||||
return resourceEntries;
|
||||
}
|
||||
|
||||
export const mockFetchUsers = () => {
|
||||
return userEntries;
|
||||
}
|
|
@ -4,7 +4,7 @@ import { Field } from "@/utils/classes/Field";
|
|||
|
||||
export class StringFieldImpl extends Field {
|
||||
|
||||
constructor(iconKey: keyof typeof Icons, title: string) {
|
||||
constructor(title: string, iconKey: keyof typeof Icons = "TextTableIcon") {
|
||||
super(iconKey, title);
|
||||
}
|
||||
|
||||
|
|
15
compass/utils/models/Collection.ts
Normal file
15
compass/utils/models/Collection.ts
Normal file
|
@ -0,0 +1,15 @@
|
|||
import { mockFetchResources, mockFetchServices, mockFetchUsers } from "../functions/mockFetch";
|
||||
import { CollectionDataImpl } from "../implementations/CollectionDataImpl";
|
||||
import { CollectionImpl } from "../implementations/CollectionImpl";
|
||||
import { ResourceCollectionDataType, ServiceCollectionDataType, UserCollectionDataType } from "./CollectionDataType";
|
||||
|
||||
const ServiceCollectionData = new CollectionDataImpl(ServiceCollectionDataType, mockFetchServices());
|
||||
const ResourceCollectionData = new CollectionDataImpl(ResourceCollectionDataType, mockFetchResources());
|
||||
const UserCollectionData = new CollectionDataImpl(UserCollectionDataType, mockFetchUsers());
|
||||
|
||||
export const ServiceCollection = new CollectionImpl('Service','ServiceIcon',new CollectionDataImpl(ServiceCollectionDataType))
|
||||
|
||||
export const ResourceCollection = new CollectionImpl('Resource','ResourceIcon',new CollectionDataImpl(ResourceCollectionDataType))
|
||||
|
||||
export const UserCollection = new CollectionImpl('User','UserIcon',new CollectionDataImpl(UserCollectionDataType))
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
import { Field } from "../classes/Field";
|
||||
import { PROGRAM } from "../constants";
|
||||
import { CollectionDataImpl } from "../implementations/CollectionDataImpl";
|
||||
import { CollectionImpl } from "../implementations/CollectionImpl";
|
||||
import { MultiselectFieldImpl } from "../implementations/FieldImpl/MultiselectFieldImpl";
|
||||
import { StringFieldImpl } from "../implementations/FieldImpl/StringFieldImpl";
|
||||
|
||||
const programSet: Set<PROGRAM> = new Set([PROGRAM.COMMUNITY_EDUCATION, PROGRAM.DOMESTIC_VIOLENCE, PROGRAM.ECONOMIC_STABILITY]);
|
||||
|
||||
export const ServiceCollectionDataType: Field[] = [new StringFieldImpl("Name"), new MultiselectFieldImpl("Status"), new StringFieldImpl("Summary"), new StringFieldImpl("Requirements"), new MultiselectFieldImpl('Program', programSet)]
|
||||
|
||||
export const ServiceCollectionData = new CollectionImpl('Service','ResourceIcon',new CollectionDataImpl(ServiceCollectionDataType))
|
||||
|
||||
export const ResourceCollectionDataType: Field[] = [new StringFieldImpl("Name"), new MultiselectFieldImpl("Status"), new StringFieldImpl("Summary"), new StringFieldImpl("Requirements"), new MultiselectFieldImpl('Program', programSet)]
|
||||
|
||||
export const ResourceCollectionData = new CollectionImpl('Service','ResourceIcon',new CollectionDataImpl(ServiceCollectionDataType))
|
||||
|
26
compass/utils/models/CollectionDataType.ts
Normal file
26
compass/utils/models/CollectionDataType.ts
Normal file
|
@ -0,0 +1,26 @@
|
|||
import { Field } from "../classes/Field";
|
||||
import { PROGRAM, STATUS, USER } from "../constants";
|
||||
import { EmailFieldImpl } from "../implementations/FieldImpl/EmailFieldImpl";
|
||||
import { IntegerFieldImpl } from "../implementations/FieldImpl/IntegerFieldImpl";
|
||||
import { LinkFieldImpl } from "../implementations/FieldImpl/LinkFieldImpl";
|
||||
import { MultiselectFieldImpl } from "../implementations/FieldImpl/MultiselectFieldImpl";
|
||||
import { StringFieldImpl } from "../implementations/FieldImpl/StringFieldImpl";
|
||||
|
||||
const programSet: Set<PROGRAM> = new Set([PROGRAM.COMMUNITY_EDUCATION, PROGRAM.DOMESTIC_VIOLENCE, PROGRAM.ECONOMIC_STABILITY]);
|
||||
const program = new MultiselectFieldImpl("program", programSet);
|
||||
const requirements = new StringFieldImpl("requirements","RequirementsTableIcon");
|
||||
const name = new StringFieldImpl("name");
|
||||
const summary = new StringFieldImpl("summary");
|
||||
const statusSet: Set<STATUS> = new Set([STATUS.ACCEPTING_CLIENTS, STATUS.CLOSED, STATUS.FULL])
|
||||
const status = new MultiselectFieldImpl("status", statusSet);
|
||||
const link = new LinkFieldImpl()
|
||||
const tags = new MultiselectFieldImpl("tags")
|
||||
const roleSet: Set<USER> = new Set([USER.ADMIN, USER.EMPLOYEE, USER.VOLUNTEER]);
|
||||
const role = new MultiselectFieldImpl("role", roleSet)
|
||||
const experience = new IntegerFieldImpl("yoe")
|
||||
const email = new EmailFieldImpl()
|
||||
const group = new StringFieldImpl("group")
|
||||
|
||||
export const ServiceCollectionDataType: Field[] = [name, status, summary, requirements, program, tags]
|
||||
export const ResourceCollectionDataType: Field[] = [name, summary, link, program, tags]
|
||||
export const UserCollectionDataType: Field[] = [name, role, email, program, experience, group]
|
Loading…
Reference in New Issue
Block a user