ScoDoc/static/mobile/static/js/main.81258512.chunk.js

2 lines
34 KiB
JavaScript
Raw Normal View History

2021-06-10 14:58:27 +02:00
(this.webpackJsonpscodocmobile=this.webpackJsonpscodocmobile||[]).push([[0],{101:function(e,t,s){"use strict";s.r(t);var a=s(0),n=s(17),i=s.n(n),c=s(16),r=function(e){e&&e instanceof Function&&s.e(3).then(s.bind(null,118)).then((function(t){var s=t.getCLS,a=t.getFID,n=t.getFCP,i=t.getLCP,c=t.getTTFB;s(e),a(e),n(e),i(e),c(e)}))},o=s(14),l=s(7),d=s(8),h=s(21),j=s(10),u=s(9),b=(s(29),s(114)),p=s(106),m=s(77),O=s(72),f=s(1),x=function(e){Object(j.a)(s,e);var t=Object(u.a)(s);function s(e){var a;return Object(l.a)(this,s),(a=t.call(this,e)).state={logout:!1},a}return Object(d.a)(s,[{key:"logout",value:function(){var e=this,t=window.$api_url;fetch(t+"acl_users/logout").then((function(t){e.setState({logout:!0})})).catch(console.log)}},{key:"render",value:function(){var e=this;return Object(f.jsxs)(b.a,{bg:"light",expand:"sm",children:[Object(f.jsxs)(p.a,{children:[Object(f.jsxs)(b.a.Brand,{href:window.$api_url+"static/mobile/",children:[Object(f.jsx)("img",{alt:"ScodocLogo",src:"/ScoDoc/static/icons/scologo_img.png",width:"20",height:"30",className:"d-inline-block align-top"})," ","ScoDoc"]}),Object(f.jsx)(b.a.Toggle,{"aria-controls":"basic-navbar-nav"}),Object(f.jsx)(b.a.Collapse,{id:"basic-navbar-nav",children:Object(f.jsxs)(m.a,{className:"ml-auto",children:[Object(f.jsx)(m.a.Link,{href:"/ScoDoc",children:"Version Desktop"}),Object(f.jsx)(O.a,{variant:"primary",onClick:function(){e.logout()},children:"D\xe9connexion"})]})})]}),!0===this.state.logout&&Object(f.jsx)(o.a,{push:!0,to:"/"})]})}}]),s}(a.Component),v=s(73),g=s(107);function w(e){return fetch(e,{method:"GET",verify:!1,credentials:"include"})}function y(e){return w(e).then((function(e){return e.json().then((function(e){return{data:e}})).then((function(e){return e}))}))}function S(e,t){return fetch(e,{method:"POST",verify:!1,credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t})}var C=function(e){Object(j.a)(s,e);var t=Object(u.a)(s);function s(e){var a;return Object(l.a)(this,s),(a=t.call(this,e)).state={students:[],search_status:0},a.handleChangeSearch=a.handleChangeSearch.bind(Object(h.a)(a)),a.searchStudent=a.searchStudent.bind(Object(h.a)(a)),a}return Object(d.a)(s,[{key:"handleChangeSearch",value:function(e){this.setState({search:e.target.value})}},{key:"searchStudent",value:function(e){var t=this,s=window.location.href.split("/")[7];y(window.$api_url+s+"/Scolarite/Notes/search_etud_by_name?term="+e+"&format=json").then((function(e){t.setState({students:e.data}),0===t.state.students.length?t.setState({search_status:1,toast:!0}):t.setState({search_status:2,toast:!1})})),this.setState({searched:!0})}},{key:"result",value:function(){return!0===this.state.toast?Object(f.jsx)("div",{id:"wrapDept",children:"Aucun \xe9tudiant trouv\xe9"}):2===this.state.search_status?Object(f.jsx)(v.a,{children:this.state.students.map((function(e){return Object(f.jsx)(g.a,{id:"wrapDept",children:Object(f.jsx)(c.c,{to:"/".concat(window.location.href.split("/")[7],"/Scolarite/Etudiant/").concat(e.value),children:Object(f.jsx)("span",{children:e.label})})})}))}):void 0}},{key:"render",value:function(){var e=this;return Object(f.jsxs)("div",{className:"wrapper",children:[Object(f.jsxs)("div",{className:"input-group",children:[Object(f.jsx)("input",{type:"text",id:"search",className:"form-control",onChange:this.handleChangeSearch}),Object(f.jsx)("div",{className:"input-group-append",children:Object(f.jsx)("button",{type:"button",className:"btn waves-effect waves-light btn-primary",onClick:function(){e.searchStudent(e.state.search)},children:"Rechercher"})})]}),this.result()]})}}]),s}(a.Component),k=s(115),D=s(116),_=function(e){Object(j.a)(s,e);var t=Object(u.a)(s);function s(e){var a;return Object(l.a)(this,s),(a=t.call(this,e)).dismissToast=function(){return a.setState({toast:!1})},a.state={semestres:[],students:[],toast:!1},a.dismissToast=a.dismissToast.bind(Object(h.a)(a)),a}return Object(d.a)(s,[{key:"componentWillMount",value:function(){this.getData()}},{key:"getData",value:function(){var e=this,t=window.location.href.split("/")[7];y(window.$api_u
//# sourceMappingURL=main.81258512.chunk.js.map