Skip to content

Commit cbd87f5

Browse files
nlepageyannbertrand
authored andcommitted
poc: integration d’un POIP
1 parent ad86ed7 commit cbd87f5

File tree

5 files changed

+77
-15
lines changed

5 files changed

+77
-15
lines changed

api/src/devcomp/infrastructure/datasources/learning-content/modules/bac-a-sable.json

+44
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,50 @@
6161
}
6262
]
6363
},
64+
{
65+
"id": "0d4ef09a-ebb8-4514-a037-8fb22e540d7d",
66+
"type": "lesson",
67+
"title": "test web component",
68+
"components": [
69+
{
70+
"type": "element",
71+
"element": {
72+
"id": "96e2457d-54d3-461a-97e4-69180a30bfb7",
73+
"type": "text",
74+
"content": "<p>Voici un web component</p>"
75+
}
76+
},
77+
{
78+
"type": "element",
79+
"element": {
80+
"id": "cfec5a0e-2ed5-462f-8974-e5ca25faae39",
81+
"type": "custom",
82+
"tagName": "cartes-a-retourner",
83+
"props": {
84+
"cardsPerLine": 4,
85+
"cards": [
86+
{
87+
"frontImageUrl": "https://i.imgur.com/ynIpt6T.png",
88+
"backImageUrl": "https://i.imgur.com/prjj6bH.png"
89+
},
90+
{
91+
"frontImageUrl": "https://i.imgur.com/Gcy9yUl.png",
92+
"backImageUrl": "https://i.imgur.com/HVZcy58.png"
93+
},
94+
{
95+
"frontImageUrl": "https://i.imgur.com/k2istl3.png",
96+
"backImageUrl": "https://i.imgur.com/ww44Phm.png"
97+
},
98+
{
99+
"frontImageUrl": "https://i.imgur.com/6MLS2tU.png",
100+
"backImageUrl": "https://i.imgur.com/chQSy0B.png"
101+
}
102+
]
103+
}
104+
}
105+
}
106+
]
107+
},
64108
{
65109
"id": "0d4ef09a-ebb8-4514-a037-8fb22e540d7c",
66110
"type": "discovery",

mon-pix/app/app.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import './deprecation-workflow';
2-
import '@1024pix/web-components';
2+
import '@1024pix/epreuves-components';
33

44
import Application from '@ember/application';
55
import { init as initSentry } from '@sentry/ember';

mon-pix/app/components/module/element/web-component.gjs

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { on } from '@ember/modifier';
21
import { action } from '@ember/object';
3-
import { eq } from 'ember-truth-helpers';
2+
import { element } from 'ember-element-helper';
43

54
import ModuleElement from './module-element';
65

@@ -16,9 +15,9 @@ export default class ModulixWebComponent extends ModuleElement {
1615
<template>
1716
<div class="element-webcomponent">
1817
<div class="element-webcomponent__container">
19-
{{#if (eq @component.tagName "qcu-image")}}
20-
<qcu-image props={{@component.props}} />
21-
{{/if}}
18+
{{#let (element @component.tagName) as |Tag|}}
19+
<Tag props={{@component.props}} />
20+
{{/let}}
2221
</div>
2322
</div>
2423
</template>

mon-pix/package-lock.json

+26-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mon-pix/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@
4646
"@1024pix/ember-api-actions": "^1.1.0",
4747
"@1024pix/ember-matomo-tag-manager": "^2.4.3",
4848
"@1024pix/ember-testing-library": "^3.0.6",
49+
"@1024pix/epreuves-components": "^0.1.0",
4950
"@1024pix/eslint-plugin": "^2.1.1",
5051
"@1024pix/pix-ui": "^55.6.0",
5152
"@1024pix/stylelint-config": "^5.1.28",
52-
"@1024pix/web-components": "^0.2.7",
5353
"@babel/eslint-parser": "^7.25.1",
5454
"@babel/plugin-proposal-decorators": "^7.24.7",
5555
"@ember-data/json-api": "^5.3.8",
@@ -85,6 +85,7 @@
8585
"ember-cookies": "^1.0.0",
8686
"ember-data": "^5.3.8",
8787
"ember-dayjs": "^0.12.0",
88+
"ember-element-helper": "^0.8.6",
8889
"ember-eslint-parser": "^0.5.0",
8990
"ember-exam": "^9.0.0",
9091
"ember-fetch": "^8.1.2",

0 commit comments

Comments
 (0)