PageSourceSearch

https://onguardv3.com.au/static/js/7036.ee2c1b37.chunk.js

js onguardv3.com.au collected 2026-09-24 12:34:35 UTC 9,581 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkonguard_v3_school_ui=self.webpackChunkonguard_v3_school_ui||[]).push([[7036],{82274:(i,e,t)=>{t.r(e),t.d(e,{default:()=>j});var s=t(9950),n=t(63318),r=t(52765),c=t(41988),a=t(29917),o=t(45409),l=t(86925),d=t(78003),h=t(87094),p=t(90650),f=t(12916),y=t(54694),g=(t(63114),t(46685)),u=t(23065),P=t(59051),m=t.n(P),b=t(51189),v=t(46987),x=t(96847),A=t(44414);const C=r.A.Group,S=(0,A.jsx)(x.A,{children:" "});class _ extends s.Component{constructor(){super(...arguments),this.state={proficiencyList:[],trainingId:"",viewModal:null,iconLoading:!1,testId:"",userName:"",trainingHasProficiency:!0,hasProficiency:!0,proficiency_date:"",checkAllProficiency:!1,ProficiencyIndeterminate:!1,proficiency_date_disable:!0,checkedProficiencyList:[],proficiency_date_string:"",multi_select:!1},this.show_notification_unavailable=()=>{l.A.info({message:"Unavailable",description:"Proficiency register is not available for this test"})},this.fetchProficiency=()=>{var i;let e=[];this.setState({loadingProficiency:!0,tableLoading:!0});let t={schoolId:(0,g.getCookie)(g.COOKIE.SCHOOL_PID),trainingId:this.state.trainingId,userRole:"Supervisor"};var s;null!==this&&void 0!==this&&null!==(i=this.props)&&void 0!==i&&i.testPublicId&&(t.testId=null===this||void 0===this||null===(s=this.props)||void 0===s?void 0:s.testPublicId);(0,u.Z)("/schools/fetch-training-proficiency-details","put",t).then(i=>{if(i){if(i.status&&"FAIL"===i.status)l.A.error({message:"Failed",description:"Failed to fetch training proficiencyList list."}),this.setState({loadingProficiency:!1,tableLoading:!1});else if(i.data&&i.data.training){let t=i.data.allProficiencyCriteria;if(t)for(let i=0;i<t.length;i++)"ENABLED"===t[i].status&&e.push(t[i]);this.setState({proficiencyList:e,iconLoading:!1},()=>{var e;let t=null===i||void 0===i||null===(e=i.data)||void 0===e?void 0:e.selectedProficiencyCriteria;if(t&&t.length>0){let e=new Set(this.state.checkedProficiencyList),c=new Set(t.map(i=>i.proficiencyCriteriaId));if(c.size>0){var s,n,r;let{ProficiencyIndeterminate:t,checkAllProficiency:a}=this.state;c.size===(null===i||void 0===i||null===(s=i.data)||void 0===s?void 0:s.allProficiencyCriteria.length)?(t=!1,a=!0):(t=!0,a=!1),null===i||void 0===i||null===(n=i.data)||void 0===n||null===(r=n.allProficiencyCriteria)||void 0===r||r.forEach(i=>{c.has(i.proficiencyCriteriaId)&&e.add(i.proficiencyCriteriaId)}),this.setState({checkedProficiencyList:Array.from(e),ProficiencyIndeterminate:t,checkAllProficiency:a})}}this.setState({loadingProficiency:!1})})}}else l.A.error({message:"Failed",description:"Failed to fetch training proficiencyList list."}),this.setState({loadingProficiency:!1,tableLoading:!1})}).catch(i=>{console.log(i)})},this.showModal=()=>{if(!this.props.supervisorDemonstratedDate||"NOT-COMPLETED"===this.props.supervisorDemonstratedDate||!this.props.passedOn||"NOT-COMPLETED"===this.props.passedOn)return this.show_notification_unavailable(),void this.setState({loadingProficiency:!1,tableLoading:!1});this.setState({viewModal:!0},()=>{this.fetchProficiency()})},this.onCheckAllProficiencyChange=i=>{let e=!0;i.target.checked&&(e=!1);let t=[];this.state.proficiencyList.map(i=>t.push(i.proficiencyCriteriaId)),this.setState({checkedProficiencyList:i.target.checked?t:[],ProficiencyIndeterminate:!1,checkAllProficiency:i.target.checked,proficiency_date_disable:e,proficiency_date:"",proficiency_date_string:""})},this.onChangeProficiency=i=>{let e=!0,{test:t,proficiencyList:s,ProficiencyIndeterminate:n,checkAllProficiency:r,hasProficiency:c}=this.state,a="",o="";s.length===i.length&&(e=!1,a="",o=""),i.length<1?(n=!1,r=!1):i.length===s.length?(n=!1,r=!0):n=!0,c||(this.state.proficiency_date?a=this.state.proficiency_date:t.proficiencyList.date&&(a=m()(t.proficiencyList.date,b.DX))),this.setState({checkedProficiencyList:i,proficiency_date_disable:e,proficiency_date:a,proficiency_date_string:o,ProficiencyIndeterminate:n,checkAllProficiency:r})},this.onChangeProficiencyDate=(i,e)=>{this.setState({proficiency_date:i})},this.handleDateReset=()=>{this.setState({checkedProficiencyList:[],proficiency_date:null,proficiency_date_string:"",resetData:!0,ProficiencyIndeterminate:!1,checkAllProficiency:!1})},this.submitProficiency=()=>{let{checkedProficiencyList:i,proficiency_date:e,testId:t}=this.state,s=[],n=[];this.state.proficiencyList.forEach((e,t,r)=>{i.includes(e.proficiencyCriteriaId)&&(e.type?n.push(e.proficiencyCriteriaId):s.push(e.proficiencyCriteriaId))});let r={criteria:s,custom_criteria:n};e?r.date=(0,v.sq)(e):i.length<1&&(r.date=null);let c={publicId:[t],proficiency:r};this.setState({iconLoading:!0}),(0,u.Z)("/test-results/","put",c).then(i=>{this.setState({iconLoading:!1}),"SUCCESS"===i.status?(l.A.success({message:"Success",description:"Proficiency registered successfully"}),this.setState({viewModal:!1},()=>{this.props.demoProfHandleSubmit("Reload")})):l.A.error({message:"Failed",description:"Failed to register Proficiency."})})}}componentDidMount(){this.props.onRef(this),this.props.testPublicId&&this.setState({testId:this.props.testPublicId});let i="";this.props.user_name&&(i=this.props.user_name,this.setState({userName:i})),this.props.trainingHasProficiency&&this.setState({trainingHasProficiency:this.props.trainingHasProficiency}),this.props.hasProficiency&&this.setState({hasProficiency:this.props.hasProficiency}),this.props.trainingId&&this.setState({trainingId:this.props.trainingId}),this.props.multi_select&&this.setState({multi_select:this.props.multi_select})}render(){var i;let e=!1;this.props&&this.props.isSysAdmin&&(e=this.props.isSysAdmin);let{proficiencyList:t,proficiency_date_string:s,proficiency_date_disable:l,hasProficiency:g,proficiency_date:u}=this.state;return(0,A.jsxs)("div",{children:[(0,A.jsx)(o.A,{destroyOnClose:!0,title:"Register Student Training Details - "+this.state.userName,visible:this.state.viewModal,width:800,onCancel:()=>{this.setState({viewModal:!1},()=>{})},okButtonProps:{style:{display:"none"}},cancelText:"Close",children:(0,A.jsx)(p.A,{spinning:this.state.loadingProficiency,className:"onguardLoader",indicator:S,children:t&&t.length>0?(0,A.jsxs)("div",{children:[" ",this.state.trainingHasProficiency||this.state.multi_select?null:(0,A.jsx)("h4",{children:"This Training Unit does not have a proficiency Assessment"}),this.state.trainingHasProficiency||this.state.multi_select?(0,A.jsxs)("div",{className:"sub-section-container",children:[(0,A.jsx)("label",{className:"sub-header-modal",children:"Proficiency Assessment Criteria"}),(0,A.jsx)(f.A,{color:"orange",className:"mb-10",children:"Trainers can substitute the Safety proficiency Criteria listed with their own, as per their WHS training policy and procedures. As a guide trainers can use the Safety proficiency Criteria listed below to assess course participants."}),(0,A.jsx)("div",{children:(0,A.jsx)("b",{children:"The operator/p
1articipant/trainee has to have demonstrated - been observed by the trainer - displaying the following Safety Skills:"})}),(0,A.jsx)("br",{}),t.length>0&&(0,A.jsx)("div",{style:{borderBottom:"1px solid #E9E9E9",paddingBottom:"5px",marginBottom:"5px"},children:(0,A.jsx)(r.A,{indeterminate:this.state.ProficiencyIndeterminate,onChange:this.onCheckAllProficiencyChange,checked:this.state.checkAllProficiency,children:"Select all"})}),(0,A.jsx)("div",{children:(0,A.jsx)(C,{value:this.state.checkedProficiencyList,onChange:this.onChangeProficiency,children:(0,A.jsx)(c.A,{children:t?t.map((i,e)=>(0,A.jsx)(h.A,{children:(0,A.jsx)(r.A,{value:i.proficiencyCriteriaId,children:i.statementText},i.proficiencyCriteriaId)},e)):null})})}),(0,A.jsx)("br",{}),(0,A.jsxs)(h.A,{children:[(0,A.jsx)("b",{children:"The 'proficiency Assessment' date can ONLY be registered when ALL Safety proficiency Criteria are observed and assessed by the trainer."}),(0,A.jsx)("br",{}),(0,A.jsx)("br",{}),!0===this.state.trainingHasProficiency?(0,A.jsx)(f.A,{className:"mb-10",color:"orange",children:"Set by SysAdmin: Yes"}):(0,A.jsx)(f.A,{className:"mb-10",color:"orange",children:"Set by SysAdmin: No"})," ",(0,A.jsx)("br",{}),(0,A.jsx)("br",{}),(0,A.jsxs)("span",{children:[(0,A.jsx)("b",{style:{marginRight:10},children:"Register proficiency Assessment Date"}),s&&t.length>0&&(0,A.jsx)("span",{children:s}),(!s||0===t.length)&&(0,A.jsx)(a.A,{className:"mr-5",format:"DD/MM/YYYY",disabled:t.length>0&&g&&!this.state.checkAllProficiency,onChange:this.onChangeProficiencyDate,value:u})]})]}),(0,A.jsx)("br",{}),(0,A.jsx)(d.A,{title:"Are you sure you want to register the proficiency for the selected course participant?",onConfirm:this.submitProficiency,placement:"right",children:(0,A.jsx)(n.A,{type:"primary",className:"date-button",loading:this.state.iconLoading,children:"Save"})}),"\xa0 \xa0",e&&(0,A.jsx)(d.A,{title:"Are you sure you want to RESET the date and criteria?",disabled:this.state.iconLoading,onConfirm:()=>{this.handleDateReset()},children:(0,A.jsx)(n.A,{type:"primary",className:"save-btn-red fixedTableButtons",disabled:this.state.iconLoading,children:"Reset Date and Criteria"})})]}):null]}):(0,A.jsx)("p",{children:"No Active Proficiency Criteria available for this training."})})}),!1!==this.props.showLink&&(null!==this&&void 0!==this&&null!==(i=this.props)&&void 0!==i&&i.isProgressing?(0,A.jsx)("div",{children:(0,A.jsx)(y.A,{title:"Progressing",children:(0,A.jsx)("a",{onClick:()=>{this.showModal()},children:"Progressing"})})}):(0,A.jsx)("div",{children:(0,A.jsx)(y.A,{title:"Register Date",children:(0,A.jsx)("a",{onClick:()=>{this.showModal()},children:"Not Registered"})})}))]})}}const j=(0,b.y)(_)}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.