Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 18.189.194.225
{"version":3,"sources":["containers/DefaultLayout/newcontrolModal.js"],"names":["NewControlModal","_Component","_getPrototypeOf2","_this","_classCallCheck","this","_len","arguments","length","args","Array","_key","_possibleConstructorReturn","_getPrototypeOf","call","apply","concat","state","deggrp","fdeggrp","fdescpn","fyear","fexamtype","fexamdate","fdeleted","fexamrange","changeDeggrp","e","data","props","filter","el","i","value","setState","setDegreeGroup","_objectSpread","setValues","changeExam","handleChange","_defineProperty","name","_inherits","_createClass","key","fetchDegGrp","control","localStorage","getItem","control1","JSON","parse","prevProps","user","deggroup_options","map","text","_this$state$deggrp","examdate_options","fyeartype","window","innerHeight","React","createElement","Card","fluid","Content","Description","style","overflowY","height","wheight","Form","Field","Dropdown","size","search","selection","onChange","placeholder","disabled","openOnFocus","options","selectOnBlur","searchInput","autoFocus","Input","width","label","Button","padding","color","onClick","content","Component","connect","closeError"],"mappings":"sPAMMA,UAAe,SAAAC,GAAA,SAAAD,IAAA,IAAAE,EAAAC,EAAAC,YAAAC,KAAAL,GAAA,QAAAM,EAAAC,UAAAC,OAAAC,EAAA,IAAAC,MAAAJ,GAAAK,EAAA,EAAAA,EAAAL,EAAAK,IAAAF,EAAAE,GAAAJ,UAAAI,GAuDlB,OAvDkBR,EAAAS,YAAAP,MAAAH,EAAAW,YAAAb,IAAAc,KAAAC,MAAAb,EAAA,CAAAG,MAAAW,OAAAP,MACnBQ,MAAQ,CACNC,OAAQ,CACNC,QAAS,GACTC,QAAS,GACTC,MAAO,GACPC,UAAW,GACXC,UAAW,GACXC,UAAU,GAEZC,WAAY,IACbtB,EAoBDuB,aAAe,SAACC,EAAGC,GACjB,IAAMV,EAASf,EAAK0B,MAAMX,OAAOY,OAAO,SAACC,EAAIC,GAC3C,OAAOD,EAAGZ,SAAWS,EAAKK,QACzB,GACH9B,EAAK+B,SAAS,CAAEhB,OA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nD,gBACAV,oBALW4D,CAOb/F","file":"static/js/286.4ac52111.chunk.js","sourcesContent":["import React, { Component } from \"react\";\r\nimport { connect } from \"react-redux\";\r\nimport { closeError, fetchDegGrp } from \"../../actions\";\r\nimport { setDegreeGroup } from \"../../actions/registration/loginRegn\";\r\nimport { Button, Modal, Form, Dropdown, Card } from \"semantic-ui-react\";\r\nimport { wHeight } from \"../../pages/parms/\";\r\nclass NewControlModal extends Component {\r\n state = {\r\n deggrp: {\r\n fdeggrp: \"\",\r\n fdescpn: \"\",\r\n fyear: \"\",\r\n fexamtype: \"\",\r\n fexamdate: \"\",\r\n fdeleted: false\r\n },\r\n fexamrange: \"\"\r\n };\r\n\r\n componentDidMount() {\r\n this.props.fetchDegGrp();\r\n const control = localStorage.getItem(\"control\");\r\n if (control !== null) {\r\n const control1 = JSON.parse(control);\r\n this.setState({\r\n deggrp: { ...this.state.deggrp, ...control1 },\r\n fexamrange: control1.fexamrange\r\n });\r\n }\r\n }\r\n\r\n componentDidUpdate(prevProps) {\r\n if (this.props.user !== prevProps.user) {\r\n this.props.fetchDegGrp();\r\n }\r\n }\r\n\r\n changeDeggrp = (e, data) => {\r\n const deggrp = this.props.deggrp.filter((el, i) => {\r\n return el.fdeggrp == data.value;\r\n })[0];\r\n this.setState({ deggrp: deggrp });\r\n\r\n this.props.setDegreeGroup({ ...deggrp, fexamrange: this.state.fexamrange });\r\n };\r\n\r\n setValues = () => {\r\n this.props.setDegreeGroup({\r\n ...this.state.deggrp,\r\n fexamrange: this.state.fexamrange\r\n });\r\n };\r\n\r\n changeExam = (e, data) => {\r\n this.setState({ fexamrange: data.value });\r\n };\r\n\r\n handleChange = (e, data) => {\r\n this.setState({\r\n deggrp: { ...this.state.deggrp, [data.name]: data.value }\r\n });\r\n };\r\n\r\n render() {\r\n // const { open, size, header, content } = this.props.error;\r\n const deggroup = this.props.deggrp;\r\n\r\n var deggroup_options = deggroup.map((el, i) => {\r\n return {\r\n key: i,\r\n value: el.fdeggrp,\r\n text: `${el.fdeggrp} - ${el.fdescpn}`\r\n };\r\n });\r\n\r\n const { fdeggrp, fyear, fexamtype, fexamdate } = this.state.deggrp;\r\n\r\n const examdate_options = [\r\n { key: 1, value: `${fyear}${fexamtype}`, text: fexamdate }\r\n ];\r\n\r\n const fyeartype = `${fyear}${fexamtype}`;\r\n\r\n const wHeight = (window.innerHeight * 50) / 100;\r\n\r\n return (\r\n <div>\r\n <Card fluid>\r\n <Card.Content>\r\n <Card.Description\r\n style={{ overflowY: \"auto\", height: `${this.wheight}px` }}\r\n >\r\n <Form>\r\n <Form.Field>\r\n <label>Degree Group</label>\r\n <Dropdown\r\n size=\"mini\"\r\n fluid\r\n search\r\n selection\r\n value={fdeggrp}\r\n onChange={this.changeDeggrp}\r\n placeholder=\"Select Degree Group\"\r\n disabled={this.props.disabled}\r\n openOnFocus={false}\r\n options={deggroup_options}\r\n selectOnBlur={false}\r\n searchInput={{ autoFocus: true }}\r\n />\r\n </Form.Field>\r\n <Form.Field>\r\n {/* <Form.Input\r\n placeholder=\"Year\"\r\n name=\"fyear\"\r\n onChange={this.handleChange}\r\n value={fyear}\r\n width={4}\r\n label=\"Year\"\r\n />\r\n <Form.Input\r\n placeholder=\"Type\"\r\n name=\"fexamtype\"\r\n onChange={this.handleChange}\r\n value={fexamtype}\r\n width={3}\r\n label=\"Type\"\r\n /> */}\r\n\r\n <Dropdown\r\n size=\"mini\"\r\n fluid\r\n search\r\n selection\r\n value={fyeartype}\r\n placeholder=\"Select Exam Date\"\r\n openOnFocus={false}\r\n options={examdate_options}\r\n selectOnBlur={false}\r\n />\r\n {/* <Form.Input\r\n placeholder=\"Exam Date\"\r\n label=\"Exam Date\"\r\n width={10}\r\n value={fexamdate}\r\n readOnly\r\n /> */}\r\n </Form.Field>\r\n <Form.Field>\r\n <Form.Input\r\n placeholder=\"Exam Range\"\r\n onChange={this.changeExam}\r\n value={this.state.fexamrange}\r\n width={4}\r\n label=\"Exam Range\"\r\n />\r\n </Form.Field>\r\n </Form>\r\n <br />\r\n\r\n <Button\r\n style={{ padding: \"0.5em 1em\" }}\r\n color=\"blue\"\r\n onClick={this.setValues}\r\n content=\"Set\"\r\n />\r\n\r\n {/* <Button\r\n ref=\"error_ok\"\r\n style={{ padding: \"0.5em 1em\" }}\r\n color=\"black\"\r\n onClick={this.close}\r\n content=\"Close\"\r\n /> */}\r\n </Card.Description>\r\n </Card.Content>\r\n </Card>\r\n </div>\r\n );\r\n }\r\n}\r\n\r\nconst mapStateToProps = state => {\r\n return { user: state.user, deggrp: state.deggrp };\r\n};\r\n\r\nexport default connect(\r\n mapStateToProps,\r\n {\r\n closeError,\r\n fetchDegGrp,\r\n setDegreeGroup\r\n }\r\n)(NewControlModal);\r\n"],"sourceRoot":""}
|