ode-ngjs-front 1.2.6-feat-produit.202302201716 → 1.2.6-feat-produit.202303031659
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/version.txt +1 -1
- package/dist/widgets/qwant-widget/qwant-widget.widget.js +1 -1
- package/dist/widgets/qwant-widget/qwant-widget.widget.js.map +1 -1
- package/dist/widgets/school-widget/school-widget.widget.js +1 -1
- package/dist/widgets/school-widget/school-widget.widget.js.map +1 -1
- package/package.json +1 -1
package/dist/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
ode-ngjs-front=1.2-feat-produit-SNAPSHOT
|
|
1
|
+
ode-ngjs-front=1.2-feat-produit-SNAPSHOT 03/03/2023 16:59:56
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkode_ngjs_front=self.webpackChunkode_ngjs_front||[]).push([[165],{8265:(t,e,n)=>{n.d(e,{Z:()=>a});const a=' <style>.widget-qwant .widget-header{border:0}</style> <div class="widget-qwant"> <div class="widget-header"> <div class="widget-options"> <div class="widget-handle"><i class="fas fa-grip-vertical"></i></div> </div> </div> <div class="widget-body" dnd-nodrag> <div class="widget-empty-message"> <div class="row row-cols-1 align-items-center"> <div class="mb-
|
|
1
|
+
"use strict";(self.webpackChunkode_ngjs_front=self.webpackChunkode_ngjs_front||[]).push([[165],{8265:(t,e,n)=>{n.d(e,{Z:()=>a});const a=' <style>.widget-qwant .widget-header{border:0}.widget-qwant .widget-body img{margin:auto}</style> <div class="widget-qwant"> <div class="widget-header"> <div class="widget-options"> <div class="widget-handle"><i class="fas fa-grip-vertical"></i></div> </div> </div> <div class="widget-body" dnd-nodrag> <div class="widget-empty-message"> <div class="row row-cols-1 align-items-center"> <div class="mb-12"> <a href="https://www.qwant.com" target="_blank" rel="noopener" ng-click="trackEvent($event, {detail:{\'open\':\'qwant\'} })"> <img src="/assets/widgets/qwant/logo-qwant.svg" width="77" height="75" alt="Qwant"> </a> </div> </div> <form method="GET" target="_blank" action="https://www.qwant.com" autocomplete="off"> <div class="row row-cols-1 align-items-center"> <label class="sr-only" for="inputQwantQ" translate content="search"></label> <div class="input-group mb-2"> <input type="text" id="inputQwantQ" class="form-control" name="q" maxlength="255" i18n-placeholder="search"/> <input type="hidden" name="l" value="fr"/> <button class="btn btn-outline-secondary" aria-labelledby="inputQwantQ" ng-click="trackEvent($event, {detail:{\'search\':\'launch\'} })"> <i class="ic-search"></i> </button> </div> </div> </form> </div> </div> </div>'},3399:function(t,e,n){var a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.odeModuleName=void 0;var i=a(n(4202)),o=n(9419),d=function(){function t(){this.restrict="E",this.template=n(8265).Z}return t.prototype.link=function(t){t.trackEvent=function(t,e){var n,a;void 0===e.bubbles&&(e.bubbles=!0);var i=null;!e||"qwant"!==(null===(n=e.detail)||void 0===n?void 0:n.open)&&"string"!=typeof(null===(a=e.detail)||void 0===a?void 0:a.search)||(i=new CustomEvent(o.TrackedActionFromWidget.qwant,e)),i&&t.currentTarget&&t.currentTarget.dispatchEvent(i)}},t}();o.notif().onLangReady().promise.then((function(t){o.conf().Platform.idiom.addKeys(n(2467))})),e.odeModuleName="odeQwantModule",i.default.module(e.odeModuleName,[]).directive("odeQwant",(function(){return new d}))},2467:t=>{t.exports=JSON.parse('{"qwant-widget.widget.title":"Qwant","qwant-junior":"QwantJunior","qwant":"Qwant"}')}}]);
|
|
2
2
|
//# sourceMappingURL=qwant-widget.widget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widgets/qwant-widget/qwant-widget.widget.js","mappings":"gIAGA,QAFW,
|
|
1
|
+
{"version":3,"file":"widgets/qwant-widget/qwant-widget.widget.js","mappings":"gIAGA,QAFW,guC,mLCDX,iBACA,UAGA,0BACI,KAAAA,SAAW,IACd,KAAAC,SAAW,SAiBZ,QAfC,YAAAC,KAAA,SAAKC,GAEJA,EAAMC,WAAa,SAACC,EAASC,G,aAEJ,IAAdA,EAAEC,UAAyBD,EAAEC,SAAU,GAEjD,IAAIC,EAAQ,MACRF,GAAuB,WAAT,QAAR,EAAAA,EAAEG,cAAM,eAAEC,OAA4C,iBAAX,QAAR,EAAAJ,EAAEG,cAAM,eAAEE,UACtDH,EAAQ,IAAII,YAAa,EAAAC,wBAAwBC,MAAOR,IAErDE,GAASH,EAAEU,eACdV,EAAEU,cAAcC,cAAcR,EAEhC,CACD,EACD,EAnBA,GA2BA,EAAAS,QAAQC,cAAcC,QAAQC,MAAM,SAAAC,GAEzB,EAAAC,OAAOC,SAASC,MAAMC,QAAS,EAAQ,MAElD,IAIa,EAAAC,cAAgB,iBAC7B,UAAQC,OAAQ,EAAAD,cAAe,IAAIE,UAAW,YAd9C,WACC,OAAO,IAAIC,CACZ,G","sources":["webpack://ode-ngjs-front/./src/ts/widgets/qwant-widget/qwant-widget.widget.html","webpack://ode-ngjs-front/./src/ts/widgets/qwant-widget/qwant-widget.widget.ts"],"sourcesContent":["// Module\nvar code = \" <style>.widget-qwant .widget-header{border:0}.widget-qwant .widget-body img{margin:auto}</style> <div class=\\\"widget-qwant\\\"> <div class=\\\"widget-header\\\"> <div class=\\\"widget-options\\\"> <div class=\\\"widget-handle\\\"><i class=\\\"fas fa-grip-vertical\\\"></i></div> </div> </div> <div class=\\\"widget-body\\\" dnd-nodrag> <div class=\\\"widget-empty-message\\\"> <div class=\\\"row row-cols-1 align-items-center\\\"> <div class=\\\"mb-12\\\"> <a href=\\\"https://www.qwant.com\\\" target=\\\"_blank\\\" rel=\\\"noopener\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'qwant'} })\\\"> <img src=\\\"/assets/widgets/qwant/logo-qwant.svg\\\" width=\\\"77\\\" height=\\\"75\\\" alt=\\\"Qwant\\\"> </a> </div> </div> <form method=\\\"GET\\\" target=\\\"_blank\\\" action=\\\"https://www.qwant.com\\\" autocomplete=\\\"off\\\"> <div class=\\\"row row-cols-1 align-items-center\\\"> <label class=\\\"sr-only\\\" for=\\\"inputQwantQ\\\" translate content=\\\"search\\\"></label> <div class=\\\"input-group mb-2\\\"> <input type=\\\"text\\\" id=\\\"inputQwantQ\\\" class=\\\"form-control\\\" name=\\\"q\\\" maxlength=\\\"255\\\" i18n-placeholder=\\\"search\\\"/> <input type=\\\"hidden\\\" name=\\\"l\\\" value=\\\"fr\\\"/> <button class=\\\"btn btn-outline-secondary\\\" aria-labelledby=\\\"inputQwantQ\\\" ng-click=\\\"trackEvent($event, {detail:{'search':'launch'} })\\\"> <i class=\\\"ic-search\\\"></i> </button> </div> </div> </form> </div> </div> </div>\";\n// Exports\nexport default code;","import angular, { IAttributes, IController, IDirective, IScope } from \"angular\";\nimport { conf, notif, TrackedAction, TrackedScope, TrackedActionFromWidget } from \"../../utils\";\n\n/* Directive */\nclass Directive implements IDirective<TrackedScope,JQLite,IAttributes,IController[]> {\n restrict = 'E';\n\ttemplate = require('./qwant-widget.widget.html').default;\n\n\tlink(scope:TrackedScope) {\n\t\t// Give an opportunity to track some events from outside of this widget.\n\t\tscope.trackEvent = (e:Event, p:CustomEventInit<TrackedAction>) => {\n\t\t\t// Allow events to bubble up.\n\t\t\tif(typeof p.bubbles === \"undefined\") p.bubbles = true;\n\n\t\t\tlet event = null;\n\t\t\tif( p && (p.detail?.open==='qwant' || typeof p.detail?.search==='string') ) {\n\t\t\t\tevent = new CustomEvent( TrackedActionFromWidget.qwant, p );\n\t\t\t}\n\t\t\tif( event && e.currentTarget ) {\n\t\t\t\te.currentTarget.dispatchEvent(event);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/** The qwant widget. */\nfunction DirectiveFactory() {\n\treturn new Directive();\n}\n\n// Preload translations\nnotif().onLangReady().promise.then( lang => {\n\tswitch( lang ) {\n\t\tdefault:\tconf().Platform.idiom.addKeys( require('./i18n/fr.json') ); break;\n\t}\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 = \"odeQwantModule\";\nangular.module( odeModuleName, []).directive( \"odeQwant\", DirectiveFactory );\n"],"names":["restrict","template","link","scope","trackEvent","e","p","bubbles","event","detail","open","search","CustomEvent","TrackedActionFromWidget","qwant","currentTarget","dispatchEvent","notif","onLangReady","promise","then","lang","conf","Platform","idiom","addKeys","odeModuleName","module","directive","Directive"],"sourceRoot":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkode_ngjs_front=self.webpackChunkode_ngjs_front||[]).push([[306],{4257:(e,t,n)=>{n.d(t,{Z:()=>o});const o='<div class="widget-school"> <div class="widget-body"> <div class="widget-school-header" ng-style="ctrl.getWidgetStyle()"> <div class="d-flex align-items-center"> <div class="me-4"> <a href="/userbook/mon-compte" class="avatar-link" i18n-title="navbar.myaccount" ng-click="trackEvent($event, {detail:{\'open\':\'profile\'} })"> <img data-ng-src="[[ctrl.avatar ? ctrl.avatar+\'?thumbnail=48x48\' : \'\']]" alt="{{ctrl.description.displayName}}"/> </a> </div> <div class="flex-grow-1"> <div class="name">{{ctrl.description.displayName}}</div> <div ng-if="!ctrl.hasManySchools" class="school">{{ctrl.selectedSchool.name}}</div> <div ng-if="ctrl.hasManySchools" class="dropdown"> <div class="school-multiple dropdown-toggle" role="button" id="ddSchoolWidgetSchool" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <a href="" class="text-white">{{ctrl.selectedSchool.name}}</a> </div> <div class="school-choice dropdown-menu" aria-labelledby="ddSchoolWidgetSchool"> <div tabindex="0" role="button" class="dropdown-item" ng-repeat="school in ctrl.description.schools" ng-click="ctrl.onSchoolSelected($index)" ng-keydown="ctrl.onSchoolSelected($index, $event)"> {{school.name}} </div> </div> </div> </div> </div> </div> <div class="btn-group"> <a href="/userbook/annuaire#/search" class="btn btn-third rounded-pill" ng-if="ctrl.isStudent" ng-click="trackEvent($event, {detail:{\'open\':\'student.class\'} })" translate content="school-widget.widget.my.classroom"></a> <a ng-href="{{ctrl.getUrlTeachersOfMyClass()}}" class="btn btn-outline-third rounded-pill" ng-if="ctrl.isStudent" ng-click="trackEvent($event, {detail:{\'open\':\'student.teachers\'} })" translate content="school-widget.widget.my.team"></a> <a ng-href="{{ctrl.getUrlStudentsOfMyClasses()}}" class="btn btn-third rounded-pill" ng-if="ctrl.isTeacher" ng-click="trackEvent($event, {detail:{\'open\':\'teacher.students\'} })" translate content="school-widget.widget.my.classrooms"></a> <a ng-href="{{ctrl.getUrlSchoolTeachers()}}" class="btn btn-outline-third rounded-pill" ng-if="ctrl.isTeacher" ng-click="trackEvent($event, {detail:{\'open\':\'teacher.teachers\'} })" translate content="school-widget.widget.school.team"></a> <a ng-href="{{ctrl.getUrlTeachersOfMyChildren()}}" class="btn btn-third rounded-pill" ng-if="ctrl.isRelative" ng-click="trackEvent($event, {detail:{\'open\':\'relative.teachers\'} })" translate content="school-widget.widget.school.team"></a> <a ng-href="{{ctrl.getUrlSchoolPersonnels()}}" class="btn btn-outline-third rounded-pill" ng-if="ctrl.isRelative" ng-click="trackEvent($event, {detail:{\'open\':\'relative.direction\'} })" translate content="school-widget.widget.school.managers"></a> <a ng-href="{{ctrl.getUrlSchoolPersonnelsAndTeachers()}}" class="btn btn-third rounded-pill" ng-if="ctrl.isPersonnel" ng-click="trackEvent($event, {detail:{\'open\':\'personnel.personnels\'} })" translate content="school-widget.widget.school.personnelAndTeachers"></a> <a ng-href="{{ctrl.getUrlStudents()}}" class="btn btn-outline-third rounded-pill" ng-if="ctrl.isPersonnel" ng-click="trackEvent($event, {detail:{\'open\':\'personnel.students\'} })" translate content="school-widget.widget.students"></a> </div> </div> </div> '},5623:function(e,t,n){var o=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(r,s){function i(e){try{c(o.next(e))}catch(e){s(e)}}function l(e){try{c(o.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,l)}c((o=o.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var n,o,r,s,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function l(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,o=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){i.label=s[1];break}if(6===s[0]&&i.label<r[1]){i.label=r[1],r=s;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(s);break}r[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.odeModuleName=void 0;var i=s(n(4202)),l=n(5262),c=n(9419),a=function(){function e(e){this.themeHelperSvc=e}return Object.defineProperty(e.prototype,"me",{get:function(){return c.session().user},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"description",{get:function(){return c.session().description},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"avatar",{get:function(){return c.session().avatarUrl},enumerable:!1,configurable:!0}),e.prototype.initialize=function(){var e,t;return o(this,void 0,void 0,(function(){var n,o,s=this;return r(this,(function(r){switch(r.label){case 0:return this._userPref=null===(e=l.WidgetFrameworkFactory.instance().list.find((function(e){return e.platformConf.name===l.WIDGET_NAME.SCHOOL})))||void 0===e?void 0:e.userPref,n=this,[4,this.themeHelperSvc.getBootstrapThemePath()];case 1:return n.themePath=r.sent(),[4,c.notif().onSessionReady().promise];case 2:return r.sent(),o=0,(null===(t=this._userPref)||void 0===t?void 0:t.schoolId)&&i.default.isArray(this.description.schools)&&(o=this.description.schools.findIndex((function(e){var t;return e.id===(null===(t=s._userPref)||void 0===t?void 0:t.schoolId)})),o<0&&(o=0)),this.setSelectedSchool(o),[2]}}))}))},e.prototype.getWidgetStyle=function(){return{"background-image":"url("+this.themePath+"/images/widget-3.png)"}},e.prototype.onSchoolSelected=function(e,t){var n;return(!t||"keydown"===t.type&&(13===t.which||32===t.which))&&(this._userPref&&this.setSelectedSchool(e)&&(this._userPref.schoolId=null===(n=this.selectedSchool)||void 0===n?void 0:n.id,l.WidgetFrameworkFactory.instance().saveUserPrefs()),!0)},e.prototype.setSelectedSchool=function(e){return 0<=e&&e<this.description.schools.length&&this.selectedSchool!==this.description.schools[e]&&(this.selectedSchool=this.description.schools[e],!0)},e.prototype.getDefaultUrl=function(){return"/userbook/annuaire#/search"},e.prototype.getUrlTeachersOfMyClass=function(){var e=this.getDefaultUrl();if(this.me.classes&&this.me.classes.length>0){e+="?filters=groups&profile=Teacher";for(var t=0,n=this.me.classes;t<n.length;t++){e+="&class="+n[t]}}return e},e.prototype.getUrlStudentsOfMyClasses=function(){var e=this.getDefaultUrl()+"?filters=groups&profile=Student";this.selectedSchool&&(e+="&structure="+this.selectedSchool.id);for(var t=0,n=this.me.classes;t<n.length;t++){e+="&class="+n[t]}return e},e.prototype.getUrlSchoolTeachers=function(){return this.selectedSchool?"/userbook/annuaire#/search?filters=groups&structure="+this.selectedSchool.id+"&profile=Teacher":this.getDefaultUrl()},e.prototype.getUrlTeachersOfMyChildren=function(){for(var e=this.getDefaultUrl()+"?filters=groups&profile=Teacher",t=0,n=this.me.classes;t<n.length;t++){e+="&class="+n[t]}return e},e.prototype.getUrlSchoolPersonnels=function(){return this.selectedSchool?"/userbook/annuaire#/search?filters=users&structure="+this.selectedSchool.id+"&profile=Personnel":this.getDefaultUrl()},e.prototype.getUrlSchoolPersonnelsAndTeachers=function(){return this.selectedSchool?"/userbook/annuaire#/search?filters=users&structure="+this.selectedSchool.id+"&profile=Personnel&profile=Teacher":this.getDefaultUrl()},e.prototype.getUrlStudents=function(){var e=this.getDefaultUrl()+"?filters=groups&profile=Student";return this.selectedSchool&&(e+="&structure="+this.selectedSchool.id),e},Object.defineProperty(e.prototype,"hasManySchools",{get:function(){return this.description.schools.length>1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isStudent",{get:function(){return"ELEVE"===this.me.type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isTeacher",{get:function(){return"ENSEIGNANT"===this.me.type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isRelative",{get:function(){return"PERSRELELEVE"===this.me.type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isPersonnel",{get:function(){return"PERSEDUCNAT"===this.me.type},enumerable:!1,configurable:!0}),e}(),d=function(){function e(){this.restrict="E",this.template=n(4257).Z,this.controller=["odeThemeHelperService",a],this.controllerAs="ctrl",this.require=["odeSchoolWidget"]}return e.prototype.link=function(e,t,n,s){return o(this,void 0,void 0,(function(){var t;return r(this,(function(n){switch(n.label){case 0:return(t=s?s[0]:null)?[4,t.initialize()]:[2];case 1:return n.sent(),e.$apply(),e.trackEvent=function(e,t){var n;void 0===t.bubbles&&(t.bubbles=!0);var o=null;(null===(n=null==t?void 0:t.detail)||void 0===n?void 0:n.open)&&-1!==["student.class","student.teachers","teacher.students","teacher.teachers","relative.teachers","relative.direction","profile"].indexOf(t.detail.open)&&(o=new CustomEvent(c.TrackedActionFromWidget.school,t)),o&&e.currentTarget&&e.currentTarget.dispatchEvent(o)},[2]}}))}))},e}();c.notif().onLangReady().promise.then((function(e){c.conf().Platform.idiom.addKeys(n(3926))})),t.odeModuleName="odeSchoolWidgetModule",i.default.module(t.odeModuleName,[]).directive("odeSchoolWidget",(function(){return new d}))},3926:e=>{e.exports=JSON.parse('{"school-widget.widget.my.classroom":"Ma classe","school-widget.widget.my.classrooms":"Mes classes","school-widget.widget.my.team":"Mes enseignants","school-widget.widget.school.team":"Équipe enseignante","school-widget.widget.school.managers":"Personnels","school-widget.widget.school.personnelAndTeachers":"Personnels et Enseignants","school-widget.widget.students":"Élèves","school-widget":"Mon réseau"}')}}]);
|
|
1
|
+
"use strict";(self.webpackChunkode_ngjs_front=self.webpackChunkode_ngjs_front||[]).push([[306],{4257:(e,t,n)=>{n.d(t,{Z:()=>o});const o='<div class="widget-school"> <div class="widget-body"> <div class="widget-school-header" ng-style="ctrl.getWidgetStyle()"> <div class="d-flex align-items-center"> <div class="me-16"> <a href="/userbook/mon-compte" class="avatar-link" i18n-title="navbar.myaccount" ng-click="trackEvent($event, {detail:{\'open\':\'profile\'} })"> <img data-ng-src="[[ctrl.avatar ? ctrl.avatar+\'?thumbnail=48x48\' : \'\']]" alt="{{ctrl.description.displayName}}"/> </a> </div> <div class="flex-grow-1"> <div class="name">{{ctrl.description.displayName}}</div> <div ng-if="!ctrl.hasManySchools" class="school">{{ctrl.selectedSchool.name}}</div> <div ng-if="ctrl.hasManySchools" class="dropdown"> <div class="school-multiple dropdown-toggle" role="button" id="ddSchoolWidgetSchool" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <a href="" class="text-white">{{ctrl.selectedSchool.name}}</a> </div> <div class="school-choice dropdown-menu" aria-labelledby="ddSchoolWidgetSchool"> <div tabindex="0" role="button" class="dropdown-item" ng-repeat="school in ctrl.description.schools" ng-click="ctrl.onSchoolSelected($index)" ng-keydown="ctrl.onSchoolSelected($index, $event)"> {{school.name}} </div> </div> </div> </div> </div> </div> <div class="btn-group"> <a href="/userbook/annuaire#/search" class="btn btn-secondary rounded-pill" ng-if="ctrl.isStudent" ng-click="trackEvent($event, {detail:{\'open\':\'student.class\'} })" translate content="school-widget.widget.my.classroom"></a> <a ng-href="{{ctrl.getUrlTeachersOfMyClass()}}" class="btn btn-outline-secondary rounded-pill" ng-if="ctrl.isStudent" ng-click="trackEvent($event, {detail:{\'open\':\'student.teachers\'} })" translate content="school-widget.widget.my.team"></a> <a ng-href="{{ctrl.getUrlStudentsOfMyClasses()}}" class="btn btn-secondary rounded-pill" ng-if="ctrl.isTeacher" ng-click="trackEvent($event, {detail:{\'open\':\'teacher.students\'} })" translate content="school-widget.widget.my.classrooms"></a> <a ng-href="{{ctrl.getUrlSchoolTeachers()}}" class="btn btn-outline-secondary rounded-pill" ng-if="ctrl.isTeacher" ng-click="trackEvent($event, {detail:{\'open\':\'teacher.teachers\'} })" translate content="school-widget.widget.school.team"></a> <a ng-href="{{ctrl.getUrlTeachersOfMyChildren()}}" class="btn btn-secondary rounded-pill" ng-if="ctrl.isRelative" ng-click="trackEvent($event, {detail:{\'open\':\'relative.teachers\'} })" translate content="school-widget.widget.school.team"></a> <a ng-href="{{ctrl.getUrlSchoolPersonnels()}}" class="btn btn-outline-secondary rounded-pill" ng-if="ctrl.isRelative" ng-click="trackEvent($event, {detail:{\'open\':\'relative.direction\'} })" translate content="school-widget.widget.school.managers"></a> <a ng-href="{{ctrl.getUrlSchoolPersonnelsAndTeachers()}}" class="btn btn-secondary rounded-pill" ng-if="ctrl.isPersonnel" ng-click="trackEvent($event, {detail:{\'open\':\'personnel.personnels\'} })" translate content="school-widget.widget.school.personnelAndTeachers"></a> <a ng-href="{{ctrl.getUrlStudents()}}" class="btn btn-outline-secondary rounded-pill" ng-if="ctrl.isPersonnel" ng-click="trackEvent($event, {detail:{\'open\':\'personnel.students\'} })" translate content="school-widget.widget.students"></a> </div> </div> </div> '},5623:function(e,t,n){var o=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(r,s){function l(e){try{c(o.next(e))}catch(e){s(e)}}function i(e){try{c(o.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(l,i)}c((o=o.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var n,o,r,s,l={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function i(s){return function(i){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;l;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return l.label++,{value:s[1],done:!1};case 5:l.label++,o=s[1],s=[0];continue;case 7:s=l.ops.pop(),l.trys.pop();continue;default:if(!(r=l.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){l=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){l.label=s[1];break}if(6===s[0]&&l.label<r[1]){l.label=r[1],r=s;break}if(r&&l.label<r[2]){l.label=r[2],l.ops.push(s);break}r[2]&&l.ops.pop(),l.trys.pop();continue}s=t.call(e,l)}catch(e){s=[6,e],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,i])}}},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.odeModuleName=void 0;var l=s(n(4202)),i=n(5262),c=n(9419),a=function(){function e(e){this.themeHelperSvc=e}return Object.defineProperty(e.prototype,"me",{get:function(){return c.session().user},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"description",{get:function(){return c.session().description},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"avatar",{get:function(){return c.session().avatarUrl},enumerable:!1,configurable:!0}),e.prototype.initialize=function(){var e,t;return o(this,void 0,void 0,(function(){var n,o,s=this;return r(this,(function(r){switch(r.label){case 0:return this._userPref=null===(e=i.WidgetFrameworkFactory.instance().list.find((function(e){return e.platformConf.name===i.WIDGET_NAME.SCHOOL})))||void 0===e?void 0:e.userPref,n=this,[4,this.themeHelperSvc.getBootstrapThemePath()];case 1:return n.themePath=r.sent(),[4,c.notif().onSessionReady().promise];case 2:return r.sent(),o=0,(null===(t=this._userPref)||void 0===t?void 0:t.schoolId)&&l.default.isArray(this.description.schools)&&(o=this.description.schools.findIndex((function(e){var t;return e.id===(null===(t=s._userPref)||void 0===t?void 0:t.schoolId)})),o<0&&(o=0)),this.setSelectedSchool(o),[2]}}))}))},e.prototype.getWidgetStyle=function(){return{"background-image":"url("+this.themePath+"/images/widget-3.png)"}},e.prototype.onSchoolSelected=function(e,t){var n;return(!t||"keydown"===t.type&&(13===t.which||32===t.which))&&(this._userPref&&this.setSelectedSchool(e)&&(this._userPref.schoolId=null===(n=this.selectedSchool)||void 0===n?void 0:n.id,i.WidgetFrameworkFactory.instance().saveUserPrefs()),!0)},e.prototype.setSelectedSchool=function(e){return 0<=e&&e<this.description.schools.length&&this.selectedSchool!==this.description.schools[e]&&(this.selectedSchool=this.description.schools[e],!0)},e.prototype.getDefaultUrl=function(){return"/userbook/annuaire#/search"},e.prototype.getUrlTeachersOfMyClass=function(){var e=this.getDefaultUrl();if(this.me.classes&&this.me.classes.length>0){e+="?filters=groups&profile=Teacher";for(var t=0,n=this.me.classes;t<n.length;t++){e+="&class="+n[t]}}return e},e.prototype.getUrlStudentsOfMyClasses=function(){var e=this.getDefaultUrl()+"?filters=groups&profile=Student";this.selectedSchool&&(e+="&structure="+this.selectedSchool.id);for(var t=0,n=this.me.classes;t<n.length;t++){e+="&class="+n[t]}return e},e.prototype.getUrlSchoolTeachers=function(){return this.selectedSchool?"/userbook/annuaire#/search?filters=groups&structure="+this.selectedSchool.id+"&profile=Teacher":this.getDefaultUrl()},e.prototype.getUrlTeachersOfMyChildren=function(){for(var e=this.getDefaultUrl()+"?filters=groups&profile=Teacher",t=0,n=this.me.classes;t<n.length;t++){e+="&class="+n[t]}return e},e.prototype.getUrlSchoolPersonnels=function(){return this.selectedSchool?"/userbook/annuaire#/search?filters=users&structure="+this.selectedSchool.id+"&profile=Personnel":this.getDefaultUrl()},e.prototype.getUrlSchoolPersonnelsAndTeachers=function(){return this.selectedSchool?"/userbook/annuaire#/search?filters=users&structure="+this.selectedSchool.id+"&profile=Personnel&profile=Teacher":this.getDefaultUrl()},e.prototype.getUrlStudents=function(){var e=this.getDefaultUrl()+"?filters=groups&profile=Student";return this.selectedSchool&&(e+="&structure="+this.selectedSchool.id),e},Object.defineProperty(e.prototype,"hasManySchools",{get:function(){return this.description.schools.length>1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isStudent",{get:function(){return"ELEVE"===this.me.type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isTeacher",{get:function(){return"ENSEIGNANT"===this.me.type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isRelative",{get:function(){return"PERSRELELEVE"===this.me.type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isPersonnel",{get:function(){return"PERSEDUCNAT"===this.me.type},enumerable:!1,configurable:!0}),e}(),d=function(){function e(){this.restrict="E",this.template=n(4257).Z,this.controller=["odeThemeHelperService",a],this.controllerAs="ctrl",this.require=["odeSchoolWidget"]}return e.prototype.link=function(e,t,n,s){return o(this,void 0,void 0,(function(){var t;return r(this,(function(n){switch(n.label){case 0:return(t=s?s[0]:null)?[4,t.initialize()]:[2];case 1:return n.sent(),e.$apply(),e.trackEvent=function(e,t){var n;void 0===t.bubbles&&(t.bubbles=!0);var o=null;(null===(n=null==t?void 0:t.detail)||void 0===n?void 0:n.open)&&-1!==["student.class","student.teachers","teacher.students","teacher.teachers","relative.teachers","relative.direction","profile"].indexOf(t.detail.open)&&(o=new CustomEvent(c.TrackedActionFromWidget.school,t)),o&&e.currentTarget&&e.currentTarget.dispatchEvent(o)},[2]}}))}))},e}();c.notif().onLangReady().promise.then((function(e){c.conf().Platform.idiom.addKeys(n(3926))})),t.odeModuleName="odeSchoolWidgetModule",l.default.module(t.odeModuleName,[]).directive("odeSchoolWidget",(function(){return new d}))},3926:e=>{e.exports=JSON.parse('{"school-widget.widget.my.classroom":"Ma classe","school-widget.widget.my.classrooms":"Mes classes","school-widget.widget.my.team":"Mes enseignants","school-widget.widget.school.team":"Équipe enseignante","school-widget.widget.school.managers":"Personnels","school-widget.widget.school.personnelAndTeachers":"Personnels et Enseignants","school-widget.widget.students":"Élèves","school-widget":"Mon réseau"}')}}]);
|
|
2
2
|
//# sourceMappingURL=school-widget.widget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widgets/school-widget/school-widget.widget.js","mappings":"gIAGA,QAFW,2pG,8iDCDX,iBACA,UACA,UAIA,aACC,WACSA,GAAA,KAAAA,eAAAA,CACN,CAkIJ,OAhIC,sBAAY,iBAAE,C,IAAd,WACC,OAAO,EAAAC,UAAUC,IAClB,E,gCACA,sBAAc,0BAAW,C,IAAzB,WACC,OAAO,EAAAD,UAAUE,WAClB,E,gCACA,sBAAc,qBAAM,C,IAApB,WACC,OAAO,EAAAF,UAAUG,SAClB,E,gCAIa,YAAAC,WAAb,W,iHAEkB,OADjBC,KAAKC,UAAuG,QAA3F,IAAAC,uBAAuBC,WAAWC,KAAKC,MAAM,SAAAC,GAAK,OAAAA,EAAEC,aAAaC,OAAO,EAAAC,YAAYC,MAAlC,WAAyC,eAAEC,SAC9G,EAAAX,KAAiB,GAAMA,KAAKN,eAAekB,yB,OAC3C,OADA,EAAKC,UAAY,SACjB,GAAM,EAAAC,QAAQC,iBAAiBC,S,cAA/B,SAGIC,EAAe,GACD,QAAd,EAAAjB,KAAKC,iBAAS,eAAEiB,WAAY,UAAQC,QAAQnB,KAAKH,YAAYuB,WAChEH,EAAejB,KAAKH,YAAYuB,QAAQC,WAAW,SAAAC,GAAM,MAAI,OAAAA,EAAOC,MAAmB,QAAd,I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ACC,QAAT,EAAAF,aAAC,EAADA,EAAGG,cAAM,eAAEC,QAKe,IAJ5B,CAAC,gBAAkB,mBAClB,mBAAqB,mBACrB,oBAAqB,qBACrB,WACCC,QAAQL,EAAEG,OAAOC,QACpBF,EAAQ,IAAII,YAAa,EAAAC,wBAAwB7C,OAAQsC,IAEtDE,GAASH,EAAES,eACdT,EAAES,cAAcC,cAAcP,EAEhC,E,YAEF,EAjCA,GAyCA,EAAAhD,QAAQwD,cAActD,QAAQuD,MAAM,SAAAC,GAEzB,EAAAC,OAAOC,SAASC,MAAMC,QAAS,EAAQ,MAElD,IAIa,EAAAC,cAAgB,wBAC7B,UAAQC,OAAQ,EAAAD,cAAe,IAAIE,UAAW,mBAd9C,WACC,OAAO,IAAIC,CACZ,G","sources":["webpack://ode-ngjs-front/./src/ts/widgets/school-widget/school-widget.widget.html","webpack://ode-ngjs-front/./src/ts/widgets/school-widget/school-widget.widget.ts"],"sourcesContent":["// Module\nvar code = \"<div class=\\\"widget-school\\\"> <div class=\\\"widget-body\\\"> <div class=\\\"widget-school-header\\\" ng-style=\\\"ctrl.getWidgetStyle()\\\"> <div class=\\\"d-flex align-items-center\\\"> <div class=\\\"me-4\\\"> <a href=\\\"/userbook/mon-compte\\\" class=\\\"avatar-link\\\" i18n-title=\\\"navbar.myaccount\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'profile'} })\\\"> <img data-ng-src=\\\"[[ctrl.avatar ? ctrl.avatar+'?thumbnail=48x48' : '']]\\\" alt=\\\"{{ctrl.description.displayName}}\\\"/> </a> </div> <div class=\\\"flex-grow-1\\\"> <div class=\\\"name\\\">{{ctrl.description.displayName}}</div> <div ng-if=\\\"!ctrl.hasManySchools\\\" class=\\\"school\\\">{{ctrl.selectedSchool.name}}</div> <div ng-if=\\\"ctrl.hasManySchools\\\" class=\\\"dropdown\\\"> <div class=\\\"school-multiple dropdown-toggle\\\" role=\\\"button\\\" id=\\\"ddSchoolWidgetSchool\\\" data-bs-toggle=\\\"dropdown\\\" aria-haspopup=\\\"true\\\" aria-expanded=\\\"false\\\"> <a href=\\\"\\\" class=\\\"text-white\\\">{{ctrl.selectedSchool.name}}</a> </div> <div class=\\\"school-choice dropdown-menu\\\" aria-labelledby=\\\"ddSchoolWidgetSchool\\\"> <div tabindex=\\\"0\\\" role=\\\"button\\\" class=\\\"dropdown-item\\\" ng-repeat=\\\"school in ctrl.description.schools\\\" ng-click=\\\"ctrl.onSchoolSelected($index)\\\" ng-keydown=\\\"ctrl.onSchoolSelected($index, $event)\\\"> {{school.name}} </div> </div> </div> </div> </div> </div> <div class=\\\"btn-group\\\"> <a href=\\\"/userbook/annuaire#/search\\\" class=\\\"btn btn-third rounded-pill\\\" ng-if=\\\"ctrl.isStudent\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'student.class'} })\\\" translate content=\\\"school-widget.widget.my.classroom\\\"></a> <a ng-href=\\\"{{ctrl.getUrlTeachersOfMyClass()}}\\\" class=\\\"btn btn-outline-third rounded-pill\\\" ng-if=\\\"ctrl.isStudent\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'student.teachers'} })\\\" translate content=\\\"school-widget.widget.my.team\\\"></a> <a ng-href=\\\"{{ctrl.getUrlStudentsOfMyClasses()}}\\\" class=\\\"btn btn-third rounded-pill\\\" ng-if=\\\"ctrl.isTeacher\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'teacher.students'} })\\\" translate content=\\\"school-widget.widget.my.classrooms\\\"></a> <a ng-href=\\\"{{ctrl.getUrlSchoolTeachers()}}\\\" class=\\\"btn btn-outline-third rounded-pill\\\" ng-if=\\\"ctrl.isTeacher\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'teacher.teachers'} })\\\" translate content=\\\"school-widget.widget.school.team\\\"></a> <a ng-href=\\\"{{ctrl.getUrlTeachersOfMyChildren()}}\\\" class=\\\"btn btn-third rounded-pill\\\" ng-if=\\\"ctrl.isRelative\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'relative.teachers'} })\\\" translate content=\\\"school-widget.widget.school.team\\\"></a> <a ng-href=\\\"{{ctrl.getUrlSchoolPersonnels()}}\\\" class=\\\"btn btn-outline-third rounded-pill\\\" ng-if=\\\"ctrl.isRelative\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'relative.direction'} })\\\" translate content=\\\"school-widget.widget.school.managers\\\"></a> <a ng-href=\\\"{{ctrl.getUrlSchoolPersonnelsAndTeachers()}}\\\" class=\\\"btn btn-third rounded-pill\\\" ng-if=\\\"ctrl.isPersonnel\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'personnel.personnels'} })\\\" translate content=\\\"school-widget.widget.school.personnelAndTeachers\\\"></a> <a ng-href=\\\"{{ctrl.getUrlStudents()}}\\\" class=\\\"btn btn-outline-third rounded-pill\\\" ng-if=\\\"ctrl.isPersonnel\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'personnel.students'} })\\\" translate content=\\\"school-widget.widget.students\\\"></a> </div> </div> </div> \";\n// Exports\nexport default code;","import angular, { IAttributes, IController, IDirective } from \"angular\";\nimport { IUserDescription, IUserInfo, School, WidgetFrameworkFactory, WidgetUserPref, WIDGET_NAME } from \"ode-ts-client\";\nimport { conf, notif, session, TrackedScope, TrackedAction, TrackedActionFromWidget } from \"../../utils\";\nimport { ThemeHelperService } from \"../../services\";\n\n/* Controller for the directive */\nclass Controller implements IController {\n\tconstructor( \n\t\tprivate themeHelperSvc:ThemeHelperService\n\t) {}\n\n\tprivate get me():IUserInfo {\n\t\treturn session().user;\n\t}\n\tprotected get description():IUserDescription {\n\t\treturn session().description;\n\t}\n\tprotected get avatar():string {\n\t\treturn session().avatarUrl;\n\t}\n\n\tprivate _userPref?:WidgetUserPref;\n\n\tpublic async initialize() {\n\t\tthis._userPref = WidgetFrameworkFactory.instance().list.find( w => w.platformConf.name===WIDGET_NAME.SCHOOL)?.userPref;\n\t\tthis.themePath = await this.themeHelperSvc.getBootstrapThemePath();\n\t\tawait notif().onSessionReady().promise;\n\n\t\t// #WB-22, memorize the latest school choice\n\t\tlet defaultIndex = 0;\n\t\tif( this._userPref?.schoolId && angular.isArray(this.description.schools) ) {\n\t\t\tdefaultIndex = this.description.schools.findIndex( school => school.id===this._userPref?.schoolId );\n\t\t\tif( defaultIndex < 0 ) {\n\t\t\t\tdefaultIndex = 0;\n\t\t\t}\n\t\t}\n\t\tthis.setSelectedSchool( defaultIndex );\n\t}\n\n\tprivate selectedSchool?:School;\n\tprivate themePath?:string;\n\n\tprotected getWidgetStyle() {\n\t\treturn {\n\t\t\t'background-image': \"url(\"+ this.themePath +\"/images/widget-3.png)\"\n\t\t};\n\t}\n\n\tprotected onSchoolSelected( idx:number, ev?:JQuery.Event ) {\n\t\t// If an event is given, and related to pressing the enter or spacebar key.\n\t\tif( !ev || (ev.type==='keydown' && (ev.which===13 || ev.which===32)) ) {\t\n\t\t\tif( this._userPref && this.setSelectedSchool(idx) ) {\n\t\t\t\t// Selected school changed => #WB-22, memorize the latest school choice\n\t\t\t\tthis._userPref.schoolId = this.selectedSchool?.id;\n\t\t\t\tWidgetFrameworkFactory.instance().saveUserPrefs();\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate setSelectedSchool( idx:number ):boolean {\n\t\tif( 0 <= idx && idx < this.description.schools.length && this.selectedSchool !== this.description.schools[idx]) {\n\t\t\tthis.selectedSchool = this.description.schools[idx];\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate getDefaultUrl() {\n\t\treturn \"/userbook/annuaire#/search\";\n\t}\n\t\n\tprotected getUrlTeachersOfMyClass() {\n\t\tlet url = this.getDefaultUrl();\n\t\tif( this.me.classes && this.me.classes.length>0 ) {\n\t\t\turl += \"?filters=groups&profile=Teacher\";\n\t\t\tfor( let clazz of this.me.classes ) {\n\t\t\t\turl += \"&class=\"+clazz;\n\t\t\t}\n\t\t}\n\t\treturn url;\n\t}\n\tprotected getUrlStudentsOfMyClasses() {\n\t\tlet url = this.getDefaultUrl() + \"?filters=groups&profile=Student\";\n\t\tif( this.selectedSchool ) {\n\t\t\turl += \"&structure=\"+this.selectedSchool.id;\n\t\t}\n\t\tfor( let clazz of this.me.classes ) {\n\t\t\turl += \"&class=\"+clazz;\n\t\t}\n\t\treturn url;\n\t}\n\tprotected getUrlSchoolTeachers() {\n\t\tif( this.selectedSchool )\n\t\t\treturn \"/userbook/annuaire#/search?filters=groups&structure=\"+this.selectedSchool.id+\"&profile=Teacher\";\n\t\treturn this.getDefaultUrl();\n\t}\n\tprotected getUrlTeachersOfMyChildren() {\n\t\tlet url = this.getDefaultUrl() + \"?filters=groups&profile=Teacher\";\n\t\tfor( let clazz of this.me.classes ) {\n\t\t\turl += \"&class=\"+clazz;\n\t\t}\n\t\treturn url;\n\t}\n\tprotected getUrlSchoolPersonnels() {\n\t\tif( this.selectedSchool )\n\t\t\treturn \"/userbook/annuaire#/search?filters=users&structure=\"+this.selectedSchool.id+\"&profile=Personnel\";\n\t\treturn this.getDefaultUrl();\n\t}\n\tprotected getUrlSchoolPersonnelsAndTeachers() {\n\t\tif( this.selectedSchool )\n\t\t\treturn \"/userbook/annuaire#/search?filters=users&structure=\"+this.selectedSchool.id+\"&profile=Personnel&profile=Teacher\";\n\t\treturn this.getDefaultUrl();\n\t}\n\tprotected getUrlStudents() { \n\t\tlet url = this.getDefaultUrl() + \"?filters=groups&profile=Student\";\n\t\tif( this.selectedSchool ) {\n\t\t\turl += \"&structure=\"+this.selectedSchool.id;\n\t\t}\n\t\treturn url;\n\t}\n\n\tprotected get hasManySchools() {\n\t\treturn this.description.schools.length > 1;\n\t}\n\n\tprotected get isStudent():boolean {\n\t\treturn this.me.type===\"ELEVE\";\n\t}\n\tprotected get isTeacher():boolean {\n\t\treturn this.me.type===\"ENSEIGNANT\";\n\t}\n\tprotected get isRelative():boolean {\n\t\treturn this.me.type===\"PERSRELELEVE\";\n\t}\n\tprotected get isPersonnel():boolean {\n\t\treturn this.me.type===\"PERSEDUCNAT\";\n\t}\n}\n\n/* Directive */\nclass Directive implements IDirective<TrackedScope,JQLite,IAttributes,IController[]> {\n restrict = 'E';\n\ttemplate = require('./school-widget.widget.html').default;\n\tcontroller = [\"odeThemeHelperService\", Controller];\n\tcontrollerAs = 'ctrl';\n\trequire = ['odeSchoolWidget'];\n\n async link(scope:TrackedScope, elem:JQLite, attrs:IAttributes, controllers?:IController[]) {\n const ctrl:Controller|null = controllers ? controllers[0] as Controller : null;\n\t\tif( ! ctrl ) return;\n\n\t\tawait ctrl.initialize();\n\t\tscope.$apply();\n\n\t\t// Give an opportunity to track some events from outside of this widget.\n\t\tscope.trackEvent = (e:Event, p:CustomEventInit<TrackedAction>) => {\n\t\t\t// Allow events to bubble up.\n\t\t\tif(typeof p.bubbles === \"undefined\") p.bubbles = true;\n\n\t\t\tlet event = null;\n\t\t\tif( p?.detail?.open &&\n\t\t\t\t\t['student.class'\t\t,'student.teachers'\n\t\t\t\t\t,'teacher.students'\t\t,'teacher.teachers'\n\t\t\t\t\t,'relative.teachers'\t,'relative.direction'\n\t\t\t\t\t,'profile'\n\t\t\t\t\t].indexOf(p.detail.open)!==-1 ) {\n\t\t\t\tevent = new CustomEvent( TrackedActionFromWidget.school, p );\n\t\t\t}\n\t\t\tif( event && e.currentTarget ) {\n\t\t\t\te.currentTarget.dispatchEvent(event);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/** The school-widget widget. */\nfunction DirectiveFactory() {\n\treturn new Directive();\n}\n\n// Preload translations\nnotif().onLangReady().promise.then( lang => {\n\tswitch( lang ) {\n\t\tdefault:\tconf().Platform.idiom.addKeys( require('./i18n/fr.json') ); break;\n\t}\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 = \"odeSchoolWidgetModule\";\nangular.module( odeModuleName, []).directive( \"odeSchoolWidget\", DirectiveFactory );\n"],"names":["themeHelperSvc","session","user","description","avatarUrl","initialize","this","_userPref","WidgetFrameworkFactory","instance","list","find","w","platformConf","name","WIDGET_NAME","SCHOOL","userPref","getBootstrapThemePath","themePath","notif","onSessionReady","promise","defaultIndex","schoolId","isArray","schools","findIndex","school","id","setSelectedSchool","getWidgetStyle","onSchoolSelected","idx","ev","type","which","selectedSchool","saveUserPrefs","length","getDefaultUrl","getUrlTeachersOfMyClass","url","me","classes","getUrlStudentsOfMyClasses","getUrlSchoolTeachers","getUrlTeachersOfMyChildren","getUrlSchoolPersonnels","getUrlSchoolPersonnelsAndTeachers","getUrlStudents","restrict","template","controller","Controller","controllerAs","require","link","scope","elem","attrs","controllers","ctrl","$apply","trackEvent","e","p","bubbles","event","detail","open","indexOf","CustomEvent","TrackedActionFromWidget","currentTarget","dispatchEvent","onLangReady","then","lang","conf","Platform","idiom","addKeys","odeModuleName","module","directive","Directive"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"widgets/school-widget/school-widget.widget.js","mappings":"gIAGA,QAFW,4rG,8iDCDX,iBACA,UACA,UAIA,aACC,WACSA,GAAA,KAAAA,eAAAA,CACN,CAkIJ,OAhIC,sBAAY,iBAAE,C,IAAd,WACC,OAAO,EAAAC,UAAUC,IAClB,E,gCACA,sBAAc,0BAAW,C,IAAzB,WACC,OAAO,EAAAD,UAAUE,WAClB,E,gCACA,sBAAc,qBAAM,C,IAApB,WACC,OAAO,EAAAF,UAAUG,SAClB,E,gCAIa,YAAAC,WAAb,W,iHAEkB,OADjBC,KAAKC,UAAuG,QAA3F,IAAAC,uBAAuBC,WAAWC,KAAKC,MAAM,SAAAC,GAAK,OAAAA,EAAEC,aAAaC,OAAO,EAAAC,YAAYC,MAAlC,WAAyC,eAAEC,SAC9G,EAAAX,KAAiB,GAAMA,KAAKN,eAAekB,yB,OAC3C,OADA,EAAKC,UAAY,SACjB,GAAM,EAAAC,QAAQC,iBAAiBC,S,cAA/B,SAGIC,EAAe,GACD,QAAd,EAAAjB,KAAKC,iBAAS,eAAEiB,WAAY,UAAQC,QAAQn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,EAAMK,SAGNL,EAAMM,WAAa,SAACC,EAASC,G,WAEJ,IAAdA,EAAEC,UAAyBD,EAAEC,SAAU,GAEjD,IAAIC,EAAQ,MACC,QAAT,EAAAF,aAAC,EAADA,EAAGG,cAAM,eAAEC,QAKe,IAJ5B,CAAC,gBAAkB,mBAClB,mBAAqB,mBACrB,oBAAqB,qBACrB,WACCC,QAAQL,EAAEG,OAAOC,QACpBF,EAAQ,IAAII,YAAa,EAAAC,wBAAwB7C,OAAQsC,IAEtDE,GAASH,EAAES,eACdT,EAAES,cAAcC,cAAcP,EAEhC,E,YAEF,EAjCA,GAyCA,EAAAhD,QAAQwD,cAActD,QAAQuD,MAAM,SAAAC,GAEzB,EAAAC,OAAOC,SAASC,MAAMC,QAAS,EAAQ,MAElD,IAIa,EAAAC,cAAgB,wBAC7B,UAAQC,OAAQ,EAAAD,cAAe,IAAIE,UAAW,mBAd9C,WACC,OAAO,IAAIC,CACZ,G","sources":["webpack://ode-ngjs-front/./src/ts/widgets/school-widget/school-widget.widget.html","webpack://ode-ngjs-front/./src/ts/widgets/school-widget/school-widget.widget.ts"],"sourcesContent":["// Module\nvar code = \"<div class=\\\"widget-school\\\"> <div class=\\\"widget-body\\\"> <div class=\\\"widget-school-header\\\" ng-style=\\\"ctrl.getWidgetStyle()\\\"> <div class=\\\"d-flex align-items-center\\\"> <div class=\\\"me-16\\\"> <a href=\\\"/userbook/mon-compte\\\" class=\\\"avatar-link\\\" i18n-title=\\\"navbar.myaccount\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'profile'} })\\\"> <img data-ng-src=\\\"[[ctrl.avatar ? ctrl.avatar+'?thumbnail=48x48' : '']]\\\" alt=\\\"{{ctrl.description.displayName}}\\\"/> </a> </div> <div class=\\\"flex-grow-1\\\"> <div class=\\\"name\\\">{{ctrl.description.displayName}}</div> <div ng-if=\\\"!ctrl.hasManySchools\\\" class=\\\"school\\\">{{ctrl.selectedSchool.name}}</div> <div ng-if=\\\"ctrl.hasManySchools\\\" class=\\\"dropdown\\\"> <div class=\\\"school-multiple dropdown-toggle\\\" role=\\\"button\\\" id=\\\"ddSchoolWidgetSchool\\\" data-bs-toggle=\\\"dropdown\\\" aria-haspopup=\\\"true\\\" aria-expanded=\\\"false\\\"> <a href=\\\"\\\" class=\\\"text-white\\\">{{ctrl.selectedSchool.name}}</a> </div> <div class=\\\"school-choice dropdown-menu\\\" aria-labelledby=\\\"ddSchoolWidgetSchool\\\"> <div tabindex=\\\"0\\\" role=\\\"button\\\" class=\\\"dropdown-item\\\" ng-repeat=\\\"school in ctrl.description.schools\\\" ng-click=\\\"ctrl.onSchoolSelected($index)\\\" ng-keydown=\\\"ctrl.onSchoolSelected($index, $event)\\\"> {{school.name}} </div> </div> </div> </div> </div> </div> <div class=\\\"btn-group\\\"> <a href=\\\"/userbook/annuaire#/search\\\" class=\\\"btn btn-secondary rounded-pill\\\" ng-if=\\\"ctrl.isStudent\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'student.class'} })\\\" translate content=\\\"school-widget.widget.my.classroom\\\"></a> <a ng-href=\\\"{{ctrl.getUrlTeachersOfMyClass()}}\\\" class=\\\"btn btn-outline-secondary rounded-pill\\\" ng-if=\\\"ctrl.isStudent\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'student.teachers'} })\\\" translate content=\\\"school-widget.widget.my.team\\\"></a> <a ng-href=\\\"{{ctrl.getUrlStudentsOfMyClasses()}}\\\" class=\\\"btn btn-secondary rounded-pill\\\" ng-if=\\\"ctrl.isTeacher\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'teacher.students'} })\\\" translate content=\\\"school-widget.widget.my.classrooms\\\"></a> <a ng-href=\\\"{{ctrl.getUrlSchoolTeachers()}}\\\" class=\\\"btn btn-outline-secondary rounded-pill\\\" ng-if=\\\"ctrl.isTeacher\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'teacher.teachers'} })\\\" translate content=\\\"school-widget.widget.school.team\\\"></a> <a ng-href=\\\"{{ctrl.getUrlTeachersOfMyChildren()}}\\\" class=\\\"btn btn-secondary rounded-pill\\\" ng-if=\\\"ctrl.isRelative\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'relative.teachers'} })\\\" translate content=\\\"school-widget.widget.school.team\\\"></a> <a ng-href=\\\"{{ctrl.getUrlSchoolPersonnels()}}\\\" class=\\\"btn btn-outline-secondary rounded-pill\\\" ng-if=\\\"ctrl.isRelative\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'relative.direction'} })\\\" translate content=\\\"school-widget.widget.school.managers\\\"></a> <a ng-href=\\\"{{ctrl.getUrlSchoolPersonnelsAndTeachers()}}\\\" class=\\\"btn btn-secondary rounded-pill\\\" ng-if=\\\"ctrl.isPersonnel\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'personnel.personnels'} })\\\" translate content=\\\"school-widget.widget.school.personnelAndTeachers\\\"></a> <a ng-href=\\\"{{ctrl.getUrlStudents()}}\\\" class=\\\"btn btn-outline-secondary rounded-pill\\\" ng-if=\\\"ctrl.isPersonnel\\\" ng-click=\\\"trackEvent($event, {detail:{'open':'personnel.students'} })\\\" translate content=\\\"school-widget.widget.students\\\"></a> </div> </div> </div> \";\n// Exports\nexport default code;","import angular, { IAttributes, IController, IDirective } from \"angular\";\nimport { IUserDescription, IUserInfo, School, WidgetFrameworkFactory, WidgetUserPref, WIDGET_NAME } from \"ode-ts-client\";\nimport { conf, notif, session, TrackedScope, TrackedAction, TrackedActionFromWidget } from \"../../utils\";\nimport { ThemeHelperService } from \"../../services\";\n\n/* Controller for the directive */\nclass Controller implements IController {\n\tconstructor( \n\t\tprivate themeHelperSvc:ThemeHelperService\n\t) {}\n\n\tprivate get me():IUserInfo {\n\t\treturn session().user;\n\t}\n\tprotected get description():IUserDescription {\n\t\treturn session().description;\n\t}\n\tprotected get avatar():string {\n\t\treturn session().avatarUrl;\n\t}\n\n\tprivate _userPref?:WidgetUserPref;\n\n\tpublic async initialize() {\n\t\tthis._userPref = WidgetFrameworkFactory.instance().list.find( w => w.platformConf.name===WIDGET_NAME.SCHOOL)?.userPref;\n\t\tthis.themePath = await this.themeHelperSvc.getBootstrapThemePath();\n\t\tawait notif().onSessionReady().promise;\n\n\t\t// #WB-22, memorize the latest school choice\n\t\tlet defaultIndex = 0;\n\t\tif( this._userPref?.schoolId && angular.isArray(this.description.schools) ) {\n\t\t\tdefaultIndex = this.description.schools.findIndex( school => school.id===this._userPref?.schoolId );\n\t\t\tif( defaultIndex < 0 ) {\n\t\t\t\tdefaultIndex = 0;\n\t\t\t}\n\t\t}\n\t\tthis.setSelectedSchool( defaultIndex );\n\t}\n\n\tprivate selectedSchool?:School;\n\tprivate themePath?:string;\n\n\tprotected getWidgetStyle() {\n\t\treturn {\n\t\t\t'background-image': \"url(\"+ this.themePath +\"/images/widget-3.png)\"\n\t\t};\n\t}\n\n\tprotected onSchoolSelected( idx:number, ev?:JQuery.Event ) {\n\t\t// If an event is given, and related to pressing the enter or spacebar key.\n\t\tif( !ev || (ev.type==='keydown' && (ev.which===13 || ev.which===32)) ) {\t\n\t\t\tif( this._userPref && this.setSelectedSchool(idx) ) {\n\t\t\t\t// Selected school changed => #WB-22, memorize the latest school choice\n\t\t\t\tthis._userPref.schoolId = this.selectedSchool?.id;\n\t\t\t\tWidgetFrameworkFactory.instance().saveUserPrefs();\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate setSelectedSchool( idx:number ):boolean {\n\t\tif( 0 <= idx && idx < this.description.schools.length && this.selectedSchool !== this.description.schools[idx]) {\n\t\t\tthis.selectedSchool = this.description.schools[idx];\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate getDefaultUrl() {\n\t\treturn \"/userbook/annuaire#/search\";\n\t}\n\t\n\tprotected getUrlTeachersOfMyClass() {\n\t\tlet url = this.getDefaultUrl();\n\t\tif( this.me.classes && this.me.classes.length>0 ) {\n\t\t\turl += \"?filters=groups&profile=Teacher\";\n\t\t\tfor( let clazz of this.me.classes ) {\n\t\t\t\turl += \"&class=\"+clazz;\n\t\t\t}\n\t\t}\n\t\treturn url;\n\t}\n\tprotected getUrlStudentsOfMyClasses() {\n\t\tlet url = this.getDefaultUrl() + \"?filters=groups&profile=Student\";\n\t\tif( this.selectedSchool ) {\n\t\t\turl += \"&structure=\"+this.selectedSchool.id;\n\t\t}\n\t\tfor( let clazz of this.me.classes ) {\n\t\t\turl += \"&class=\"+clazz;\n\t\t}\n\t\treturn url;\n\t}\n\tprotected getUrlSchoolTeachers() {\n\t\tif( this.selectedSchool )\n\t\t\treturn \"/userbook/annuaire#/search?filters=groups&structure=\"+this.selectedSchool.id+\"&profile=Teacher\";\n\t\treturn this.getDefaultUrl();\n\t}\n\tprotected getUrlTeachersOfMyChildren() {\n\t\tlet url = this.getDefaultUrl() + \"?filters=groups&profile=Teacher\";\n\t\tfor( let clazz of this.me.classes ) {\n\t\t\turl += \"&class=\"+clazz;\n\t\t}\n\t\treturn url;\n\t}\n\tprotected getUrlSchoolPersonnels() {\n\t\tif( this.selectedSchool )\n\t\t\treturn \"/userbook/annuaire#/search?filters=users&structure=\"+this.selectedSchool.id+\"&profile=Personnel\";\n\t\treturn this.getDefaultUrl();\n\t}\n\tprotected getUrlSchoolPersonnelsAndTeachers() {\n\t\tif( this.selectedSchool )\n\t\t\treturn \"/userbook/annuaire#/search?filters=users&structure=\"+this.selectedSchool.id+\"&profile=Personnel&profile=Teacher\";\n\t\treturn this.getDefaultUrl();\n\t}\n\tprotected getUrlStudents() { \n\t\tlet url = this.getDefaultUrl() + \"?filters=groups&profile=Student\";\n\t\tif( this.selectedSchool ) {\n\t\t\turl += \"&structure=\"+this.selectedSchool.id;\n\t\t}\n\t\treturn url;\n\t}\n\n\tprotected get hasManySchools() {\n\t\treturn this.description.schools.length > 1;\n\t}\n\n\tprotected get isStudent():boolean {\n\t\treturn this.me.type===\"ELEVE\";\n\t}\n\tprotected get isTeacher():boolean {\n\t\treturn this.me.type===\"ENSEIGNANT\";\n\t}\n\tprotected get isRelative():boolean {\n\t\treturn this.me.type===\"PERSRELELEVE\";\n\t}\n\tprotected get isPersonnel():boolean {\n\t\treturn this.me.type===\"PERSEDUCNAT\";\n\t}\n}\n\n/* Directive */\nclass Directive implements IDirective<TrackedScope,JQLite,IAttributes,IController[]> {\n restrict = 'E';\n\ttemplate = require('./school-widget.widget.html').default;\n\tcontroller = [\"odeThemeHelperService\", Controller];\n\tcontrollerAs = 'ctrl';\n\trequire = ['odeSchoolWidget'];\n\n async link(scope:TrackedScope, elem:JQLite, attrs:IAttributes, controllers?:IController[]) {\n const ctrl:Controller|null = controllers ? controllers[0] as Controller : null;\n\t\tif( ! ctrl ) return;\n\n\t\tawait ctrl.initialize();\n\t\tscope.$apply();\n\n\t\t// Give an opportunity to track some events from outside of this widget.\n\t\tscope.trackEvent = (e:Event, p:CustomEventInit<TrackedAction>) => {\n\t\t\t// Allow events to bubble up.\n\t\t\tif(typeof p.bubbles === \"undefined\") p.bubbles = true;\n\n\t\t\tlet event = null;\n\t\t\tif( p?.detail?.open &&\n\t\t\t\t\t['student.class'\t\t,'student.teachers'\n\t\t\t\t\t,'teacher.students'\t\t,'teacher.teachers'\n\t\t\t\t\t,'relative.teachers'\t,'relative.direction'\n\t\t\t\t\t,'profile'\n\t\t\t\t\t].indexOf(p.detail.open)!==-1 ) {\n\t\t\t\tevent = new CustomEvent( TrackedActionFromWidget.school, p );\n\t\t\t}\n\t\t\tif( event && e.currentTarget ) {\n\t\t\t\te.currentTarget.dispatchEvent(event);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/** The school-widget widget. */\nfunction DirectiveFactory() {\n\treturn new Directive();\n}\n\n// Preload translations\nnotif().onLangReady().promise.then( lang => {\n\tswitch( lang ) {\n\t\tdefault:\tconf().Platform.idiom.addKeys( require('./i18n/fr.json') ); break;\n\t}\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 = \"odeSchoolWidgetModule\";\nangular.module( odeModuleName, []).directive( \"odeSchoolWidget\", DirectiveFactory );\n"],"names":["themeHelperSvc","session","user","description","avatarUrl","initialize","this","_userPref","WidgetFrameworkFactory","instance","list","find","w","platformConf","name","WIDGET_NAME","SCHOOL","userPref","getBootstrapThemePath","themePath","notif","onSessionReady","promise","defaultIndex","schoolId","isArray","schools","findIndex","school","id","setSelectedSchool","getWidgetStyle","onSchoolSelected","idx","ev","type","which","selectedSchool","saveUserPrefs","length","getDefaultUrl","getUrlTeachersOfMyClass","url","me","classes","getUrlStudentsOfMyClasses","getUrlSchoolTeachers","getUrlTeachersOfMyChildren","getUrlSchoolPersonnels","getUrlSchoolPersonnelsAndTeachers","getUrlStudents","restrict","template","controller","Controller","controllerAs","require","link","scope","elem","attrs","controllers","ctrl","$apply","trackEvent","e","p","bubbles","event","detail","open","indexOf","CustomEvent","TrackedActionFromWidget","currentTarget","dispatchEvent","onLangReady","then","lang","conf","Platform","idiom","addKeys","odeModuleName","module","directive","Directive"],"sourceRoot":""}
|
package/package.json
CHANGED