feat(cms): added single video demo (#1459)

# Description

Please include a summary of the changes and the related issue. Please
also include relevant motivation and context.

## Checklist before requesting a review

Please delete options that are not relevant.

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented hard-to-understand areas
- [ ] I have ideally added tests that prove my fix is effective or that
my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged

## Screenshots (if appropriate):
This commit is contained in:
Stan Girard 2023-10-23 10:44:50 +02:00 committed by GitHub
parent bb1e2e35db
commit a0e4862927
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 83 additions and 3 deletions

View File

@ -0,0 +1,23 @@
{
"kind": "singleType",
"collectionName": "demo_videos",
"info": {
"singularName": "demo-video",
"pluralName": "demo-videos",
"displayName": "Demo-Video"
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"Video": {
"allowedTypes": [
"videos"
],
"type": "media",
"multiple": false,
"required": true
}
}
}

View File

@ -0,0 +1,9 @@
'use strict';
/**
* demo-video controller
*/
const { createCoreController } = require('@strapi/strapi').factories;
module.exports = createCoreController('api::demo-video.demo-video');

View File

@ -0,0 +1,9 @@
'use strict';
/**
* demo-video router
*/
const { createCoreRouter } = require('@strapi/strapi').factories;
module.exports = createCoreRouter('api::demo-video.demo-video');

View File

@ -0,0 +1,9 @@
'use strict';
/**
* demo-video service
*/
const { createCoreService } = require('@strapi/strapi').factories;
module.exports = createCoreService('api::demo-video.demo-video');

View File

@ -1,5 +1,5 @@
import type { Schema, Attribute } from '@strapi/strapi';
declare module '@strapi/types' {
declare module '@strapi/strapi' {
export module Shared {}
}

View File

@ -23,7 +23,6 @@ export interface AdminPermission extends Schema.CollectionType {
Attribute.SetMinMaxLength<{
minLength: 1;
}>;
actionParameters: Attribute.JSON & Attribute.DefaultTo<{}>;
subject: Attribute.String &
Attribute.SetMinMaxLength<{
minLength: 1;
@ -702,6 +701,36 @@ export interface ApiBlogBlog extends Schema.CollectionType {
};
}
export interface ApiDemoVideoDemoVideo extends Schema.SingleType {
collectionName: 'demo_videos';
info: {
singularName: 'demo-video';
pluralName: 'demo-videos';
displayName: 'Demo-Video';
};
options: {
draftAndPublish: true;
};
attributes: {
Video: Attribute.Media & Attribute.Required;
createdAt: Attribute.DateTime;
updatedAt: Attribute.DateTime;
publishedAt: Attribute.DateTime;
createdBy: Attribute.Relation<
'api::demo-video.demo-video',
'oneToOne',
'admin::user'
> &
Attribute.Private;
updatedBy: Attribute.Relation<
'api::demo-video.demo-video',
'oneToOne',
'admin::user'
> &
Attribute.Private;
};
}
export interface ApiDiscussionDiscussion extends Schema.CollectionType {
collectionName: 'discussions';
info: {
@ -903,7 +932,7 @@ export interface ApiUseCaseUseCase extends Schema.CollectionType {
};
}
declare module '@strapi/types' {
declare module '@strapi/strapi' {
export module Shared {
export interface ContentTypes {
'admin::permission': AdminPermission;
@ -920,6 +949,7 @@ declare module '@strapi/types' {
'plugin::users-permissions.role': PluginUsersPermissionsRole;
'plugin::users-permissions.user': PluginUsersPermissionsUser;
'api::blog.blog': ApiBlogBlog;
'api::demo-video.demo-video': ApiDemoVideoDemoVideo;
'api::discussion.discussion': ApiDiscussionDiscussion;
'api::testimonial.testimonial': ApiTestimonialTestimonial;
'api::use-case.use-case': ApiUseCaseUseCase;