Skip to content

Commit

Permalink
Merge pull request #21 from incubateur-ademe/feat/add-fields-rex-diag
Browse files Browse the repository at this point in the history
feat: add the image with caption component for rex diag
  • Loading branch information
rtaieb authored Feb 14, 2025
2 parents b578194 + d9d56be commit 92895af
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@
"allowedTypes": [
"files"
]
},
"resultats_images": {
"type": "component",
"repeatable": true,
"component": "common.image-with-caption"
}
}
}
23 changes: 23 additions & 0 deletions src/components/common/image-with-caption.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"collectionName": "components_common_image_with_captions",
"info": {
"displayName": "image_with_caption"
},
"options": {},
"attributes": {
"caption": {
"type": "string"
},
"image": {
"allowedTypes": [
"images",
"files",
"videos",
"audios"
],
"type": "media",
"multiple": false,
"required": true
}
}
}
7 changes: 7 additions & 0 deletions types/api/retour-experience-diagnostic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ import { Media } from '../common/Media';
import { Citation } from '../components/common/Citation';
import { LienRexDiagnostic } from './lien-rex-diagnostic';
import { Contact } from '../components/retour-experience/Contact';
import { ImageWithCaption } from '../components/common/ImageWithCaption';
import { Media_Plain } from '../common/Media';
import { Citation_Plain } from '../components/common/Citation';
import { LienRexDiagnostic_Plain } from './lien-rex-diagnostic';
import { Contact_Plain } from '../components/retour-experience/Contact';
import { ImageWithCaption_Plain } from '../components/common/ImageWithCaption';
import { Citation_NoRelations } from '../components/common/Citation';
import { Contact_NoRelations } from '../components/retour-experience/Contact';
import { ImageWithCaption_NoRelations } from '../components/common/ImageWithCaption';
import { AdminPanelRelationPropertyModification } from '../common/AdminPanelRelationPropertyModification';

export interface RetourExperienceDiagnostic {
Expand All @@ -36,6 +39,7 @@ export interface RetourExperienceDiagnostic {
contacts: Contact[];
credits?: any;
guide_pdf?: { data: Media };
resultats_images: ImageWithCaption[];
};
}
export interface RetourExperienceDiagnostic_Plain {
Expand All @@ -61,6 +65,7 @@ export interface RetourExperienceDiagnostic_Plain {
contacts: Contact_Plain[];
credits?: any;
guide_pdf?: Media_Plain;
resultats_images: ImageWithCaption_Plain[];
}

export interface RetourExperienceDiagnostic_NoRelations {
Expand All @@ -86,6 +91,7 @@ export interface RetourExperienceDiagnostic_NoRelations {
contacts: Contact_NoRelations[];
credits?: any;
guide_pdf?: number;
resultats_images: ImageWithCaption_NoRelations[];
}

export interface RetourExperienceDiagnostic_AdminPanelLifeCycle {
Expand All @@ -111,4 +117,5 @@ export interface RetourExperienceDiagnostic_AdminPanelLifeCycle {
contacts: Contact_Plain[];
credits?: any;
guide_pdf?: AdminPanelRelationPropertyModification<Media_Plain>;
resultats_images: ImageWithCaption_Plain[];
}
19 changes: 19 additions & 0 deletions types/components/common/ImageWithCaption.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Interface automatically generated by schemas-to-ts

import { Media } from '../../common/Media';
import { Media_Plain } from '../../common/Media';

export interface ImageWithCaption {
caption?: string;
image: { data: Media };
}
export interface ImageWithCaption_Plain {
caption?: string;
image: Media_Plain;
}

export interface ImageWithCaption_NoRelations {
caption?: string;
image: number;
}

13 changes: 13 additions & 0 deletions types/generated/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ export interface CommonCitation extends Schema.Component {
};
}

export interface CommonImageWithCaption extends Schema.Component {
collectionName: 'components_common_image_with_captions';
info: {
displayName: 'image_with_caption';
};
attributes: {
caption: Attribute.String;
image: Attribute.Media<'images' | 'files' | 'videos' | 'audios'> &
Attribute.Required;
};
}

export interface FicheDiagnosticEtapeMiseEnOeuvre extends Schema.Component {
collectionName: 'components_fiche_diagnostic_etape_mise_en_oeuvres';
info: {
Expand Down Expand Up @@ -257,6 +269,7 @@ declare module '@strapi/types' {
export module Shared {
export interface Components {
'common.citation': CommonCitation;
'common.image-with-caption': CommonImageWithCaption;
'fiche-diagnostic.etape-mise-en-oeuvre': FicheDiagnosticEtapeMiseEnOeuvre;
'fiche-diagnostic.utilite-methode': FicheDiagnosticUtiliteMethode;
'fiche-solution.aide-regionale': FicheSolutionAideRegionale;
Expand Down
1 change: 1 addition & 0 deletions types/generated/contentTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1995,6 +1995,7 @@ export interface ApiRetourExperienceDiagnosticRetourExperienceDiagnostic
}
>;
guide_pdf: Attribute.Media<'files'>;
resultats_images: Attribute.Component<'common.image-with-caption', true>;
createdAt: Attribute.DateTime;
updatedAt: Attribute.DateTime;
publishedAt: Attribute.DateTime;
Expand Down

0 comments on commit 92895af

Please sign in to comment.