ode-ngjs-front 1.4.9-develop-integration.202503172206 → 1.4.9-develop-integration.202503191606
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ode-ngjs-front.js +2 -2
- package/dist/ode-ngjs-front.js.map +1 -1
- package/dist/ts/modules/widgets.module.d.ts +2 -1
- package/dist/ts/modules/widgets.module.d.ts.map +1 -1
- package/dist/ts/services/theme-helper.service.d.ts.map +1 -1
- package/dist/ts/widgets/cantine-widget/cantine-widget.widget.d.ts.map +1 -1
- package/dist/ts/widgets/ptit-observatoire-widget/ptit-observatoire-widget.widget.d.ts +2 -0
- package/dist/ts/widgets/ptit-observatoire-widget/ptit-observatoire-widget.widget.d.ts.map +1 -0
- package/dist/version.txt +1 -1
- package/dist/widgets/cantine-widget/cantine-widget.widget.js +1 -1
- package/dist/widgets/cantine-widget/cantine-widget.widget.js.map +1 -1
- package/dist/widgets/ptit-observatoire-widget/ptit-observatoire-widget.widget.js +2 -0
- package/dist/widgets/ptit-observatoire-widget/ptit-observatoire-widget.widget.js.map +1 -0
- package/package.json +1 -1
|
@@ -17,7 +17,8 @@ export declare enum KnownWidget {
|
|
|
17
17
|
lastInfos = "last-infos-widget",
|
|
18
18
|
edumalin = "edumalin-widget",
|
|
19
19
|
mediacentre = "mediacentre-widget",
|
|
20
|
-
cantine = "cantine-widget"
|
|
20
|
+
cantine = "cantine-widget",
|
|
21
|
+
ptitObservatoire = "ptit-observatoire-widget"
|
|
21
22
|
}
|
|
22
23
|
export declare type WidgetLoader = (widgetName: String) => Promise<void>;
|
|
23
24
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widgets.module.d.ts","sourceRoot":"","sources":["../../../src/ts/modules/widgets.module.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAQ,OAAO,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"widgets.module.d.ts","sourceRoot":"","sources":["../../../src/ts/modules/widgets.module.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAQ,OAAO,EAAE,MAAM,SAAS,CAAC;AA2CjD,oBAAY,WAAW;IACnB,SAAS,qBAA2B;IACpC,MAAM,kBAA2B;IACjC,MAAM,kBAA2B;IACjC,QAAQ,cAAqB;IAC7B,MAAM,kBAA2B;IACjC,KAAK,UAAoB;IACzB,QAAQ,oBAA2B;IACnC,GAAG,eAA2B;IAC9B,MAAM,YAAqB;IAC3B,YAAY,mBAAsB;IAClC,YAAY,wBAA2B;IACvC,QAAQ,oBAA2B;IACnC,WAAW,uBAA2B;IACtC,OAAO,mBAA2B;IAClC,SAAS,sBAA4B;IACrC,QAAQ,oBAA2B;IACnC,WAAW,uBAA2B;IACtC,OAAO,mBAA2B;IAClC,gBAAgB,6BAA6B;CAEhD;AACD,oBAAY,YAAY,GAAG,CAAC,UAAU,EAAC,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAyY9D;;GAEG;AACH,wBAAgB,eAAe,IAAG,OAAO,CAExC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-helper.service.d.ts","sourceRoot":"","sources":["../../../src/ts/services/theme-helper.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAc,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAItD;;GAEG;AACH,qBAAa,kBAAkB;
|
|
1
|
+
{"version":3,"file":"theme-helper.service.d.ts","sourceRoot":"","sources":["../../../src/ts/services/theme-helper.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAc,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAItD;;GAEG;AACH,qBAAa,kBAAkB;IA8BvB,OAAO,CAAC,WAAW;IA7BvB,MAAM,CAAC,OAAO,WAAyB;IAEvC,OAAO,CAAC,YAAY,CAwBnB;gBAGW,WAAW,EAAC,eAAe;IAIvC,OAAO,KAAK,QAAQ,GAEnB;IAED,uCAAuC;IACvC,IAAI,GAAG,WAEN;IAED,8FAA8F;IACxF,qBAAqB,IAAG,OAAO,CAAC,MAAM,CAAC;IAW7C,4GAA4G;IACtG,oBAAoB,IAAG,OAAO,CAAC,MAAM,CAAC;IAM5C,SAAS,CAAE,GAAG,EAAC,MAAM,GAAG,MAAM;IAa9B;;;OAGG;IACH,mBAAmB,CAAE,QAAQ,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM;IAYrD,4CAA4C;IAC5C,WAAW,CAAE,KAAK,EAAC,MAAM;IAWzB,iCAAiC;IAC3B,UAAU,CAAE,SAAS,EAAC,MAAM;IA8BlC,qEAAqE;IACrE,UAAU,IAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAIlC,2FAA2F;IACrF,QAAQ,CAAE,KAAK,EAAC,UAAU;IAMhC;;OAEG;IACF,WAAW,CAAE,GAAG,EAAC,OAAO,GAAG,MAAM;IA2BlC,wCAAwC;IACxC,kBAAkB,CAAE,MAAM,EAAC,OAAO,GAAG,MAAM;CAG9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cantine-widget.widget.d.ts","sourceRoot":"","sources":["../../../../src/ts/widgets/cantine-widget/cantine-widget.widget.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cantine-widget.widget.d.ts","sourceRoot":"","sources":["../../../../src/ts/widgets/cantine-widget/cantine-widget.widget.ts"],"names":[],"mappings":"AA8HA,eAAO,MAAM,aAAa,2BAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ptit-observatoire-widget.widget.d.ts","sourceRoot":"","sources":["../../../../src/ts/widgets/ptit-observatoire-widget/ptit-observatoire-widget.widget.ts"],"names":[],"mappings":"AAgIA,eAAO,MAAM,aAAa,oCAAoC,CAAC"}
|
package/dist/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
ode-ngjs-front
|
|
1
|
+
ode-ngjs-front 19/03/2025 16:07:37
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkode_ngjs_front=self.webpackChunkode_ngjs_front||[]).push([[91],{4798:(e,t,
|
|
1
|
+
"use strict";(self.webpackChunkode_ngjs_front=self.webpackChunkode_ngjs_front||[]).push([[91],{4798:(e,t,i)=>{i.d(t,{Z:()=>n});const n='<style>.menu-card{color:#333;justify-content:center;align-items:center;padding:5%;border-radius:10px;box-shadow:0 0 10px rgba(0,0,0,.1)}.separator{border:none;height:1px;background-color:#ccc;margin:3% 0}.section{margin-bottom:3%}.section-title{font-weight:700;font-size:1.1em;display:flex;align-items:center}.item{margin-left:1%;font-family:Arimo;color:#4a4a4a;font-size:medium}.item{align-items:center;gap:5px}.items-container{border-left:2px solid #ccc;margin-left:.8%;padding-left:3%}.icon{width:1em;height:1em;margin-left:5px;vertical-align:middle;display:inline-block;margin-bottom:10px}.dot{height:.6em;width:.6em;border-radius:50%;display:inline-block;margin-right:2%}.allergen-collapse{background-color:#f9f9f9;border-radius:5px;padding:0;display:none;transition:all .3s ease-in-out;font-size:.9em}.allergen-collapse.open{display:block}.collapse-toggle{background-color:#f7c75c;border:none;padding:0 10px;border-radius:5px;font-weight:700;cursor:pointer;display:block;margin-top:0;color:#fff;font-size:.8em}.collapse-toggle:hover{background-color:#e6b848}.red{background-color:red}.green{background-color:green}.blue{background-color:#00f}.yellow{background-color:orange}</style> <div class="widget-dashboard"> <div class="menu-card"> <h2 style="color:#333;font-family:Roboto,sans-serif"> <i18n>cantine.title</i18n> </h2> <div class="separator"></div> <i18n>cantine.date</i18n> <div class="section"> <div class="section-title"> <span class="dot red"></span> <i18n>cantine.entree</i18n> </div> <div class="items-container"> <div class="item" ng-repeat="item in ctrl.data.entrees"> {{ ctrl.formatName(item.nom) }} <img ng-if="item.bio" src="/assets/widgets/cantine-widget/cantine-logos/bio-logo.png" alt="Bio" class="icon"> <img ng-if="item.faitmaison" src="/assets/widgets/cantine-widget/cantine-logos/fait-maison-logo.png" alt="Fait Maison" class="icon"> <img ng-if="item.vegetarien" src="/assets/widgets/cantine-widget/cantine-logos/vegetarien-logo.png" alt="Vegetarian" class="icon"> <img ng-if="item.local" src="/assets/widgets/cantine-widget/cantine-logos/produit-local-logo.png" alt="Local Product" class="icon"> <button class="collapse-toggle" ng-click="item.showAllergies = !item.showAllergies" ng-if="ctrl.getAllergies(item).length > 0"> ⚠️ Allergens </button> <div class="allergen-collapse" ng-class="{\'open\': item.showAllergies}" ng-if="ctrl.getAllergies(item).length > 0"> <span>{{ ctrl.getAllergies(item).join(\', \') }}</span> </div> </div> </div> </div> <div class="section"> <div class="section-title"> <span class="dot green"></span> <i18n>cantine.plat</i18n> </div> <div class="items-container"> <div class="item" ng-repeat="item in ctrl.data.plats"> {{ ctrl.formatName(item.nom) }} <img ng-if="item.bio" src="/assets/widgets/cantine-widget/cantine-logos/bio-logo.png" alt="Bio" class="icon"> <img ng-if="item.faitmaison" src="/assets/widgets/cantine-widget/cantine-logos/fait-maison-logo.png" alt="Fait Maison" class="icon"> <img ng-if="item.vegetarien" src="/assets/widgets/cantine-widget/cantine-logos/vegetarien-logo.png" alt="Vegetarian" class="icon"> <img ng-if="item.local" src="/assets/widgets/cantine-widget/cantine-logos/produit-local-logo.png" alt="Local Product" class="icon"> <button class="collapse-toggle" ng-click="item.showAllergies = !item.showAllergies" ng-if="ctrl.getAllergies(item).length > 0"> ⚠️ Allergens </button> <div class="allergen-collapse" ng-class="{\'open\': item.showAllergies}" ng-if="ctrl.getAllergies(item).length > 0"> <span>{{ ctrl.getAllergies(item).join(\', \') }}</span> </div> </div> </div> </div> <div class="section"> <div class="section-title"> <span class="dot blue"></span> <i18n>cantine.accompagnement</i18n> </div> <div class="items-container"> <div class="item" ng-repeat="item in ctrl.data.accompagnements"> {{ ctrl.formatName(item.nom) }} <img ng-if="item.bio" src="/assets/widgets/cantine-widget/cantine-logos/bio-logo.png" alt="Bio" class="icon"> <img ng-if="item.faitmaison" src="/assets/widgets/cantine-widget/cantine-logos/fait-maison-logo.png" alt="Fait Maison" class="icon"> <img ng-if="item.vegetarien" src="/assets/widgets/cantine-widget/cantine-logos/vegetarien-logo.png" alt="Vegetarian" class="icon"> <img ng-if="item.local" src="/assets/widgets/cantine-widget/cantine-logos/produit-local-logo.png" alt="Local Product" class="icon"> <button class="collapse-toggle" ng-click="item.showAllergies = !item.showAllergies" ng-if="ctrl.getAllergies(item).length > 0"> ⚠️ Allergens </button> <div class="allergen-collapse" ng-class="{\'open\': item.showAllergies}" ng-if="ctrl.getAllergies(item).length > 0"> <span>{{ ctrl.getAllergies(item).join(\', \') }}</span> </div> </div> </div> </div> <div class="section"> <div class="section-title"> <span class="dot yellow"></span> <i18n>cantine.dessert</i18n> </div> <div class="items-container"> <div class="item" ng-repeat="item in ctrl.data.desserts"> {{ ctrl.formatName(item.nom) }} <img ng-if="item.bio" src="/assets/widgets/cantine-widget/cantine-logos/bio-logo.png" alt="Bio" class="icon"> <img ng-if="item.faitmaison" src="/assets/widgets/cantine-widget/cantine-logos/fait-maison-logo.png" alt="Fait Maison" class="icon"> <img ng-if="item.vegetarien" src="/assets/widgets/cantine-widget/cantine-logos/vegetarien-logo.png" alt="Vegetarian" class="icon"> <img ng-if="item.local" src="/assets/widgets/cantine-widget/cantine-logos/produit-local-logo.png" alt="Local Product" class="icon"> <button class="collapse-toggle" ng-click="item.showAllergies = !item.showAllergies" ng-if="ctrl.getAllergies(item).length > 0"> ⚠️ Allergens </button> <div class="allergen-collapse" ng-class="{\'open\': item.showAllergies}" ng-if="ctrl.getAllergies(item).length > 0"> <span>{{ ctrl.getAllergies(item).join(\', \') }}</span> </div> </div> </div> </div> </div> </div>'},8544:function(e,t,i){var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(l,a){function s(e){try{r(n.next(e))}catch(e){a(e)}}function o(e){try{r(n.throw(e))}catch(e){a(e)}}function r(e){var t;e.done?l(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,o)}r((n=n.apply(e,t||[])).next())}))},l=this&&this.__generator||function(e,t){var i,n,l,a,s={label:0,sent:function(){if(1&l[0])throw l[1];return l[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(a){return function(o){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(l=2&a[0]?n.return:a[0]?n.throw||((l=n.return)&&l.call(n),0):n.next)&&!(l=l.call(n,a[1])).done)return l;switch(n=0,l&&(a=[2&a[0],l.value]),a[0]){case 0:case 1:l=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(l=s.trys,(l=l.length>0&&l[l.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!l||a[1]>l[0]&&a[1]<l[3])){s.label=a[1];break}if(6===a[0]&&s.label<l[1]){s.label=l[1],l=a;break}if(l&&s.label<l[2]){s.label=l[2],s.ops.push(a);break}l[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{i=l=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,o])}}},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.odeModuleName=void 0;var s=a(i(4202)),o=i(9419),r=function(){function e(){this.data={},this.error=null}return e.prototype.getAllergies=function(e){if(!e)return[];return["allerg_anhydride","allerg_arachide","allerg_celeri","allerg_crustace","allerg_fruit_coque","allerg_gluten","allerg_lait","allerg_lupin","allerg_mollusque","allerg_moutarde","allerg_oeuf","allerg_poisson","allerg_sesame","allerg_soja"].filter((function(t){return 0!==e[t]&&void 0!==e[t]})).map((function(e){return e.replace("allerg_","").replace("_"," ")}))},e.prototype.formatName=function(e){return e.toLowerCase().replace(/(^\w|\s\w)/g,(function(e){return e.toUpperCase()}))},e}(),c=function(){function e(){this.restrict="E",this.template=i(4798).Z,this.scope={},this.bindToController=!0,this.controller=[r],this.controllerAs="ctrl",this.require=["odeCantineWidget"]}return e.prototype.link=function(e,t,i,a){return n(this,void 0,void 0,(function(){var t;return l(this,(function(i){switch(i.label){case 0:return(t=a?a[0]:null)?[4,(0,o.http)().get("/appregistry/0770000X/cantine/menu").then((function(i){if(i.menu){var n=i.menu;if(t.data={entrees:n.filter((function(e){return"entree"===e.type})),plats:n.filter((function(e){return"plat"===e.type})),accompagnements:n.filter((function(e){return"accompagnement"===e.type})),desserts:n.filter((function(e){return"dessert"===e.type}))},t.data.entrees&&t.data.entrees.length>0){var l=s.default.copy(t.data.entrees[0]);l.allerg_lupin=1,l.allerg_arachide=1,t.data.entrees[0]=l,e.$apply()}}else t.error=i.error})).catch((function(e){console.error("Error fetching menu:",e),t.error="An error occurred while fetching the menu."}))]:[2];case 1:return i.sent(),[2]}}))}))},e}();(0,o.notif)().onLangReady().promise.then((function(e){(0,o.conf)().Platform.idiom.addKeys(i(4848))})),t.odeModuleName="odeCantineWidgetModule",s.default.module(t.odeModuleName,[]).directive("odeCantineWidget",(function(){return new c}))},4848:e=>{e.exports=JSON.parse('{"cantine.title":"Cantine","cantine.entree":"Entrée","cantine.plat":"Plat","cantine.accompagnement":"Accompagnement","cantine.dessert":"Dessert"}')}}]);
|
|
2
2
|
//# sourceMappingURL=cantine-widget.widget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widgets/cantine-widget/cantine-widget.widget.js","mappings":"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","sources":["webpack://ode-ngjs-front/./src/ts/widgets/cantine-widget/cantine-widget.widget.html","webpack://ode-ngjs-front/./src/ts/widgets/cantine-widget/cantine-widget.widget.ts"],"sourcesContent":["// Module\nvar code = \"<style>.menu-card{font-family:Roboto,sans-serif;color:#333;justify-content:center;align-items:center;padding:5%;border-radius:10px;box-shadow:0 0 10px rgba(0,0,0,.1)}.separator{border:none;height:1px;background-color:#ccc;margin:3% 0}.section{margin-bottom:3%}.section-title{font-weight:700;font-size:1.1em;display:flex;align-items:center}.item{margin-left:1%}.items-container{border-left:2px solid #ccc;margin-left:.8%;padding-left:3%}.dot{height:.6em;width:.6em;border-radius:50%;display:inline-block;margin-right:2%}.red{background-color:red}.green{background-color:green}.blue{background-color:#00f}.yellow{background-color:orange}</style> <div class=\\\"widget-dashboard\\\"> <div class=\\\"menu-card\\\"> <h2 style=\\\"color:#333\\\"> <i18n>cantine.title</i18n> </h2> <div class=\\\"separator\\\"></div> <i18n>cantine.date</i18n> <div class=\\\"section\\\"> <div class=\\\"section-title\\\"> <span class=\\\"dot red\\\"></span> <i18n>cantine.petit-dejeuner</i18n> </div> <div class=\\\"items-container\\\"> <div class=\\\"item\\\">Salade de pommes de terres aux algues & échalotes</div> <div class=\\\"item\\\">Salade verte bio</div> </div> </div> <div class=\\\"section\\\"> <div class=\\\"section-title\\\"> <span class=\\\"dot green\\\"></span> <i18n>cantine.dejeuner</i18n> </div> <div class=\\\"items-container\\\"> <div class=\\\"item\\\">Colin meunière</div> </div> </div> <div class=\\\"section\\\"> <div class=\\\"section-title\\\"> <span class=\\\"dot blue\\\"></span> <i18n>cantine.gouter</i18n> </div> <div class=\\\"items-container\\\"> <div class=\\\"item\\\">Haricots verts persillés</div> </div> </div> <div class=\\\"section\\\"> <div class=\\\"section-title\\\"> <span class=\\\"dot yellow\\\"></span> <i18n>cantine.diner</i18n> </div> <div class=\\\"items-container\\\"> <div class=\\\"item\\\">Fromage à la coupe</div> </div> </div> <div class=\\\"section\\\"> <div class=\\\"section-title\\\"> <span class=\\\"dot red\\\"></span>Dessert </div> <div class=\\\"item\\\">Fruits de saison</div> </div> </div> </div>\";\n// Exports\nexport default code;","import angular, { IAttributes, IController, IDirective, IScope } from \"angular\";\nimport { conf, notif, http, session, Base64 } from \"../../utils\";\nimport moment from \"moment\";\n\nclass Controller implements IController {\n data: any = {};\n error: any = null;\n public currentWidget: any;\n public showLightbox = false;\n\n urlGar: string =\"https://youtube.com\";\n\n onButtonClick(link: string, eventType: String) {\n // Track this event.\n if (eventType && eventType.length > 0) {\n this.trackEvent(eventType);\n }\n\n window.open(link, \"_blank\");\n }\n\n protected get isDataLoaded() {\n return this.data.length > 0;\n }\n\n dateFormat(dateTime: any) {\n let date = moment(dateTime).format(\"L\");\n return date;\n }\n\n isTypeRDV(type: any) {\n return type == \"RDV\";\n }\n\n isTypeWebinaire(type: any) {\n return type == \"Webinaire\";\n }\n\n displayIcon(type: any) {\n switch (type) {\n case \"RDV\":\n return \"fa-calendar-alt\";\n case \"Webinaire\":\n return \"fa-video\";\n case \"Annonce\":\n return \"fa-bullhorn\";\n case \"Actualité\":\n return \"fa-newspaper\";\n case \"Temoignage\":\n return \"fa-microphone-lines\";\n case \"Podcast\":\n return \"fa-headset\";\n case \"Replay\":\n return \"fa-rotate-left\";\n case \"Tutoriel\":\n return \"fa-wand-magic-sparkles\";\n default:\n return \"fa-info\";\n }\n }\n\n displayIconColor(type: any) {\n switch (type) {\n case \"RDV\":\n return \"#2a9cc8\";\n case \"Webinaire\":\n return \"#20c997\";\n case \"Annonce\":\n return \"#E13A3A\";\n case \"Actualité\":\n return \"#FF8D2E\";\n case \"Temoignage\":\n return \"#2029B6\";\n case \"Podcast\":\n return \"#823AA1\";\n case \"Replay\":\n return \"#46BFAF\";\n case \"Tutoriel\":\n return \"#ecbe30\";\n default:\n return \"#f59700\";\n }\n }\n\n openLightBox(contentType: any, e: Event) {\n this.currentWidget = contentType;\n this.showLightbox = true;\n\n // Track this event.\n if (e.currentTarget) {\n this.trackEvent(\"\");\n }\n }\n\n isURL(str: String) {\n if (\n str &&\n str.length > 0 &&\n (str.startsWith(\"http://\") || str.startsWith(\"https://\"))\n ) {\n return true;\n }\n return false;\n }\n\n generateLinkGar() {\n if (\n session().description &&\n session().description.schools &&\n session().description.schools.length > 0\n ) {\n let school = session().description.schools[0];\n let UAIb64: string = Base64.encode(school?.UAI != null ? school.UAI : \"\");\n let exports: string[] = school.exports != null ? school.exports : [];\n let codeGar = \"\";\n if (exports != null) {\n for (let i = 0; i < exports.length; ++i)\n if (exports[i].startsWith(\"GAR-\")) {\n codeGar = exports[i].replace(\"GAR-\", \"\");\n break;\n }\n if (codeGar == \"\") codeGar = exports[0];\n }\n let codeGARb64 = Base64.encode(codeGar);\n\n return this.urlGar\n .replace(\"ID_ETAB\", UAIb64)\n .replace(\"ID_ENT\", codeGARb64);\n }\n\n return \"https://youtube.fr/\";\n }\n\n // Give an opportunity to track some events from outside of this component.\n protected trackEvent(eventType: String) {\n // Track this event.\n if (eventType && eventType.length > 0) {\n const eventJson: any = {\n \"event-type\": eventType,\n modal: \"Timeline\",\n };\n\n http()\n .post(\"/infra/event/web/store\", eventJson)\n .catch((e) => {\n console.debug(\"[TrackingInternal] failed to trackEvent: \", e);\n });\n }\n }\n\n encodeUrlPicture(url: string) {\n return encodeURI(url);\n }\n}\n\n/* Directive */\nclass Directive\n implements IDirective<IScope, JQLite, IAttributes, IController[]>\n{\n restrict = \"E\";\n template = require(\"./cantine-widget.widget.html\").default;\n scope = {};\n bindToController = true;\n controller = [Controller];\n controllerAs = \"ctrl\";\n require = [\"odeCantineWidget\"];\n\n async link(\n scope: IScope,\n elem: JQLite,\n attrs: IAttributes,\n controllers?: IController[]\n ) {\n const ctrl: Controller | null = controllers\n ? (controllers[0] as Controller)\n : null;\n if (!ctrl) {\n return;\n }\n\n await http()\n .get(\"/appregistry/cantine/widget\")\n .then((response) => {\n if (response.success) {\n ctrl.data = response.data;\n scope.$apply();\n } else {\n ctrl.error = response.error;\n }\n });\n }\n}\n\n/** The cantine widget. */\nfunction DirectiveFactory() {\n return new Directive();\n}\n\n// Preload translations\nnotif()\n .onLangReady()\n .promise.then((lang) => {\n switch (lang) {\n default:\n conf().Platform.idiom.addKeys(require(\"./i18n/fr.json\"));\n break;\n }\n });\n\n// THIS ANGULAR MODULE WILL BE DYNAMICALLY ADDED TO THE APPLICATION.\n// RESPECT THE NAMING CONVENTION BY EXPORTING THE MODULE NAME :\nexport const odeModuleName = \"odeCantineWidgetModule\";\nangular\n .module(odeModuleName, [])\n .directive(\"odeCantinWidget\", DirectiveFactory);\n"],"names":["data","error","showLightbox","urlGar","onButtonClick","link","eventType","length","this","trackEvent","window","open","dateFormat","dateTime","format","isTypeRDV","type","isTypeWebinaire","displayIcon","displayIconColor","openLightBox","contentType","e","currentWidget","currentTarget","isURL","str","startsWith","generateLinkGar","session","description","schools","school","UAIb64","Base64","encode","UAI","exports","codeGar","i","replace","codeGARb64","eventJson","modal","http","post","catch","console","debug","encodeUrlPicture","url","encodeURI","restrict","template","scope","bindToController","controller","Controller","controllerAs","require","elem","attrs","controllers","ctrl","get","then","response","success","$apply","notif","onLangReady","promise","lang","conf","Platform","idiom","addKeys","odeModuleName","module","directive","Directive"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"widgets/cantine-widget/cantine-widget.widget.js","mappings":"+HAGA,QAFW,8pL,8iDCDX,iBACA,UAGA,0BACE,KAAAA,KAAY,CAAC,EACb,KAAAC,MAAa,IAqCf,QAlCE,YAAAC,aAAA,SAAaC,GAEX,IAAKA,EACH,MAAO,GAoBT,MAjBoB,CAClB,mBACA,kBACA,gBACA,kBACA,qBACA,gBACA,cACA,eACA,mBACA,kBACA,cACA,iBACA,gBACA,eAICC,QAAO,SAACC,GAAQ,OAAc,IAAdF,EAAKE,SAA4BC,IAAdH,EAAKE,EAAxB,IAChBE,KAAI,SAACF,GAAQ,OAAAA,EAAIG,QAAQ,UAAW,IAAIA,QAAQ,IAAK,IAAxC,GAClB,EAGA,YAAAC,WAAA,SAAWC,GACT,OAAOA,EACJC,cACAH,QAAQ,eAAe,SAACI,GAAU,OAAAA,EAAMC,aAAN,GACvC,EACF,EAvCA,GA0CA,0BACE,KAAAC,SAAW,IACX,KAAAC,SAAW,UACX,KAAAC,MAAQ,CAAC,EACT,KAAAC,kBAAmB,EACnB,KAAAC,WAAa,CAACC,GACd,KAAAC,aAAe,OACf,KAAAC,QAAU,CAAC,mBAqDb,QAnDQ,YAAAC,KAAN,SAAWN,EAAeO,EAAcC,EAAoBC,G,gGAE1D,OADMC,EAA0BD,EAAeA,EAAY,GAAoB,MAK/E,IAAM,IAAAE,QACHC,IAAI,sCACJC,MAAK,SAACC,GACL,GAAIA,EAASC,KAAM,CACjB,IAAMA,EAAOD,EAASC,KAoBtB,GAjBAL,EAAK1B,KAAO,CACVgC,QAASD,EAAK3B,QAAO,SAACD,GAAc,MAAc,WAAdA,EAAK8B,IAAL,IACpCC,MAAOH,EAAK3B,QAAO,SAACD,GAAc,MAAc,SAAdA,EAAK8B,IAAL,IAClCE,gBAAiBJ,EAAK3B,QAAO,SAACD,GAAc,MAAc,mBAAdA,EAAK8B,IAAL,IAC5CG,SAAUL,EAAK3B,QAAO,SAACD,GAAc,MAAc,YAAdA,EAAK8B,IAAL,KAanCP,EAAK1B,KAAKgC,SAAWN,EAAK1B,KAAKgC,QAAQK,OAAS,EAAG,CACrD,IAAMC,EAAc,UAAQC,KAAKb,EAAK1B,KAAKgC,QAAQ,IACnDM,EAAYE,aAAe,EAC3BF,EAAYG,gBAAkB,EAG9Bf,EAAK1B,KAAKgC,QAAQ,GAAKM,EAIvBtB,EAAM0B,Q,OAGRhB,EAAKzB,MAAQ6B,EAAS7B,KAE1B,IACC0C,OAAM,SAAC1C,GACN2C,QAAQ3C,MAAM,uBAAwBA,GACtCyB,EAAKzB,MAAQ,4CACf,KA9CA,I,cAGF,S,YA6CJ,EA5DA,IAoEA,IAAA4C,SACGC,cACAC,QAAQlB,MAAK,SAACmB,IAGT,IAAAC,QAAOC,SAASC,MAAMC,QAAQ,EAAQ,MAG5C,IAIW,EAAAC,cAAgB,yBAC7B,UACGC,OAAO,EAAAD,cAAe,IACtBE,UAAU,oBApBb,WACE,OAAO,IAAIC,CACb,G","sources":["webpack://ode-ngjs-front/./src/ts/widgets/cantine-widget/cantine-widget.widget.html","webpack://ode-ngjs-front/./src/ts/widgets/cantine-widget/cantine-widget.widget.ts"],"sourcesContent":["// Module\nvar code = \"<style>.menu-card{color:#333;justify-content:center;align-items:center;padding:5%;border-radius:10px;box-shadow:0 0 10px rgba(0,0,0,.1)}.separator{border:none;height:1px;background-color:#ccc;margin:3% 0}.section{margin-bottom:3%}.section-title{font-weight:700;font-size:1.1em;display:flex;align-items:center}.item{margin-left:1%;font-family:Arimo;color:#4a4a4a;font-size:medium}.item{align-items:center;gap:5px}.items-container{border-left:2px solid #ccc;margin-left:.8%;padding-left:3%}.icon{width:1em;height:1em;margin-left:5px;vertical-align:middle;display:inline-block;margin-bottom:10px}.dot{height:.6em;width:.6em;border-radius:50%;display:inline-block;margin-right:2%}.allergen-collapse{background-color:#f9f9f9;border-radius:5px;padding:0;display:none;transition:all .3s ease-in-out;font-size:.9em}.allergen-collapse.open{display:block}.collapse-toggle{background-color:#f7c75c;border:none;padding:0 10px;border-radius:5px;font-weight:700;cursor:pointer;display:block;margin-top:0;color:#fff;font-size:.8em}.collapse-toggle:hover{background-color:#e6b848}.red{background-color:red}.green{background-color:green}.blue{background-color:#00f}.yellow{background-color:orange}</style> <div class=\\\"widget-dashboard\\\"> <div class=\\\"menu-card\\\"> <h2 style=\\\"color:#333;font-family:Roboto,sans-serif\\\"> <i18n>cantine.title</i18n> </h2> <div class=\\\"separator\\\"></div> <i18n>cantine.date</i18n> <div class=\\\"section\\\"> <div class=\\\"section-title\\\"> <span class=\\\"dot red\\\"></span> <i18n>cantine.entree</i18n> </div> <div class=\\\"items-container\\\"> <div class=\\\"item\\\" ng-repeat=\\\"item in ctrl.data.entrees\\\"> {{ ctrl.formatName(item.nom) }} <img ng-if=\\\"item.bio\\\" src=\\\"/assets/widgets/cantine-widget/cantine-logos/bio-logo.png\\\" alt=\\\"Bio\\\" class=\\\"icon\\\"> <img ng-if=\\\"item.faitmaison\\\" src=\\\"/assets/widgets/cantine-widget/cantine-logos/fait-maison-logo.png\\\" alt=\\\"Fait Maison\\\" class=\\\"icon\\\"> <img ng-if=\\\"item.vegetarien\\\" src=\\\"/assets/widgets/cantine-widget/cantine-logos/vegetarien-logo.png\\\" alt=\\\"Vegetarian\\\" class=\\\"icon\\\"> <img ng-if=\\\"item.local\\\" src=\\\"/assets/widgets/cantine-widget/cantine-logos/produit-local-logo.png\\\" alt=\\\"Local Product\\\" class=\\\"icon\\\"> <button class=\\\"collapse-toggle\\\" ng-click=\\\"item.showAllergies = !item.showAllergies\\\" ng-if=\\\"ctrl.getAllergies(item).length > 0\\\"> ⚠️ Allergens </button> <div class=\\\"allergen-collapse\\\" ng-class=\\\"{'open': item.showAllergies}\\\" ng-if=\\\"ctrl.getAllergies(item).length > 0\\\"> <span>{{ ctrl.getAllergies(item).join(', ') }}</span> </div> </div> </div> </div> <div class=\\\"section\\\"> <div class=\\\"section-title\\\"> <span class=\\\"dot green\\\"></span> <i18n>cantine.plat</i18n> </div> <div class=\\\"items-container\\\"> <div class=\\\"item\\\" ng-repeat=\\\"item in ctrl.data.plats\\\"> {{ ctrl.formatName(item.nom) }} <img ng-if=\\\"item.bio\\\" src=\\\"/assets/widgets/cantine-widget/cantine-logos/bio-logo.png\\\" alt=\\\"Bio\\\" class=\\\"icon\\\"> <img ng-if=\\\"item.faitmaison\\\" src=\\\"/assets/widgets/cantine-widget/cantine-logos/fait-maison-logo.png\\\" alt=\\\"Fait Maison\\\" class=\\\"icon\\\"> <img ng-if=\\\"item.vegetarien\\\" src=\\\"/assets/widgets/cantine-widget/cantine-logos/vegetarien-logo.png\\\" alt=\\\"Vegetarian\\\" class=\\\"icon\\\"> <img ng-if=\\\"item.local\\\" src=\\\"/assets/widgets/cantine-widget/cantine-logos/produit-local-logo.png\\\" alt=\\\"Local Product\\\" class=\\\"icon\\\"> <button class=\\\"collapse-toggle\\\" ng-click=\\\"item.showAllergies = !item.showAllergies\\\" ng-if=\\\"ctrl.getAllergies(item).length > 0\\\"> ⚠️ Allergens </button> <div class=\\\"allergen-collapse\\\" ng-class=\\\"{'open': item.showAllergies}\\\" ng-if=\\\"ctrl.getAllergies(item).length > 0\\\"> <span>{{ ctrl.getAllergies(item).join(', ') }}</span> </div> </div> </div> </div> <div class=\\\"section\\\"> <div class=\\\"section-title\\\"> <span class=\\\"dot blue\\\"></span> <i18n>cantine.accompagnement</i18n> </div> <div class=\\\"items-container\\\"> <div class=\\\"item\\\" ng-repeat=\\\"item in ctrl.data.accompagnements\\\"> {{ ctrl.formatName(item.nom) }} <img ng-if=\\\"item.bio\\\" src=\\\"/assets/widgets/cantine-widget/cantine-logos/bio-logo.png\\\" alt=\\\"Bio\\\" class=\\\"icon\\\"> <img ng-if=\\\"item.faitmaison\\\" src=\\\"/assets/widgets/cantine-widget/cantine-logos/fait-maison-logo.png\\\" alt=\\\"Fait Maison\\\" class=\\\"icon\\\"> <img ng-if=\\\"item.vegetarien\\\" src=\\\"/assets/widgets/cantine-widget/cantine-logos/vegetarien-logo.png\\\" alt=\\\"Vegetarian\\\" class=\\\"icon\\\"> <img ng-if=\\\"item.local\\\" src=\\\"/assets/widgets/cantine-widget/cantine-logos/produit-local-logo.png\\\" alt=\\\"Local Product\\\" class=\\\"icon\\\"> <button class=\\\"collapse-toggle\\\" ng-click=\\\"item.showAllergies = !item.showAllergies\\\" ng-if=\\\"ctrl.getAllergies(item).length > 0\\\"> ⚠️ Allergens </button> <div class=\\\"allergen-collapse\\\" ng-class=\\\"{'open': item.showAllergies}\\\" ng-if=\\\"ctrl.getAllergies(item).length > 0\\\"> <span>{{ ctrl.getAllergies(item).join(', ') }}</span> </div> </div> </div> </div> <div class=\\\"section\\\"> <div class=\\\"section-title\\\"> <span class=\\\"dot yellow\\\"></span> <i18n>cantine.dessert</i18n> </div> <div class=\\\"items-container\\\"> <div class=\\\"item\\\" ng-repeat=\\\"item in ctrl.data.desserts\\\"> {{ ctrl.formatName(item.nom) }} <img ng-if=\\\"item.bio\\\" src=\\\"/assets/widgets/cantine-widget/cantine-logos/bio-logo.png\\\" alt=\\\"Bio\\\" class=\\\"icon\\\"> <img ng-if=\\\"item.faitmaison\\\" src=\\\"/assets/widgets/cantine-widget/cantine-logos/fait-maison-logo.png\\\" alt=\\\"Fait Maison\\\" class=\\\"icon\\\"> <img ng-if=\\\"item.vegetarien\\\" src=\\\"/assets/widgets/cantine-widget/cantine-logos/vegetarien-logo.png\\\" alt=\\\"Vegetarian\\\" class=\\\"icon\\\"> <img ng-if=\\\"item.local\\\" src=\\\"/assets/widgets/cantine-widget/cantine-logos/produit-local-logo.png\\\" alt=\\\"Local Product\\\" class=\\\"icon\\\"> <button class=\\\"collapse-toggle\\\" ng-click=\\\"item.showAllergies = !item.showAllergies\\\" ng-if=\\\"ctrl.getAllergies(item).length > 0\\\"> ⚠️ Allergens </button> <div class=\\\"allergen-collapse\\\" ng-class=\\\"{'open': item.showAllergies}\\\" ng-if=\\\"ctrl.getAllergies(item).length > 0\\\"> <span>{{ ctrl.getAllergies(item).join(', ') }}</span> </div> </div> </div> </div> </div> </div>\";\n// Exports\nexport default code;","import angular, { IAttributes, IController, IDirective, IScope } from \"angular\";\nimport { conf, notif, http, session, Base64 } from \"../../utils\";\nimport moment from \"moment\";\n\nclass Controller implements IController {\n data: any = {};\n error: any = null;\n\n // Function to get allergies from an item\n getAllergies(item: any): string[] {\n // Check if item is defined\n if (!item) {\n return [];\n }\n\n const allergyKeys = [\n \"allerg_anhydride\",\n \"allerg_arachide\",\n \"allerg_celeri\",\n \"allerg_crustace\",\n \"allerg_fruit_coque\",\n \"allerg_gluten\",\n \"allerg_lait\",\n \"allerg_lupin\",\n \"allerg_mollusque\",\n \"allerg_moutarde\",\n \"allerg_oeuf\",\n \"allerg_poisson\",\n \"allerg_sesame\",\n \"allerg_soja\",\n ];\n\n return allergyKeys\n .filter((key) => item[key] !== 0 && item[key] !== undefined) // Avoid undefined and 0\n .map((key) => key.replace(\"allerg_\", \"\").replace(\"_\", \" \")); // Format for display\n }\n\n // Function to format names\n formatName(name: string): string {\n return name\n .toLowerCase() // Convert the entire string to lowercase\n .replace(/(^\\w|\\s\\w)/g, (match) => match.toUpperCase()); // Capitalize first letter of each word\n }\n}\n\n/* Directive */\nclass Directive implements IDirective<IScope, JQLite, IAttributes, IController[]> {\n restrict = \"E\";\n template = require(\"./cantine-widget.widget.html\").default;\n scope = {};\n bindToController = true;\n controller = [Controller];\n controllerAs = \"ctrl\";\n require = [\"odeCantineWidget\"];\n\n async link(scope: IScope, elem: JQLite, attrs: IAttributes, controllers?: IController[]) {\n const ctrl: Controller | null = controllers ? (controllers[0] as Controller) : null;\n if (!ctrl) {\n return;\n }\n\n await http()\n .get(\"/appregistry/0770000X/cantine/menu\")\n .then((response) => {\n if (response.menu) {\n const menu = response.menu;\n\n // Group items by type\n ctrl.data = {\n entrees: menu.filter((item: any) => item.type === \"entree\"),\n plats: menu.filter((item: any) => item.type === \"plat\"),\n accompagnements: menu.filter((item: any) => item.type === \"accompagnement\"),\n desserts: menu.filter((item: any) => item.type === \"dessert\"),\n };\n\n // Dynamically group items by type (optional)\n // ctrl.data = menu.reduce((acc: Record<string, any[]>, item: any) => {\n // if (!acc[item.type]) {\n // acc[item.type] = []; // Create array if type doesn't exist\n // }\n // acc[item.type].push(item); // Add item to its category\n // return acc;\n // }, {});\n\n // Ensure ctrl.data.entrees is properly populated\n if (ctrl.data.entrees && ctrl.data.entrees.length > 0) {\n const firstEntree = angular.copy(ctrl.data.entrees[0]); // Ensure we are working with a new object\n firstEntree.allerg_lupin = 1; // Simulate lupin allergy\n firstEntree.allerg_arachide = 1; // Simulate lupin allergy\n\n // Replace the old entree with the modified one\n ctrl.data.entrees[0] = firstEntree;\n\n\n // Ensure Angular detects the change\n scope.$apply(); // Trigger Angular's change detection\n }\n } else {\n ctrl.error = response.error;\n }\n })\n .catch((error) => {\n console.error(\"Error fetching menu:\", error);\n ctrl.error = \"An error occurred while fetching the menu.\";\n });\n }\n}\n\n/** The cantine widget. */\nfunction DirectiveFactory() {\n return new Directive();\n}\n\n// Preload translations\nnotif()\n .onLangReady()\n .promise.then((lang) => {\n switch (lang) {\n default:\n conf().Platform.idiom.addKeys(require(\"./i18n/fr.json\"));\n break;\n }\n });\n\n// THIS ANGULAR MODULE WILL BE DYNAMICALLY ADDED TO THE APPLICATION.\n// RESPECT THE NAMING CONVENTION BY EXPORTING THE MODULE NAME :\nexport const odeModuleName = \"odeCantineWidgetModule\";\nangular\n .module(odeModuleName, [])\n .directive(\"odeCantineWidget\", DirectiveFactory);\n"],"names":["data","error","getAllergies","item","filter","key","undefined","map","replace","formatName","name","toLowerCase","match","toUpperCase","restrict","template","scope","bindToController","controller","Controller","controllerAs","require","link","elem","attrs","controllers","ctrl","http","get","then","response","menu","entrees","type","plats","accompagnements","desserts","length","firstEntree","copy","allerg_lupin","allerg_arachide","$apply","catch","console","notif","onLangReady","promise","lang","conf","Platform","idiom","addKeys","odeModuleName","module","directive","Directive"],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkode_ngjs_front=self.webpackChunkode_ngjs_front||[]).push([[443],{7601:(t,e,r)=>{r.d(e,{Z:()=>i});const i='<style>.ptit-observatoire-widget-container{box-sizing:border-box;background:#358284;padding:10px;border-radius:6px;overflow:hidden}.ptit-observatoire-widget-content{display:flex;flex-direction:column;gap:10px;box-sizing:border-box;width:100%;height:100%;background-color:#fff;border-radius:3px;padding:10px}.ptit-observatoire-widget-form{width:100%;display:flex;flex-direction:column;gap:10px}.ptit-observatoire-widget-select{background-color:#fff;padding:15px;border:1px solid #c1c1ca;color:#c1c1ca;border-radius:10px}.ptit-observatoire-submit-button{display:flex;align-items:center;gap:10px;background-color:#173a37;color:#fff;border:none;padding:10px 15px;border-radius:30px}.ptit-observatoire-plus-icon{display:flex;align-items:center;justify-content:center;line-height:100%;text-align:center;background-color:#2c6262;border-radius:50%;width:30px;height:30px}.ptit-observatoire-modal-form{display:flex;flex-direction:column;gap:15px}.ptit-observatoire-modal-form-legend{text-transform:uppercase;color:#7caaac;font-weight:700}.ptit-observatoire-modal-form-textarea{width:100%}.ptit-observatoire-modal-options-container{display:flex;flex-wrap:wrap;gap:5px}</style> <div class="ptit-observatoire-widget-container"> <div class="ptit-observatoire-widget-content"> <p> <i18n>ptitObservatoire.title</i18n> </p> <div class="widget-body" dnd-nodrag> <form class="ptit-observatoire-widget-form" ng-submit="ctrl.startObservation()"> <select class="ptit-observatoire-widget-select" name="student" ng-model="ctrl.formData.student_id"> <option value="" selected="selected"> </option> <option ng-repeat="student in ctrl.studentsList" value="{{student.id}}"> {{student.fullName}} </option> </select> <button type="submit" class="ptit-observatoire-submit-button"> <span class="ptit-observatoire-plus-icon">+</span> <span> <i18n>ptitObservatoire.newObservation</i18n> </span> </button> </form> </div> </div> <ode-modal visible="ctrl.showLightbox" on-close="ctrl.showLightbox=false" size="lg" dnd-nodrag> <ode-modal-title> <h2> <i18n>ptitObservatoire.modal.title</i18n> </h2> </ode-modal-title> <ode-modal-body> <form class="ptit-observatoire-modal-form" ng-submit="ctrl.handleObservationSubmit(); ctrl.showLightbox=false"> <fieldset> <legend class="ptit-observatoire-modal-form-legend"> <i18n>ptitObservatoire.modal.observation</i18n> </legend> <textarea class="ptit-observatoire-modal-form-textarea" name="content" ng-model="ctrl.formData[\'content\']" i18n-placeholder="ptitObservatoire.modal.textarea.placeholder"></textarea> </fieldset> <fieldset> <legend class="ptit-observatoire-modal-form-legend"> <i18n>ptitObservatoire.modal.evaluation</i18n> </legend> <label for="strengths"> <input type="radio" id="strength" name="assessment_type" ng-model="ctrl.formData[\'assessment_type\']" ng-value="\'strength\'"/> <i18n>ptitObservatoire.modal.evaluation.strength</i18n> </label> <label for="neutral"> <input type="radio" id="neutral" name="assessment_type" ng-model="ctrl.formData[\'assessment_type\']" ng-value="\'neutral\'"/> <i18n>ptitObservatoire.modal.evaluation.neutral</i18n> </label> <label for="difficulties"> <input type="radio" id="difficulties" name="assessment_type" ng-model="ctrl.formData[\'assessment_type\']" ng-value="\'difficulties\'"/> <i18n>ptitObservatoire.modal.evaluation.difficulties</i18n> </label> </fieldset> <fieldset> <legend class="ptit-observatoire-modal-form-legend"> <i18n>ptitObservatoire.modal.categories</i18n> </legend> <div class="ptit-observatoire-modal-options-container"> <label ng-repeat="category in ctrl.observationCategories"> <input type="radio" name="{{category.name}}" ng-model="ctrl.formData[\'category_id\']" ng-value="category.id"/> {{ category.name }} </label> </div> </fieldset> <fieldset> <legend class="ptit-observatoire-modal-form-legend"> <i18n>ptitObservatoire.modal.options</i18n> </legend> <label> <input type="checkbox" ng-model="ctrl.formData[\'private\']"/> <i18n>ptitObservatoire.modal.options.private</i18n> </label> </fieldset> <button type="submit" class="ptit-observatoire-submit-button"> <i18n>ptitObservatoire.modal.save</i18n> </button> </form> </ode-modal-body> </ode-modal> </div>'},5883:function(t,e,r){var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)},o=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(o,n){function a(t){try{l(i.next(t))}catch(t){n(t)}}function s(t){try{l(i.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))},n=this&&this.__generator||function(t,e){var r,i,o,n,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return n={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function s(n){return function(s){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,i&&(o=2&n[0]?i.return:n[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,n[1])).done)return o;switch(i=0,o&&(n=[2&n[0],o.value]),n[0]){case 0:case 1:o=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,i=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==n[0]&&2!==n[0])){a=0;continue}if(3===n[0]&&(!o||n[1]>o[0]&&n[1]<o[3])){a.label=n[1];break}if(6===n[0]&&a.label<o[1]){a.label=o[1],o=n;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(n);break}o[2]&&a.ops.pop(),a.trys.pop();continue}n=e.call(t,a)}catch(t){n=[6,t],i=0}finally{r=o=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,s])}}},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.odeModuleName=void 0;var s=a(r(4202)),l=r(9419),d=r(6731),c=function(){function t(){this.formData={},this.observationCategories=[],this.studentsList=[],this.showLightbox=!1}return t.prototype.startObservation=function(){this.formData.student_id&&(this.showLightbox=!0)},t.prototype.handleObservationSubmit=function(){return o(this,void 0,void 0,(function(){var t;return n(this,(function(e){switch(e.label){case 0:return t={data:{type:"observations",attributes:i(i({},this.formData),{teacher_id:1,date:(new Date).toISOString().substring(0,10)})}},[4,this.saveObservation(t)];case 1:return e.sent(),[2]}}))}))},t.prototype.saveObservation=function(t){return o(this,void 0,void 0,(function(){var e;return n(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,(0,l.http)().postJson("/appregistry/ptitObservatoire/observations",t)];case 1:return r.sent(),d.notify.success("ptitObservatoire.notify.save.success"),[3,3];case 2:return e=r.sent(),console.error("Error saving observation:",e),d.notify.error("ptitObservatoire.notify.save.error"),[3,3];case 3:return[2]}}))}))},t}(),u=function(){function t(){this.restrict="E",this.template=r(7601).Z,this.scope={},this.bindToController=!0,this.controller=[c],this.controllerAs="ctrl",this.require=["odePtitObservatoireWidget"]}return t.prototype.link=function(t,e,r,i){return o(this,void 0,void 0,(function(){var e,r;return n(this,(function(o){switch(o.label){case 0:return(e=i?i[0]:null)?[4,Promise.all([this.getObservationCategories(),this.getStudentsList()])]:[2];case 1:return r=o.sent(),e.observationCategories=r[0],e.studentsList=r[1],t.$applyAsync(),[2]}}))}))},t.prototype.getStudentsList=function(){return o(this,void 0,void 0,(function(){var t;return n(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,(0,l.http)().get("/appregistry/ptitObservatoire/students")];case 1:return[2,e.sent().map((function(t){return{id:t.id,fullName:t.attributes.full_name}}))];case 2:return t=e.sent(),console.error("Error fetching students:",t),[2,[]];case 3:return[2]}}))}))},t.prototype.getObservationCategories=function(){return o(this,void 0,void 0,(function(){var t;return n(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,(0,l.http)().get("/appregistry/ptitObservatoire/observations/categories")];case 1:return[2,e.sent().map((function(t){return{id:t.id,name:t.attributes.name}}))];case 2:return t=e.sent(),console.error("Error fetching categories:",t),[2,[]];case 3:return[2]}}))}))},t}();(0,l.notif)().onLangReady().promise.then((function(t){(0,l.conf)().Platform.idiom.addKeys(r(5512))})),e.odeModuleName="odePtitObservatoireWidgetModule",s.default.module(e.odeModuleName,[]).directive("odePtitObservatoireWidget",(function(){return new u}))},5512:t=>{t.exports=JSON.parse('{"ptitObservatoire.title":"Centraliser mes observations","ptitObservatoire.newObservation":"Nouvelle observation","ptitObservatoire.selectStudent":"Sélectionner un élève","ptitObservatoire.modal.title":"Saisie de l\'Observation","ptitObservatoire.modal.observation":"Observation","ptitObservatoire.modal.evaluation":"Évaluation","ptitObservatoire.modal.evaluation.strength":"Forces","ptitObservatoire.modal.evaluation.neutral":"Neutre","ptitObservatoire.modal.evaluation.difficulties":"Difficultés","ptitObservatoire.modal.categories":"Catégories","ptitObservatoire.modal.options":"Options","ptitObservatoire.modal.options.private":"Observation privée","ptitObservatoire.modal.save":"Enregistrer l\'observation","ptitObservatoire.notify.save.success":"Observation enregistrée avec succès","ptitObservatoire.notify.save.error":"Une erreur est survenue lors de l\'enregistrement de l\'observation","ptitObservatoire.modal.textarea.placeholder":"Je suis bienveillant et factuel : J\'écris ce que j\'ai vu et entendu"}')}}]);
|
|
2
|
+
//# sourceMappingURL=ptit-observatoire-widget.widget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widgets/ptit-observatoire-widget/ptit-observatoire-widget.widget.js","mappings":"gIAGA,QAFW,+iI,mxDCDX,iBACA,UACA,UAaA,0BACC,KAAAA,SAAsC,CAAC,EAChC,KAAAC,sBAA+C,GAC/C,KAAAC,aAA0B,GAC1B,KAAAC,cAAe,CAiCvB,QA9BC,YAAAC,iBAAA,WACKC,KAAKL,SAASM,aACjBD,KAAKF,cAAe,EAEtB,EAEM,YAAAI,wBAAN,W,gGAYC,OAXMC,EAAO,CACZC,KAAM,CACLC,KAAM,eACNC,WAAY,EAAF,KACNN,KAAKL,UAAQ,CAChB,WAAc,EACd,MAAQ,IAAIY,MAAOC,cAAcC,UAAU,EAAG,QAKjD,GAAMT,KAAKU,gBAAgBP,I,cAA3B,S,YAGK,YAAAO,gBAAN,SAAsBP,G,gGAEpB,O,sBAAA,IAAM,IAAAQ,QAAOC,SAAS,6CAA8CT,I,cAApE,SACA,EAAAU,OAAOC,QAAQ,wC,+BAEfC,QAAQC,MAAM,4BAA6B,GAC3C,EAAAH,OAAOG,MAAM,sC,+BAGhB,EArCA,GAwCA,0BACC,KAAAC,SAAW,IACX,KAAAC,SAAW,UACX,KAAAC,MAAQ,CAAC,EACT,KAAAC,kBAAmB,EACnB,KAAAC,WAAa,CAACC,GACd,KAAAC,aAAe,OACf,KAAAC,QAAU,CAAC,4BA8CZ,QA5CO,YAAAC,KAAN,SAAWN,EAAeO,EAAcC,EAAoBC,G,kGAI3D,OAHMC,EAA0BD,EAC5BA,EAAY,GACb,MAK+C,GAAME,QAAQC,IAAI,CACnE/B,KAAKgC,2BACLhC,KAAKiC,qBALL,I,cAGD,EAAkD,SAAjDJ,EAAKjC,sBAAqB,KAAEiC,EAAKhC,aAAY,KAK9CsB,EAAMe,c,YAGD,YAAAD,gBAAN,W,gGAEc,O,sBAAA,IAAM,IAAAtB,QAAOwB,IAAI,2C,OAE7B,MAAO,CAAP,EAFY,SAEDC,KAAI,SACdC,GACI,OACJC,GAAID,EAAQC,GACZC,SAAUF,EAAQ/B,WAAWkC,UAFzB,K,OAML,O,WADAzB,QAAQC,MAAM,2BAA4B,GACnC,CAAC,EAAD,I,yBAIH,YAAAgB,yBAAN,W,gGAEc,O,sBAAA,IAAM,IAAArB,QAAOwB,IAAI,0D,OAC7B,MAAO,CAAP,EADY,SACDC,KAAI,SAACK,GAA2D,OAC1EH,GAAIG,EAASH,GACbI,KAAMD,EAASnC,WAAWoC,KAFgD,K,OAM3E,O,WADA3B,QAAQC,MAAM,6BAA8B,GACrC,CAAC,EAAD,I,yBAGV,EArDA,IA6DA,IAAA2B,SACEC,cACAC,QAAQC,MAAK,SAACC,IAGZ,IAAAC,QAAOC,SAASC,MAAMC,QAAQ,EAAQ,MAGzC,IAIY,EAAAC,cAAgB,kCAC7B,UACEC,OAAO,EAAAD,cAAe,IACtBE,UAAU,6BApBZ,WACC,OAAO,IAAIC,CACZ,G","sources":["webpack://ode-ngjs-front/./src/ts/widgets/ptit-observatoire-widget/ptit-observatoire-widget.widget.html","webpack://ode-ngjs-front/./src/ts/widgets/ptit-observatoire-widget/ptit-observatoire-widget.widget.ts"],"sourcesContent":["// Module\nvar code = \"<style>.ptit-observatoire-widget-container{box-sizing:border-box;background:#358284;padding:10px;border-radius:6px;overflow:hidden}.ptit-observatoire-widget-content{display:flex;flex-direction:column;gap:10px;box-sizing:border-box;width:100%;height:100%;background-color:#fff;border-radius:3px;padding:10px}.ptit-observatoire-widget-form{width:100%;display:flex;flex-direction:column;gap:10px}.ptit-observatoire-widget-select{background-color:#fff;padding:15px;border:1px solid #c1c1ca;color:#c1c1ca;border-radius:10px}.ptit-observatoire-submit-button{display:flex;align-items:center;gap:10px;background-color:#173a37;color:#fff;border:none;padding:10px 15px;border-radius:30px}.ptit-observatoire-plus-icon{display:flex;align-items:center;justify-content:center;line-height:100%;text-align:center;background-color:#2c6262;border-radius:50%;width:30px;height:30px}.ptit-observatoire-modal-form{display:flex;flex-direction:column;gap:15px}.ptit-observatoire-modal-form-legend{text-transform:uppercase;color:#7caaac;font-weight:700}.ptit-observatoire-modal-form-textarea{width:100%}.ptit-observatoire-modal-options-container{display:flex;flex-wrap:wrap;gap:5px}</style> <div class=\\\"ptit-observatoire-widget-container\\\"> <div class=\\\"ptit-observatoire-widget-content\\\"> <p> <i18n>ptitObservatoire.title</i18n> </p> <div class=\\\"widget-body\\\" dnd-nodrag> <form class=\\\"ptit-observatoire-widget-form\\\" ng-submit=\\\"ctrl.startObservation()\\\"> <select class=\\\"ptit-observatoire-widget-select\\\" name=\\\"student\\\" ng-model=\\\"ctrl.formData.student_id\\\"> <option value=\\\"\\\" selected=\\\"selected\\\"> </option> <option ng-repeat=\\\"student in ctrl.studentsList\\\" value=\\\"{{student.id}}\\\"> {{student.fullName}} </option> </select> <button type=\\\"submit\\\" class=\\\"ptit-observatoire-submit-button\\\"> <span class=\\\"ptit-observatoire-plus-icon\\\">+</span> <span> <i18n>ptitObservatoire.newObservation</i18n> </span> </button> </form> </div> </div> <ode-modal visible=\\\"ctrl.showLightbox\\\" on-close=\\\"ctrl.showLightbox=false\\\" size=\\\"lg\\\" dnd-nodrag> <ode-modal-title> <h2> <i18n>ptitObservatoire.modal.title</i18n> </h2> </ode-modal-title> <ode-modal-body> <form class=\\\"ptit-observatoire-modal-form\\\" ng-submit=\\\"ctrl.handleObservationSubmit(); ctrl.showLightbox=false\\\"> <fieldset> <legend class=\\\"ptit-observatoire-modal-form-legend\\\"> <i18n>ptitObservatoire.modal.observation</i18n> </legend> <textarea class=\\\"ptit-observatoire-modal-form-textarea\\\" name=\\\"content\\\" ng-model=\\\"ctrl.formData['content']\\\" i18n-placeholder=\\\"ptitObservatoire.modal.textarea.placeholder\\\"></textarea> </fieldset> <fieldset> <legend class=\\\"ptit-observatoire-modal-form-legend\\\"> <i18n>ptitObservatoire.modal.evaluation</i18n> </legend> <label for=\\\"strengths\\\"> <input type=\\\"radio\\\" id=\\\"strength\\\" name=\\\"assessment_type\\\" ng-model=\\\"ctrl.formData['assessment_type']\\\" ng-value=\\\"'strength'\\\"/> <i18n>ptitObservatoire.modal.evaluation.strength</i18n> </label> <label for=\\\"neutral\\\"> <input type=\\\"radio\\\" id=\\\"neutral\\\" name=\\\"assessment_type\\\" ng-model=\\\"ctrl.formData['assessment_type']\\\" ng-value=\\\"'neutral'\\\"/> <i18n>ptitObservatoire.modal.evaluation.neutral</i18n> </label> <label for=\\\"difficulties\\\"> <input type=\\\"radio\\\" id=\\\"difficulties\\\" name=\\\"assessment_type\\\" ng-model=\\\"ctrl.formData['assessment_type']\\\" ng-value=\\\"'difficulties'\\\"/> <i18n>ptitObservatoire.modal.evaluation.difficulties</i18n> </label> </fieldset> <fieldset> <legend class=\\\"ptit-observatoire-modal-form-legend\\\"> <i18n>ptitObservatoire.modal.categories</i18n> </legend> <div class=\\\"ptit-observatoire-modal-options-container\\\"> <label ng-repeat=\\\"category in ctrl.observationCategories\\\"> <input type=\\\"radio\\\" name=\\\"{{category.name}}\\\" ng-model=\\\"ctrl.formData['category_id']\\\" ng-value=\\\"category.id\\\"/> {{ category.name }} </label> </div> </fieldset> <fieldset> <legend class=\\\"ptit-observatoire-modal-form-legend\\\"> <i18n>ptitObservatoire.modal.options</i18n> </legend> <label> <input type=\\\"checkbox\\\" ng-model=\\\"ctrl.formData['private']\\\"/> <i18n>ptitObservatoire.modal.options.private</i18n> </label> </fieldset> <button type=\\\"submit\\\" class=\\\"ptit-observatoire-submit-button\\\"> <i18n>ptitObservatoire.modal.save</i18n> </button> </form> </ode-modal-body> </ode-modal> </div>\";\n// Exports\nexport default code;","import angular, { IAttributes, IController, IDirective, IScope } from \"angular\";\nimport { conf, http, notif } from \"../../utils\";\nimport { notify } from \"../../services\";\n\ninterface Student {\n\tid: number,\n\tfullName: string\n}\n\ninterface ObservationCategory {\n\tid: number,\n\tname: string\n}\n\n/* Controller for the directive */\nclass Controller implements IController {\n\tformData: { [key: string]: string } = {};\n\tpublic observationCategories: ObservationCategory[] = [];\n\tpublic studentsList: Student[] = [];\n\tpublic showLightbox = false;\n\n\n\tstartObservation() {\n\t\tif (this.formData.student_id) {\n\t\t\tthis.showLightbox = true;\n\t\t}\n\t}\n\n\tasync handleObservationSubmit() {\n\t\tconst body = {\n\t\t\tdata: {\n\t\t\t\ttype: \"observations\",\n\t\t\t\tattributes: {\n\t\t\t\t\t...this.formData,\n\t\t\t\t\t\"teacher_id\": 1, // TODO: change when respone updated from ptit observatoire\n\t\t\t\t\t\"date\": new Date().toISOString().substring(0, 10),\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tawait this.saveObservation(body)\n\t}\n\n\tasync saveObservation(body: any): Promise<void> {\n\t\ttry {\n\t\t\tawait http().postJson(\"/appregistry/ptitObservatoire/observations\", body)\n\t\t\tnotify.success(\"ptitObservatoire.notify.save.success\")\n\t\t} catch (error) {\n\t\t\tconsole.error(\"Error saving observation:\", error);\n\t\t\tnotify.error(\"ptitObservatoire.notify.save.error\")\n\t\t}\n\t}\n}\n\n/* Directive */\nclass Directive implements IDirective<IScope, JQLite, IAttributes, IController[]> {\n\trestrict = 'E';\n\ttemplate = require('./ptit-observatoire-widget.widget.html').default;\n\tscope = {};\n\tbindToController = true;\n\tcontroller = [Controller];\n\tcontrollerAs = 'ctrl';\n\trequire = ['odePtitObservatoireWidget'];\n\n\tasync link(scope: IScope, elem: JQLite, attrs: IAttributes, controllers?: IController[]) {\n\t\tconst ctrl: Controller | null = controllers\n\t\t\t? (controllers[0] as Controller)\n\t\t\t: null;\n\t\tif (!ctrl) {\n\t\t\treturn;\n\t\t}\n\n\t\t[ctrl.observationCategories, ctrl.studentsList] = await Promise.all([\n\t\t\tthis.getObservationCategories(),\n\t\t\tthis.getStudentsList(),\n\t\t]);\n\n\t\tscope.$applyAsync();\n\t}\n\n\tasync getStudentsList(): Promise<Student[]> {\n\t\ttry {\n\t\t\tconst res = await http().get(\"/appregistry/ptitObservatoire/students\");\n\n\t\t\treturn res.map((\n\t\t\t\tstudent: { id: number, attributes: { full_name: string } }\n\t\t\t) => ({\n\t\t\t\tid: student.id,\n\t\t\t\tfullName: student.attributes.full_name\n\t\t\t}));\n\t\t} catch (e) {\n\t\t\tconsole.error(\"Error fetching students:\", e);\n\t\t\treturn [];\n\t\t}\n\t}\n\n\tasync getObservationCategories(): Promise<ObservationCategory[]> {\n\t\ttry {\n\t\t\tconst res = await http().get(\"/appregistry/ptitObservatoire/observations/categories\");\n\t\t\treturn res.map((category: { id: number; attributes: { name: string } }) => ({\n\t\t\t\tid: category.id,\n\t\t\t\tname: category.attributes.name,\n\t\t\t}));\n\t\t} catch (e) {\n\t\t\tconsole.error(\"Error fetching categories:\", e);\n\t\t\treturn [];\n\t\t}\n\t}\n}\n\n/** The P'tit observatoire widget. */\nfunction DirectiveFactory() {\n\treturn new Directive();\n}\n\n// Preload translations\nnotif()\n\t.onLangReady()\n\t.promise.then((lang) => {\n\t\tswitch (lang) {\n\t\t\tdefault:\n\t\t\t\tconf().Platform.idiom.addKeys(require(\"./i18n/fr.json\"));\n\t\t\t\tbreak;\n\t\t}\n\t});\n\n// THIS ANGULAR MODULE WILL BE DYNAMICALLY ADDED TO THE APPLICATION.\n// RESPECT THE NAMING CONVENTION BY EXPORTING THE MODULE NAME :\nexport const odeModuleName = \"odePtitObservatoireWidgetModule\";\nangular\n\t.module(odeModuleName, [])\n\t.directive(\"odePtitObservatoireWidget\", DirectiveFactory);\n"],"names":["formData","observationCategories","studentsList","showLightbox","startObservation","this","student_id","handleObservationSubmit","body","data","type","attributes","Date","toISOString","substring","saveObservation","http","postJson","notify","success","console","error","restrict","template","scope","bindToController","controller","Controller","controllerAs","require","link","elem","attrs","controllers","ctrl","Promise","all","getObservationCategories","getStudentsList","$applyAsync","get","map","student","id","fullName","full_name","category","name","notif","onLangReady","promise","then","lang","conf","Platform","idiom","addKeys","odeModuleName","module","directive","Directive"],"sourceRoot":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ode-ngjs-front",
|
|
3
|
-
"version": "1.4.9-develop-integration.
|
|
3
|
+
"version": "1.4.9-develop-integration.202503191606",
|
|
4
4
|
"description": "Open Digital Education Frontend Framework",
|
|
5
5
|
"homepage": "https://github.com/opendigitaleducation/ode-ngjs-front#readme",
|
|
6
6
|
"bugs": {
|