Skip to content

Commit

Permalink
feat: Create a reusable component for role category and migrate oppor…
Browse files Browse the repository at this point in the history
…tunity to use it
  • Loading branch information
chungthuang committed Sep 24, 2024
1 parent 8f6c38b commit ad03b8e
Show file tree
Hide file tree
Showing 4 changed files with 176 additions and 16 deletions.
16 changes: 5 additions & 11 deletions src/api/opportunity/content-types/opportunity/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,6 @@
"target": "api::project.project",
"inversedBy": "opportunities"
},
"roleCategory": {
"type": "enumeration",
"enum": [
"Product / UX",
"Development",
"QA",
"Operations"
],
"required": true,
"default": "Development"
},
"roleType": {
"type": "enumeration",
"enum": [
Expand All @@ -84,6 +73,11 @@
],
"required": true,
"default": "Front-End Developer"
},
"roleCategory": {
"type": "component",
"repeatable": false,
"component": "role-category.role-category"
}
}
}
20 changes: 20 additions & 0 deletions src/components/role-category/role-category.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"collectionName": "components_role_category_role_categories",
"info": {
"displayName": "roleCategory",
"description": ""
},
"options": {},
"attributes": {
"category": {
"type": "enumeration",
"enum": [
"Product / UX",
"Development",
"QA",
"Operations",
"Other"
]
}
}
}
14 changes: 14 additions & 0 deletions types/generated/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,19 @@ export interface RepoChangesRepoChanges extends Schema.Component {
};
}

export interface RoleCategoryRoleCategory extends Schema.Component {
collectionName: 'components_role_category_role_categories';
info: {
displayName: 'roleCategory';
description: '';
};
attributes: {
category: Attribute.Enumeration<
['Product / UX', 'Development', 'QA', 'Operations', 'Other']
>;
};
}

export interface SkillsSkills extends Schema.Component {
collectionName: 'components_skills_skills';
info: {
Expand Down Expand Up @@ -309,6 +322,7 @@ declare module '@strapi/types' {
'project.project-milestones': ProjectProjectMilestones;
'project.task': ProjectTask;
'repo-changes.repo-changes': RepoChangesRepoChanges;
'role-category.role-category': RoleCategoryRoleCategory;
'skills.skills': SkillsSkills;
}
}
Expand Down
142 changes: 137 additions & 5 deletions types/generated/contentTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,98 @@ export interface AdminTransferTokenPermission extends Schema.CollectionType {
};
}

export interface AdminWorkflow extends Schema.CollectionType {
collectionName: 'strapi_workflows';
info: {
name: 'Workflow';
description: '';
singularName: 'workflow';
pluralName: 'workflows';
displayName: 'Workflow';
};
pluginOptions: {
'content-manager': {
visible: false;
};
'content-type-builder': {
visible: false;
};
};
attributes: {
name: Attribute.String & Attribute.Required & Attribute.Unique;
stages: Attribute.Relation<
'admin::workflow',
'oneToMany',
'admin::workflow-stage'
>;
contentTypes: Attribute.JSON & Attribute.Required & Attribute.DefaultTo<[]>;
createdAt: Attribute.DateTime;
updatedAt: Attribute.DateTime;
createdBy: Attribute.Relation<
'admin::workflow',
'oneToOne',
'admin::user'
> &
Attribute.Private;
updatedBy: Attribute.Relation<
'admin::workflow',
'oneToOne',
'admin::user'
> &
Attribute.Private;
};
}

