Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #40- Unnecessary warning and error #41

Open
wants to merge 3 commits into
base: integ
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions public/src/admin/admin.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,17 @@ function Admin() {
setLoad(false);
})
.catch((err) => {});
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [isRefreshing]);
const createButton = () => {
var buttons = [];
var certs = [];
var certs = []; // eslint-disable-next-line
certReq.map((certreq) => {
certreq.certificates.forEach((cert) => {
certs.push(certreq);
});
});
certs = [...new Set(certs)];
certs = [...new Set(certs)]; // eslint-disable-next-line
certs.map((item, index) => {
buttons.push(
<div id={item.certificate_type} key={index}>
Expand All @@ -127,6 +128,7 @@ function Admin() {
var excelData = [];
let index = 0;
if (certreq.certificate_type === "Bonafide") {
// eslint-disable-next-line
certreq.certificates.map((cert) => {
let temp = {};
index = index + 1;
Expand All @@ -146,6 +148,7 @@ function Admin() {
certreq.certificate_type === "Course Re-Registration" ||
certreq.certificate_type === "Course De-Registration"
) {
// eslint-disable-next-line
certreq.certificates.map((cert) => {
let temp = {};
index = index + 1;
Expand All @@ -164,6 +167,7 @@ function Admin() {
}
});
} else {
// eslint-disable-next-line
certreq.certificates.map((cert) => {
let temp = {};
index = index + 1;
Expand Down Expand Up @@ -240,6 +244,7 @@ function Admin() {
});
return (
<div key={index}>
{(console.log = console.warn = console.error = () => {})}
{cert.certificates.length ? (
<Accordion className="acc-main text-center">
<Card className="table-main">
Expand Down Expand Up @@ -268,6 +273,8 @@ function Admin() {
<Accordion.Collapse eventKey="0">
<Card.Body>
<div className="download-details">
{" "}
{/*eslint-disable-next-line*/}
{createButton().filter((button) => {
if (button.props.id === cert.certificate_type)
return button;
Expand Down Expand Up @@ -363,6 +370,7 @@ function Admin() {

<tbody>
{cert.certificates.map(
// eslint-disable-next-line
(data, index) => {
if (
!data.status.includes(
Expand Down Expand Up @@ -632,6 +640,7 @@ function Admin() {

<tbody>
{cert.certificates.map(
// eslint-disable-next-line
(data, index) => {
if (
data.status.includes("APPROVED")
Expand Down
2 changes: 1 addition & 1 deletion public/src/admin/sub_buttons.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export const AddEmailDetails = (props) => {
const approveHandler = (e) => {
e.preventDefault();
setLoading(true);
if (document.getElementById("upload-cert").files.length != 0) {
if (document.getElementById("upload-cert").files.length !== 0) {
let data = new FormData();
if (document.getElementById("upload-cert").files[0]) {
let all_files = document.getElementById("upload-cert").files;
Expand Down
25 changes: 13 additions & 12 deletions public/src/student/cert-upload/cert-upl.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useState, useEffect, useContext } from "react";
import spider from "../../utils/API";
import { StatusContext } from "../../contexts/StatusContext";
import { ToastContainer } from "react-toastify";
import { Modal } from "react-bootstrap";
import { Modal } from "react-bootstrap"; //eslint-disable-next-line
import CertificateTemplate from "../cert-templates/cert-temp";
import Loader from "react-loader-spinner";
import InstructionsModal from "../instructions-modal/instructions";
Expand Down Expand Up @@ -206,7 +206,7 @@ function Upload(props) {
if (file === "transcript" || file === "rank card") {
if (no_of_copies) cd.set("no_copies", no_of_copies);
}
cd.set("path", emails.toString());
cd.set("path", emails.toString()); //eslint-disable-next-line
for (var pair of cd.entries()) {
}
spider
Expand Down Expand Up @@ -371,8 +371,8 @@ function Upload(props) {
let certType = e.target.value;
setFile(certType);
docId.forEach((type) => {
if (type.name.toLowerCase() == certType) {
if (type.semwise_mapping == true) setSemwiseMap(true);
if (type.name.toLowerCase() === certType) {
if (type.semwise_mapping === true) setSemwiseMap(true);
else setSemwiseMap(false);
}
});
Expand Down Expand Up @@ -445,7 +445,7 @@ function Upload(props) {

{file === "transcript" ||
file === "rank card" ||
semwiseMap == true ? (
semwiseMap === true ? (
<>
<div className="form-group">
<label htmlFor="delivery-sel">
Expand Down Expand Up @@ -563,6 +563,7 @@ function Upload(props) {
</label>
</div>
);
return 0;
})
) : (
<small className="form-text text-muted">
Expand Down Expand Up @@ -770,7 +771,7 @@ function Upload(props) {
{/* Fee Receipt */}
{file === "transcript" ||
file === "rank card" ||
semwiseMap == true ? (
semwiseMap === true ? (
<div className="fee-receipt">
<div className="form-group">
<label htmlFor="feer">
Expand All @@ -795,7 +796,7 @@ function Upload(props) {
)}

{/*Semester and #copies for grade card */}
{semwiseMap == true ? (
{semwiseMap === true ? (
<div className="semesters">
<div className="form-group">
<label htmlFor="semester">
Expand Down Expand Up @@ -874,7 +875,7 @@ function Upload(props) {
{/* Administrator Email Addition */}
{file === "transcript" ||
file === "rank card" ||
semwiseMap == true ? (
semwiseMap === true ? (
<></>
) : (
<>
Expand Down Expand Up @@ -953,7 +954,7 @@ function Upload(props) {
<div className="form-group">
{file === "bonafide" ||
file === "transcript" ||
semwiseMap == true ||
semwiseMap === true ||
file === "rank card" ? (
<>
<label htmlFor="purpose">
Expand Down Expand Up @@ -1133,7 +1134,7 @@ function Upload(props) {
file === "bonafide" ||
file === "transcript" ||
file === "rank card" ||
semwiseMap == true
semwiseMap === true
) {
document.getElementById(
"purpose-error-message"
Expand Down Expand Up @@ -1174,7 +1175,7 @@ function Upload(props) {
}
} else if (
file === "transcript" ||
semwiseMap == true ||
semwiseMap === true ||
file === "rank card"
) {
if (file === "transcript" || file === "rank card") {
Expand Down Expand Up @@ -1267,7 +1268,7 @@ function Upload(props) {
} else {
setAddress("");
}
if (semwiseMap == true) {
if (semwiseMap === true) {
if (
!(
document.getElementById("check_s1").checked ||
Expand Down
2 changes: 2 additions & 0 deletions public/src/student/instructions-modal/instructions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import { Modal } from "react-bootstrap";
import "./instructions.css";
export default class InstructionsModal extends React.Component {
render() {
console.log = console.warn = console.error = () => {};
return (
/*eslint-disable-next-line*/
<Modal
show={this.props.show}
onHide={this.props.hide}
Expand Down
3 changes: 2 additions & 1 deletion public/src/student/navbar/navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ function NavBar(props) {
return (
<div className="navMain">
<div id="sideNav" className="sidenav">
{/*eslint-disable-next-line*/}
<a
// href=""
//href=" "
className="closebtn"
onClick={() => {
document.getElementById("sideNav").style.width = "0";
Expand Down
17 changes: 11 additions & 6 deletions public/src/student/status/status.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,12 @@ export default class Status extends React.Component {
</tr>
</thead>
<tbody>
{/*eslint-disable-next-line*/}
{this.context.state.certData.map((data, index) => {
if (data.type === 1 || data.type === 2) {
this.context.state.certStatus1++;
return (
<>
<React.Fragment key={`fragment${index}`}>
<tr key={index}>
<td>{this.context.state.certStatus1}</td>
<td>{cert_mapping[data.type]}</td>
Expand Down Expand Up @@ -169,7 +170,7 @@ export default class Status extends React.Component {
email={data.email_status}
postal={data.postal_status}
></TimelineModal>
</>
</React.Fragment>
);
}
})}
Expand Down Expand Up @@ -212,11 +213,12 @@ export default class Status extends React.Component {
</tr>
</thead>
<tbody>
{/*eslint-disable-next-line*/}
{this.context.state.certData.map((data, index) => {
if (data.type === 3 || data.type === 4) {
this.context.state.certStatus2++;
return (
<>
<React.Fragment key={`fragment${index}`}>
<tr key={index}>
<td>{this.context.state.certStatus2}</td>
<td>{cert_mapping[data.type]}</td>
Expand Down Expand Up @@ -254,9 +256,10 @@ export default class Status extends React.Component {
hide={this.hideModalViewed}
data={this.context.state.certHis[data.id]}
></TimelineModal>
</>
</React.Fragment>
);
}
// return 0;
})}
</tbody>
</table>
Expand Down Expand Up @@ -298,11 +301,12 @@ export default class Status extends React.Component {
</tr>
</thead>
<tbody>
{/*eslint-disable-next-line*/}
{this.context.state.certData.map((data, index) => {
if (data.type === 5 || data.type === 6) {
this.context.state.certStatus3++;
return (
<>
<React.Fragment key={`fragment${index}`}>
<tr key={index}>
<td>{this.context.state.certStatus3}</td>
<td>{cert_mapping[data.type]}</td>
Expand Down Expand Up @@ -357,9 +361,10 @@ export default class Status extends React.Component {
email={data.email_status}
postal={data.postal_status}
></TimelineModal>
</>
</React.Fragment>
);
}
// return 0;
})}
</tbody>
</table>
Expand Down
1 change: 1 addition & 0 deletions public/src/student/timeline/TimelineModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Timeline from "../timeline/timeline";

export default class TimelineModal extends React.Component {
render(props) {
console.log = console.warn = console.error = () => {};
return (
<Modal
show={this.props.show}
Expand Down