Skip to content

Commit

Permalink
feat(cms): added use case
Browse files Browse the repository at this point in the history
  • Loading branch information
StanGirard committed Oct 5, 2023
1 parent 6f2023d commit 64315d0
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 27 deletions.
2 changes: 1 addition & 1 deletion cms/quivr/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM node:18.13.0-alpine
# Install Python and essential build tools
RUN apk add --update --no-cache python3 make g++ && ln -sf python3 /usr/bin/python
RUN apk add --update --no-cache python3 make g++ git && ln -sf python3 /usr/bin/python
RUN python3 -m ensurepip
RUN pip3 install --no-cache --upgrade pip setuptools

Expand Down
31 changes: 31 additions & 0 deletions cms/quivr/src/api/use-case/content-types/use-case/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"kind": "collectionType",
"collectionName": "use_cases",
"info": {
"singularName": "use-case",
"pluralName": "use-cases",
"displayName": "Use Case"
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"Title": {
"type": "string"
},
"Description": {
"type": "string"
},
"image": {
"allowedTypes": [
"images",
"files",
"videos",
"audios"
],
"type": "media",
"multiple": true
}
}
}
9 changes: 9 additions & 0 deletions cms/quivr/src/api/use-case/controllers/use-case.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

/**
* use-case controller
*/

const { createCoreController } = require('@strapi/strapi').factories;

module.exports = createCoreController('api::use-case.use-case');
9 changes: 9 additions & 0 deletions cms/quivr/src/api/use-case/routes/use-case.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

/**
* use-case router
*/

const { createCoreRouter } = require('@strapi/strapi').factories;

module.exports = createCoreRouter('api::use-case.use-case');
9 changes: 9 additions & 0 deletions cms/quivr/src/api/use-case/services/use-case.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

/**
* use-case service
*/

const { createCoreService } = require('@strapi/strapi').factories;

module.exports = createCoreService('api::use-case.use-case');
85 changes: 59 additions & 26 deletions cms/quivr/types/generated/contentTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,31 +361,6 @@ export interface AdminTransferTokenPermission extends Schema.CollectionType {
};
}

export interface ApiBlogBlog extends Schema.CollectionType {
collectionName: 'blogs';
info: {
singularName: 'blog';
pluralName: 'blogs';
displayName: 'Blog';
};
options: {
draftAndPublish: true;
};
attributes: {
title: Attribute.String & Attribute.Required;
description: Attribute.Text;
draft: Attribute.RichText;
imageUrl: Attribute.String;
createdAt: Attribute.DateTime;
updatedAt: Attribute.DateTime;
publishedAt: Attribute.DateTime;
createdBy: Attribute.Relation<'api::blog.blog', 'oneToOne', 'admin::user'> &
Attribute.Private;
updatedBy: Attribute.Relation<'api::blog.blog', 'oneToOne', 'admin::user'> &
Attribute.Private;
};
}

export interface PluginUploadFile extends Schema.CollectionType {
collectionName: 'files';
info: {
Expand Down Expand Up @@ -701,6 +676,63 @@ export interface PluginUsersPermissionsUser extends Schema.CollectionType {
};
}

export interface ApiBlogBlog extends Schema.CollectionType {
collectionName: 'blogs';
info: {
singularName: 'blog';
pluralName: 'blogs';
displayName: 'Blog';
};
options: {
draftAndPublish: true;
};
attributes: {
title: Attribute.String & Attribute.Required;
description: Attribute.Text;
draft: Attribute.RichText;
imageUrl: Attribute.String;
createdAt: Attribute.DateTime;
updatedAt: Attribute.DateTime;
publishedAt: Attribute.DateTime;
createdBy: Attribute.Relation<'api::blog.blog', 'oneToOne', 'admin::user'> &
Attribute.Private;
updatedBy: Attribute.Relation<'api::blog.blog', 'oneToOne', 'admin::user'> &
Attribute.Private;
};
}

export interface ApiUseCaseUseCase extends Schema.CollectionType {
collectionName: 'use_cases';
info: {
singularName: 'use-case';
pluralName: 'use-cases';
displayName: 'Use Case';
};
options: {
draftAndPublish: true;
};
attributes: {
Title: Attribute.String;
Description: Attribute.String;
image: Attribute.Media;
createdAt: Attribute.DateTime;
updatedAt: Attribute.DateTime;
publishedAt: Attribute.DateTime;
createdBy: Attribute.Relation<
'api::use-case.use-case',
'oneToOne',
'admin::user'
> &
Attribute.Private;
updatedBy: Attribute.Relation<
'api::use-case.use-case',
'oneToOne',
'admin::user'
> &
Attribute.Private;
};
}

declare module '@strapi/strapi' {
export module Shared {
export interface ContentTypes {
Expand All @@ -711,13 +743,14 @@ declare module '@strapi/strapi' {
'admin::api-token-permission': AdminApiTokenPermission;
'admin::transfer-token': AdminTransferToken;
'admin::transfer-token-permission': AdminTransferTokenPermission;
'api::blog.blog': ApiBlogBlog;
'plugin::upload.file': PluginUploadFile;
'plugin::upload.folder': PluginUploadFolder;
'plugin::i18n.locale': PluginI18NLocale;
'plugin::users-permissions.permission': PluginUsersPermissionsPermission;
'plugin::users-permissions.role': PluginUsersPermissionsRole;
'plugin::users-permissions.user': PluginUsersPermissionsUser;
'api::blog.blog': ApiBlogBlog;
'api::use-case.use-case': ApiUseCaseUseCase;
}
}
}

0 comments on commit 64315d0

Please sign in to comment.