export interface AdminWorkflowStage extends Schema.CollectionType {
collectionName: 'strapi_workflows_stages';
info: {
name: 'Workflow Stage';
description: '';
singularName: 'workflow-stage';
pluralName: 'workflow-stages';
displayName: 'Stages';
};
options: {
version: '1.1.0';
};
pluginOptions: {
'content-manager': {
visible: false;
};
'content-type-builder': {
visible: false;
};
};
attributes: {
name: Attribute.String;
color: Attribute.String & Attribute.DefaultTo<'#4945FF'>;
workflow: Attribute.Relation<
'admin::workflow-stage',
'manyToOne',
'admin::workflow'
>;
permissions: Attribute.Relation<
'admin::workflow-stage',
'manyToMany',
'admin::permission'
>;
createdAt: Attribute.DateTime;
updatedAt: Attribute.DateTime;
createdBy: Attribute.Relation<
'admin::workflow-stage',
'oneToOne',
'admin::user'
> &
Attribute.Private;
updatedBy: Attribute.Relation<
'admin::workflow-stage',
'oneToOne',
'admin::user'
> &
Attribute.Private;
};
}

export interface PluginUploadFile extends Schema.CollectionType {
collectionName: 'files';
info: {
Expand Down Expand Up @@ -1258,11 +1350,6 @@ export interface ApiOpportunityOpportunity extends Schema.CollectionType {
'manyToMany',
'api::project.project'
>;
roleCategory: Attribute.Enumeration<
['Product / UX', 'Development', 'QA', 'Operations']
> &
Attribute.Required &
Attribute.DefaultTo<'Development'>;
roleType: Attribute.Enumeration<
[
'Product Lead',
Expand All @@ -1280,6 +1367,7 @@ export interface ApiOpportunityOpportunity extends Schema.CollectionType {
> &
Attribute.Required &
Attribute.DefaultTo<'Front-End Developer'>;
roleCategory: Attribute.Component<'role-category.role-category'>;
createdAt: Attribute.DateTime;
updatedAt: Attribute.DateTime;
publishedAt: Attribute.DateTime;
Expand Down Expand Up @@ -1564,6 +1652,47 @@ export interface ApiTeamMembershipTeamMembership extends Schema.CollectionType {
};
}

export interface AdminAuditLog extends Schema.CollectionType {
collectionName: 'strapi_audit_logs';
info: {
singularName: 'audit-log';
pluralName: 'audit-logs';
displayName: 'Audit Log';
};
options: {
draftAndPublish: false;
timestamps: false;
};
pluginOptions: {
'content-manager': {
visible: false;
};
'content-type-builder': {
visible: false;
};
};
attributes: {
action: Attribute.String & Attribute.Required;
date: Attribute.DateTime & Attribute.Required;
user: Attribute.Relation<'admin::audit-log', 'oneToOne', 'admin::user'>;
payload: Attribute.JSON;
createdAt: Attribute.DateTime;
updatedAt: Attribute.DateTime;
createdBy: Attribute.Relation<
'admin::audit-log',
'oneToOne',
'admin::user'
> &
Attribute.Private;
updatedBy: Attribute.Relation<
'admin::audit-log',
'oneToOne',
'admin::user'
> &
Attribute.Private;
};
}

declare module '@strapi/types' {
export module Shared {
export interface ContentTypes {
Expand All @@ -1574,6 +1703,8 @@ declare module '@strapi/types' {
'admin::api-token-permission': AdminApiTokenPermission;
'admin::transfer-token': AdminTransferToken;
'admin::transfer-token-permission': AdminTransferTokenPermission;
'admin::workflow': AdminWorkflow;
'admin::workflow-stage': AdminWorkflowStage;
'plugin::upload.file': PluginUploadFile;
'plugin::upload.folder': PluginUploadFolder;
'plugin::users-permissions.permission': PluginUsersPermissionsPermission;
Expand All @@ -1599,6 +1730,7 @@ declare module '@strapi/types' {
'api::sendmail.sendmail': ApiSendmailSendmail;
'api::subscription.subscription': ApiSubscriptionSubscription;
'api::team-membership.team-membership': ApiTeamMembershipTeamMembership;
'admin::audit-log': AdminAuditLog;
}
}
}

0 comments on commit ad03b8e

Please sign in to comment.