Merge branch 'main' of https://github.com/hk151109/appointment_to_examiner
This commit is contained in:
297
client/package-lock.json
generated
297
client/package-lock.json
generated
@@ -23,7 +23,10 @@
|
||||
"react-router-dom": "^6.28.0",
|
||||
"react-scripts": "5.0.1",
|
||||
"react-toastify": "^10.0.5",
|
||||
"web-vitals": "^2.1.4"
|
||||
"web-vitals": "^2.1.4",
|
||||
"xlsx": "^0.18.5",
|
||||
"xlsx-js-style": "^1.2.0",
|
||||
"xlsx-style": "^0.8.13"
|
||||
}
|
||||
},
|
||||
"node_modules/@aashutoshrathi/word-wrap": {
|
||||
@@ -5096,6 +5099,14 @@
|
||||
"node": ">=8.9"
|
||||
}
|
||||
},
|
||||
"node_modules/adler-32": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/adler-32/-/adler-32-1.3.1.tgz",
|
||||
"integrity": "sha512-ynZ4w/nUUv5rrsR8UUGoe1VC9hZj6V5hU9Qw1HlMDJGEJw5S7TfTErWTjMys6M7vr0YWcPqs3qAr4ss0nDfP+A==",
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/agent-base": {
|
||||
"version": "6.0.2",
|
||||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
|
||||
@@ -6156,6 +6167,18 @@
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/cfb": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/cfb/-/cfb-1.2.2.tgz",
|
||||
"integrity": "sha512-KfdUZsSOw19/ObEWasvBP/Ac4reZvAGauZhs6S/gqNhXhI7cKwvlH7ulj+dOEYnca4bm4SGo8C1bTAQvnTjgQA==",
|
||||
"dependencies": {
|
||||
"adler-32": "~1.3.0",
|
||||
"crc-32": "~1.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/chalk": {
|
||||
"version": "2.4.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
|
||||
@@ -6315,6 +6338,14 @@
|
||||
"node": ">= 4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/codepage": {
|
||||
"version": "1.15.0",
|
||||
"resolved": "https://registry.npmjs.org/codepage/-/codepage-1.15.0.tgz",
|
||||
"integrity": "sha512-3g6NUTPd/YtuuGrhMnOMRjFc+LJw/bnMp3+0r/Wcz3IXUuCosKRJvMphm5+Q+bvTVGcJJuRvVLuYba+WojaFaA==",
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/collect-v8-coverage": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz",
|
||||
@@ -6343,6 +6374,14 @@
|
||||
"resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz",
|
||||
"integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w=="
|
||||
},
|
||||
"node_modules/colors": {
|
||||
"version": "0.6.2",
|
||||
"resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz",
|
||||
"integrity": "sha512-OsSVtHK8Ir8r3+Fxw/b4jS1ZLPXkV6ZxDRJQzeD7qo0SqMXWrHDM71DgYzPMHY8SFJ0Ao+nNU2p1MmwdzKqPrw==",
|
||||
"engines": {
|
||||
"node": ">=0.1.90"
|
||||
}
|
||||
},
|
||||
"node_modules/combined-stream": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||
@@ -6431,6 +6470,20 @@
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="
|
||||
},
|
||||
"node_modules/concat-stream": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz",
|
||||
"integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==",
|
||||
"engines": [
|
||||
"node >= 6.0"
|
||||
],
|
||||
"dependencies": {
|
||||
"buffer-from": "^1.0.0",
|
||||
"inherits": "^2.0.3",
|
||||
"readable-stream": "^3.0.2",
|
||||
"typedarray": "^0.0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/confusing-browser-globals": {
|
||||
"version": "1.0.11",
|
||||
"resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz",
|
||||
@@ -6533,6 +6586,17 @@
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/crc-32": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz",
|
||||
"integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==",
|
||||
"bin": {
|
||||
"crc32": "bin/crc32.njs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/cross-spawn": {
|
||||
"version": "7.0.3",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
||||
@@ -8419,6 +8483,14 @@
|
||||
"node": ">= 0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/exit-on-epipe": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz",
|
||||
"integrity": "sha512-h2z5mrROTxce56S+pnvAV890uu7ls7f1kEvVGJbw1OlFH3/mlJ5bkXu0KRyW94v37zzHPiUd55iLn3DA7TjWpw==",
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/expect": {
|
||||
"version": "27.5.1",
|
||||
"resolved": "https://registry.npmjs.org/expect/-/expect-27.5.1.tgz",
|
||||
@@ -8561,6 +8633,11 @@
|
||||
"bser": "2.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/fflate": {
|
||||
"version": "0.3.11",
|
||||
"resolved": "https://registry.npmjs.org/fflate/-/fflate-0.3.11.tgz",
|
||||
"integrity": "sha512-Rr5QlUeGN1mbOHlaqcSYMKVpPbgLy0AWT/W0EHxA6NGI12yO1jpoui2zBBvU2G824ltM6Ut8BFgfHSBGfkmS0A=="
|
||||
},
|
||||
"node_modules/file-entry-cache": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
|
||||
@@ -8977,6 +9054,14 @@
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/frac": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/frac/-/frac-1.1.2.tgz",
|
||||
"integrity": "sha512-w/XBfkibaTl3YDqASwfDUqkna4Z2p9cFSr1aHDt0WoMTECnRfBOv2WArlZILlqgWlmdIlALXGpM2AOhEk5W3IA==",
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/fraction.js": {
|
||||
"version": "4.3.7",
|
||||
"resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz",
|
||||
@@ -12521,6 +12606,14 @@
|
||||
"node": ">=4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/jszip": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/jszip/-/jszip-2.4.0.tgz",
|
||||
"integrity": "sha512-m+yvNmYfRCaf1gr5YFT5e3fnSqLnE9McbNyRd0fNycsT0HltS19NKc18fh3Lvl/AIW/ovL6/MQ1JnfFg4G3o4A==",
|
||||
"dependencies": {
|
||||
"pako": "~0.2.5"
|
||||
}
|
||||
},
|
||||
"node_modules/kareem": {
|
||||
"version": "2.6.3",
|
||||
"resolved": "https://registry.npmjs.org/kareem/-/kareem-2.6.3.tgz",
|
||||
@@ -13534,6 +13627,11 @@
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/pako": {
|
||||
"version": "0.2.9",
|
||||
"resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz",
|
||||
"integrity": "sha512-NUcwaKxUxWrZLpDG+z/xZaCgQITkA/Dv4V/T6bw7VON6l1Xz/VnrBqrYjZQ12TamKHzITTfOEIYUj48y2KXImA=="
|
||||
},
|
||||
"node_modules/param-case": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz",
|
||||
@@ -15080,6 +15178,17 @@
|
||||
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/printj": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/printj/-/printj-1.1.2.tgz",
|
||||
"integrity": "sha512-zA2SmoLaxZyArQTOPj5LXecR+RagfPSU5Kw1qP+jkWeNlrq+eJZyY2oS68SU1Z/7/myXM4lo9716laOFAVStCQ==",
|
||||
"bin": {
|
||||
"printj": "bin/printj.njs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/process-nextick-args": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
||||
@@ -16630,6 +16739,17 @@
|
||||
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
|
||||
"integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g=="
|
||||
},
|
||||
"node_modules/ssf": {
|
||||
"version": "0.11.2",
|
||||
"resolved": "https://registry.npmjs.org/ssf/-/ssf-0.11.2.tgz",
|
||||
"integrity": "sha512-+idbmIXoYET47hH+d7dfm2epdOMUDjqcB4648sTZ+t2JwoyBFL/insLfB/racrDmsKB3diwsDA696pZMieAC5g==",
|
||||
"dependencies": {
|
||||
"frac": "~1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/stable": {
|
||||
"version": "0.1.8",
|
||||
"resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz",
|
||||
@@ -17669,6 +17789,11 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/typedarray": {
|
||||
"version": "0.0.6",
|
||||
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
|
||||
"integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA=="
|
||||
},
|
||||
"node_modules/typedarray-to-buffer": {
|
||||
"version": "3.1.5",
|
||||
"resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz",
|
||||
@@ -17919,6 +18044,17 @@
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/voc": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/voc/-/voc-1.2.0.tgz",
|
||||
"integrity": "sha512-BOuDjFFYvJdZO6e/N65AlaDItXo2TgyLjeyRYcqgAPkXpp5yTJcvkL2n+syO1r9Qc5g96tfBD2tuiMhYDmaGcA==",
|
||||
"bin": {
|
||||
"voc": "voc.njs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/w3c-hr-time": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz",
|
||||
@@ -18407,6 +18543,22 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/wmf": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wmf/-/wmf-1.0.2.tgz",
|
||||
"integrity": "sha512-/p9K7bEh0Dj6WbXg4JG0xvLQmIadrner1bi45VMJTfnbVHsc7yIajZyoSoK60/dtVBs12Fm6WkUI5/3WAVsNMw==",
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/word": {
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/word/-/word-0.3.0.tgz",
|
||||
"integrity": "sha512-OELeY0Q61OXpdUfTp+oweA/vtLVg5VDOXh+3he3PNzLGG/y0oylSOC1xRVj0+l4vQ3tj/bB1HVHv1ocXkQceFA==",
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/word-wrap": {
|
||||
"version": "1.2.5",
|
||||
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz",
|
||||
@@ -18804,6 +18956,149 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/xlsx": {
|
||||
"version": "0.18.5",
|
||||
"resolved": "https://registry.npmjs.org/xlsx/-/xlsx-0.18.5.tgz",
|
||||
"integrity": "sha512-dmg3LCjBPHZnQp5/F/+nnTa+miPJxUXB6vtk42YjBBKayDNagxGEeIdWApkYPOf3Z3pm3k62Knjzp7lMeTEtFQ==",
|
||||
"dependencies": {
|
||||
"adler-32": "~1.3.0",
|
||||
"cfb": "~1.2.1",
|
||||
"codepage": "~1.15.0",
|
||||
"crc-32": "~1.2.1",
|
||||
"ssf": "~0.11.2",
|
||||
"wmf": "~1.0.1",
|
||||
"word": "~0.3.0"
|
||||
},
|
||||
"bin": {
|
||||
"xlsx": "bin/xlsx.njs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/xlsx-js-style": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/xlsx-js-style/-/xlsx-js-style-1.2.0.tgz",
|
||||
"integrity": "sha512-DDT4FXFSWfT4DXMSok/m3TvmP1gvO3dn0Eu/c+eXHW5Kzmp7IczNkxg/iEPnImbG9X0Vb8QhROda5eatSR/97Q==",
|
||||
"dependencies": {
|
||||
"adler-32": "~1.2.0",
|
||||
"cfb": "^1.1.4",
|
||||
"codepage": "~1.14.0",
|
||||
"commander": "~2.17.1",
|
||||
"crc-32": "~1.2.0",
|
||||
"exit-on-epipe": "~1.0.1",
|
||||
"fflate": "^0.3.8",
|
||||
"ssf": "~0.11.2",
|
||||
"wmf": "~1.0.1",
|
||||
"word": "~0.3.0"
|
||||
},
|
||||
"bin": {
|
||||
"xlsx": "bin/xlsx.njs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/xlsx-js-style/node_modules/adler-32": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/adler-32/-/adler-32-1.2.0.tgz",
|
||||
"integrity": "sha512-/vUqU/UY4MVeFsg+SsK6c+/05RZXIHZMGJA+PX5JyWI0ZRcBpupnRuPLU/NXXoFwMYCPCoxIfElM2eS+DUXCqQ==",
|
||||
"dependencies": {
|
||||
"exit-on-epipe": "~1.0.1",
|
||||
"printj": "~1.1.0"
|
||||
},
|
||||
"bin": {
|
||||
"adler32": "bin/adler32.njs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/xlsx-js-style/node_modules/codepage": {
|
||||
"version": "1.14.0",
|
||||
"resolved": "https://registry.npmjs.org/codepage/-/codepage-1.14.0.tgz",
|
||||
"integrity": "sha512-iz3zJLhlrg37/gYRWgEPkaFTtzmnEv1h+r7NgZum2lFElYQPi0/5bnmuDfODHxfp0INEfnRqyfyeIJDbb7ahRw==",
|
||||
"dependencies": {
|
||||
"commander": "~2.14.1",
|
||||
"exit-on-epipe": "~1.0.1"
|
||||
},
|
||||
"bin": {
|
||||
"codepage": "bin/codepage.njs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/xlsx-js-style/node_modules/codepage/node_modules/commander": {
|
||||
"version": "2.14.1",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.14.1.tgz",
|
||||
"integrity": "sha512-+YR16o3rK53SmWHU3rEM3tPAh2rwb1yPcQX5irVn7mb0gXbwuCCrnkbV5+PBfETdfg1vui07nM6PCG1zndcjQw=="
|
||||
},
|
||||
"node_modules/xlsx-js-style/node_modules/commander": {
|
||||
"version": "2.17.1",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz",
|
||||
"integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg=="
|
||||
},
|
||||
"node_modules/xlsx-style": {
|
||||
"version": "0.8.13",
|
||||
"resolved": "https://registry.npmjs.org/xlsx-style/-/xlsx-style-0.8.13.tgz",
|
||||
"integrity": "sha512-Cj3pGUvzrP2q9oowpLP8GyujovTaBGjBRRUlCKPitNvHWj9JDD5+FDPZIM5QQggGb995ZhkuBSsMZOSd5TzIWg==",
|
||||
"dependencies": {
|
||||
"adler-32": "",
|
||||
"cfb": ">=0.10.0",
|
||||
"codepage": "~1.3.6",
|
||||
"commander": "",
|
||||
"crc-32": "",
|
||||
"jszip": "2.4.0",
|
||||
"ssf": "~0.8.1"
|
||||
},
|
||||
"bin": {
|
||||
"xlsx": "bin/xlsx.njs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/xlsx-style/node_modules/codepage": {
|
||||
"version": "1.3.8",
|
||||
"resolved": "https://registry.npmjs.org/codepage/-/codepage-1.3.8.tgz",
|
||||
"integrity": "sha512-cjAoQW5L/TCKWRbzt/xGBvhwJKQFhcIVO0jWQtpKQx4gr9qvXNkpRfq6gSmjjA8dB2Is/DPOb7gNwqQXP7UgTQ==",
|
||||
"dependencies": {
|
||||
"commander": "",
|
||||
"concat-stream": "",
|
||||
"voc": ""
|
||||
},
|
||||
"bin": {
|
||||
"codepage": "bin/codepage.njs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/xlsx-style/node_modules/frac": {
|
||||
"version": "0.3.1",
|
||||
"resolved": "https://registry.npmjs.org/frac/-/frac-0.3.1.tgz",
|
||||
"integrity": "sha512-1Lzf2jOjhIkRaa013KlxNOn2D9FemmQNeYUDpEIyPeFXmpLvbZXJOlaayMBT6JKXx+afQFgQ1QJ4kaF7Z07QFQ==",
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/xlsx-style/node_modules/ssf": {
|
||||
"version": "0.8.2",
|
||||
"resolved": "https://registry.npmjs.org/ssf/-/ssf-0.8.2.tgz",
|
||||
"integrity": "sha512-+ZkFDAG+ImJ48DcZvabx6YTrZ67DKkM0kbyOOtH73mbUEvNhQWWgRZrHC8+k7GuGKWQnACYLi7bj0eCt1jmosQ==",
|
||||
"dependencies": {
|
||||
"colors": "0.6.2",
|
||||
"frac": "0.3.1",
|
||||
"voc": ""
|
||||
},
|
||||
"bin": {
|
||||
"ssf": "bin/ssf.njs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/xml-name-validator": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz",
|
||||
|
||||
@@ -18,7 +18,10 @@
|
||||
"react-router-dom": "^6.28.0",
|
||||
"react-scripts": "5.0.1",
|
||||
"react-toastify": "^10.0.5",
|
||||
"web-vitals": "^2.1.4"
|
||||
"web-vitals": "^2.1.4",
|
||||
"xlsx": "^0.18.5",
|
||||
"xlsx-js-style": "^1.2.0",
|
||||
"xlsx-style": "^0.8.13"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "react-scripts start",
|
||||
|
||||
@@ -1,207 +1,22 @@
|
||||
// import React, { useState, useEffect } from "react";
|
||||
// import axios from "axios";
|
||||
|
||||
// const ConsolidatedTable = () => {
|
||||
// const [data, setData] = useState([]);
|
||||
// const [loading, setLoading] = useState(true);
|
||||
|
||||
// useEffect(() => {
|
||||
// const fetchData = async () => {
|
||||
// try {
|
||||
// const response = await axios.get("http://localhost:8080/api/table/consolidated-table");
|
||||
// setData(response.data);
|
||||
// setLoading(false);
|
||||
// } catch (error) {
|
||||
// console.error("Error fetching table data:", error);
|
||||
// setLoading(false);
|
||||
// }
|
||||
// };
|
||||
|
||||
// fetchData();
|
||||
// }, []);
|
||||
|
||||
// if (loading) {
|
||||
// return <div>Loading...</div>;
|
||||
// }
|
||||
|
||||
// return (
|
||||
// <div>
|
||||
// <h1>Consolidated Table</h1>
|
||||
// <table border="1" style={{ width: "100%", textAlign: "left" }}>
|
||||
// <thead>
|
||||
// <tr>
|
||||
// <th>Semester</th>
|
||||
// <th>Course Code</th>
|
||||
// <th>Course Name</th>
|
||||
// <th>Exam Type</th>
|
||||
// <th>Year</th>
|
||||
// <th>Marks</th>
|
||||
// <th>Name</th>
|
||||
// <th>Affiliation/College</th>
|
||||
// <th>Highest Qualification</th>
|
||||
// <th>Career Experience</th>
|
||||
// <th>Oral/Practical</th>
|
||||
// <th>Assessment</th>
|
||||
// <th>Reassessment</th>
|
||||
// <th>Paper Setting</th>
|
||||
// <th>Moderation</th>
|
||||
// <th>PwD Paper Setting</th>
|
||||
// </tr>
|
||||
// </thead>
|
||||
// <tbody>
|
||||
// {data.map((row, index) => (
|
||||
// <tr key={index}>
|
||||
// <td>{row.semester}</td>
|
||||
// <td>{row.courseCode}</td>
|
||||
// <td>{row.courseName}</td>
|
||||
// <td>{row.examType}</td>
|
||||
// <td>{row.year}</td>
|
||||
// <td>{row.marks}</td>
|
||||
// <td>{row.Name}</td>
|
||||
// <td>{row.affiliation}</td>
|
||||
// <td>{row.qualification}</td>
|
||||
// <td>{row.experience}</td>
|
||||
// <td>{row.oralPractical}</td>
|
||||
// <td>{row.assessment}</td>
|
||||
// <td>{row.reassessment}</td>
|
||||
// <td>{row.paperSetting}</td>
|
||||
// <td>{row.moderation}</td>
|
||||
// <td>{row.pwdPaperSetting}</td>
|
||||
// </tr>
|
||||
// ))}
|
||||
// </tbody>
|
||||
// </table>
|
||||
// </div>
|
||||
// );
|
||||
// };
|
||||
|
||||
// export default ConsolidatedTable;
|
||||
|
||||
|
||||
|
||||
// import React, { useState, useEffect } from "react";
|
||||
// import axios from "axios";
|
||||
// import { CSVLink } from "react-csv";
|
||||
|
||||
// const ConsolidatedTable = () => {
|
||||
// const [data, setData] = useState([]);
|
||||
// const [loading, setLoading] = useState(true);
|
||||
|
||||
// useEffect(() => {
|
||||
// const fetchData = async () => {
|
||||
// try {
|
||||
// const response = await axios.get("http://localhost:8080/api/table/consolidated-table");
|
||||
// setData(response.data);
|
||||
// setLoading(false);
|
||||
// } catch (error) {
|
||||
// console.error("Error fetching table data:", error);
|
||||
// setLoading(false);
|
||||
// }
|
||||
// };
|
||||
|
||||
// fetchData();
|
||||
// }, []);
|
||||
|
||||
// if (loading) {
|
||||
// return <div>Loading...</div>;
|
||||
// }
|
||||
|
||||
// // Extract unique faculty names
|
||||
// const uniqueTeachers = [...new Set(data.map((row) => row.Name))];
|
||||
|
||||
// return (
|
||||
// <div>
|
||||
// <h1>Faculty Tables with Download Option</h1>
|
||||
// {uniqueTeachers.map((teacher, index) => {
|
||||
// // Filter rows for the current teacher
|
||||
// const teacherData = data.filter((row) => row.Name === teacher);
|
||||
|
||||
// return (
|
||||
// <div key={index} style={{ marginBottom: "20px" }}>
|
||||
// <h2>{teacher}'s Table</h2>
|
||||
// <table border="1" style={{ width: "100%", textAlign: "left", marginBottom: "10px" }}>
|
||||
// <thead>
|
||||
// <tr>
|
||||
// <th>Semester</th>
|
||||
// <th>Course Code</th>
|
||||
// <th>Course Name</th>
|
||||
// <th>Exam Type</th>
|
||||
// <th>Year</th>
|
||||
// <th>Marks</th>
|
||||
// <th>Name</th>
|
||||
// <th>Affiliation/College</th>
|
||||
// <th>Highest Qualification</th>
|
||||
// <th>Career Experience</th>
|
||||
// <th>Oral/Practical</th>
|
||||
// <th>Assessment</th>
|
||||
// <th>Reassessment</th>
|
||||
// <th>Paper Setting</th>
|
||||
// <th>Moderation</th>
|
||||
// <th>PwD Paper Setting</th>
|
||||
// </tr>
|
||||
// </thead>
|
||||
// <tbody>
|
||||
// {teacherData.map((row, idx) => (
|
||||
// <tr key={idx}>
|
||||
// <td>{row.semester}</td>
|
||||
// <td>{row.courseCode}</td>
|
||||
// <td>{row.courseName}</td>
|
||||
// <td>{row.examType}</td>
|
||||
// <td>{row.year}</td>
|
||||
// <td>{row.marks}</td>
|
||||
// <td>{row.Name}</td>
|
||||
// <td>{row.affiliation}</td>
|
||||
// <td>{row.qualification}</td>
|
||||
// <td>{row.experience}</td>
|
||||
// <td>{row.oralPractical}</td>
|
||||
// <td>{row.assessment}</td>
|
||||
// <td>{row.reassessment}</td>
|
||||
// <td>{row.paperSetting}</td>
|
||||
// <td>{row.moderation}</td>
|
||||
// <td>{row.pwdPaperSetting}</td>
|
||||
// </tr>
|
||||
// ))}
|
||||
// </tbody>
|
||||
// </table>
|
||||
// {/* CSV Download Button */}
|
||||
// <CSVLink
|
||||
// data={teacherData}
|
||||
// filename={`${teacher.replace(/\s+/g, "_")}_table.csv`}
|
||||
// className="btn btn-primary"
|
||||
// style={{
|
||||
// padding: "10px 15px",
|
||||
// backgroundColor: "#007bff",
|
||||
// color: "white",
|
||||
// textDecoration: "none",
|
||||
// borderRadius: "5px",
|
||||
// }}
|
||||
// >
|
||||
// Download CSV
|
||||
// </CSVLink>
|
||||
// </div>
|
||||
// );
|
||||
// })}
|
||||
// </div>
|
||||
// );
|
||||
// };
|
||||
|
||||
// export default ConsolidatedTable;
|
||||
|
||||
|
||||
|
||||
import React, { useState, useEffect, useRef } from "react";
|
||||
import React, { useState, useEffect } from "react";
|
||||
import axios from "axios";
|
||||
import { CSVLink } from "react-csv";
|
||||
import * as XLSX from "xlsx-js-style";
|
||||
import { sendEmail } from "../api";
|
||||
import { createExcelBook } from "../api";
|
||||
|
||||
const ConsolidatedTable = () => {
|
||||
const [data, setData] = useState([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const csvLinksRef = useRef([]); // Ref to store CSV links for bulk download
|
||||
const [currentPage, setCurrentPage] = useState(1);
|
||||
const tablesPerPage = 5;
|
||||
const [expandedTeacher, setExpandedTeacher] = useState(null);
|
||||
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
try {
|
||||
const response = await axios.get("http://localhost:8080/api/table/consolidated-table");
|
||||
const response = await axios.get(
|
||||
"http://localhost:8080/api/table/consolidated-table"
|
||||
);
|
||||
setData(response.data);
|
||||
setLoading(false);
|
||||
} catch (error) {
|
||||
@@ -220,24 +35,103 @@ const ConsolidatedTable = () => {
|
||||
// Extract unique faculty names
|
||||
const uniqueTeachers = [...new Set(data.map((row) => row.Name))];
|
||||
|
||||
const handleBulkDownload = () => {
|
||||
// Trigger all individual downloads programmatically
|
||||
csvLinksRef.current.forEach((csvLink) => {
|
||||
if (csvLink) {
|
||||
csvLink.link.click();
|
||||
}
|
||||
// Pagination
|
||||
const indexOfLastTable = currentPage * tablesPerPage;
|
||||
const indexOfFirstTable = indexOfLastTable - tablesPerPage;
|
||||
const currentTeachers = uniqueTeachers.slice(indexOfFirstTable, indexOfLastTable);
|
||||
|
||||
const totalPages = Math.ceil(uniqueTeachers.length / tablesPerPage);
|
||||
|
||||
const handleNextPage = () => {
|
||||
if (currentPage < totalPages) setCurrentPage((prevPage) => prevPage + 1);
|
||||
};
|
||||
|
||||
const handlePrevPage = () => {
|
||||
if (currentPage > 1) setCurrentPage((prevPage) => prevPage - 1);
|
||||
};
|
||||
|
||||
const createExcelFile = (teacherData, teacherName) => {
|
||||
const workbook = createExcelBook(teacherData, teacherName);
|
||||
XLSX.writeFile(workbook, `${teacherName.replace(/\s+/g, "_")}_Table.xlsx`);
|
||||
};
|
||||
|
||||
const bulkDownload = () => {
|
||||
uniqueTeachers.forEach((teacher) => {
|
||||
const teacherData = data.filter((row) => row.Name === teacher);
|
||||
createExcelFile(teacherData, teacher);
|
||||
});
|
||||
};
|
||||
|
||||
const handleSendEmail = async (teacher, teacherData) => {
|
||||
const facultyId = teacherData[0].facultyId; // This assumes all rows for a teacher have the same facultyId
|
||||
try {
|
||||
const response = await axios.get(
|
||||
`http://localhost:8080/api/faculty/${facultyId}`
|
||||
);
|
||||
const facultyEmail = response.data.email;
|
||||
const workbook = createExcelBook(teacherData, teacher);
|
||||
const fileName = `${teacher.replace(/\s+/g, "_")}_table.xlsx`;
|
||||
const excelBlob = XLSX.write(workbook, {
|
||||
bookType: "xlsx",
|
||||
type: "array",
|
||||
});
|
||||
|
||||
const file = new File([excelBlob], fileName, {
|
||||
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
||||
});
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("teacher", teacher);
|
||||
formData.append("fileName", fileName);
|
||||
formData.append("recipientEmail", facultyEmail);
|
||||
formData.append("file", file);
|
||||
|
||||
try {
|
||||
const response = await sendEmail(formData);
|
||||
alert(`Email sent successfully to ${facultyEmail}`);
|
||||
console.log("Response from server:", response);
|
||||
} catch (error) {
|
||||
console.error("Error sending email:", error);
|
||||
alert("Failed to send email.");
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error fetching Faculty data:", error);
|
||||
alert("Failed to fetch faculty data.");
|
||||
}
|
||||
};
|
||||
|
||||
// Send emails to all teachers
|
||||
const sendEmailsToAllTeachers = async () => {
|
||||
for (let teacher of uniqueTeachers) {
|
||||
const teacherData = data.filter((row) => row.Name === teacher);
|
||||
await handleSendEmail(teacher, teacherData); // Wait for each email to be sent before proceeding to the next
|
||||
}
|
||||
alert("Emails sent to all teachers.");
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h1>Faculty Tables with Download Options</h1>
|
||||
<h1 style={{ textAlign: "center" }}>
|
||||
Faculty Tables with Download Options
|
||||
</h1>
|
||||
|
||||
{/* Bulk Download Button for Consolidated Data */}
|
||||
<div style={{ marginBottom: "20px" }}>
|
||||
<CSVLink
|
||||
data={data}
|
||||
filename="Consolidated_Faculty_Table.csv"
|
||||
<div style={{ marginBottom: "20px", textAlign: "center" }}>
|
||||
<button
|
||||
onClick={bulkDownload}
|
||||
className="btn btn-primary"
|
||||
style={{
|
||||
padding: "10px 15px",
|
||||
backgroundColor: "#17a2b8",
|
||||
color: "white",
|
||||
textDecoration: "none",
|
||||
borderRadius: "5px",
|
||||
marginRight: "10px",
|
||||
}}
|
||||
>
|
||||
Bulk Download All Tables
|
||||
</button>
|
||||
<button
|
||||
onClick={() => createExcelFile(data, "Consolidated Table")}
|
||||
className="btn btn-primary"
|
||||
style={{
|
||||
padding: "10px 15px",
|
||||
@@ -245,110 +139,178 @@ const ConsolidatedTable = () => {
|
||||
color: "white",
|
||||
textDecoration: "none",
|
||||
borderRadius: "5px",
|
||||
marginRight: "10px",
|
||||
}}
|
||||
>
|
||||
Download Consolidated CSV
|
||||
</CSVLink>
|
||||
Download Consolidated Table
|
||||
</button>
|
||||
|
||||
{/* Bulk Download Button for Individual CSV Files */}
|
||||
<button
|
||||
onClick={handleBulkDownload}
|
||||
className="btn btn-secondary"
|
||||
onClick={sendEmailsToAllTeachers}
|
||||
className="btn btn-danger"
|
||||
style={{
|
||||
padding: "10px 15px",
|
||||
backgroundColor: "#17a2b8",
|
||||
backgroundColor: "#dc3545",
|
||||
color: "white",
|
||||
textDecoration: "none",
|
||||
borderRadius: "5px",
|
||||
marginLeft: "10px",
|
||||
}}
|
||||
>
|
||||
Download All Individual CSVs
|
||||
Send Emails to All Teachers
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Scrollable Content */}
|
||||
<div
|
||||
style={{
|
||||
maxHeight: "70vh", // Set max height for the scrollable container
|
||||
overflowY: "auto", // Enable vertical scrolling
|
||||
maxHeight: "70vh",
|
||||
overflowY: "auto",
|
||||
border: "1px solid #ccc",
|
||||
padding: "10px",
|
||||
borderRadius: "5px",
|
||||
backgroundColor: "#f9f9f9",
|
||||
}}
|
||||
>
|
||||
{uniqueTeachers.map((teacher, index) => {
|
||||
// Filter rows for the current teacher
|
||||
{currentTeachers.map((teacher, index) => {
|
||||
const teacherData = data.filter((row) => row.Name === teacher);
|
||||
|
||||
return (
|
||||
<div key={index} style={{ marginBottom: "20px" }}>
|
||||
<h2>{teacher}'s Table</h2>
|
||||
<table border="1" style={{ width: "100%", textAlign: "left", marginBottom: "10px" }}>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Semester</th>
|
||||
<th>Course Code</th>
|
||||
<th>Course Name</th>
|
||||
<th>Exam Type</th>
|
||||
<th>Year</th>
|
||||
<th>Marks</th>
|
||||
<th>Name</th>
|
||||
<th>Affiliation/College</th>
|
||||
<th>Highest Qualification</th>
|
||||
<th>Career Experience</th>
|
||||
<th>Oral/Practical</th>
|
||||
<th>Assessment</th>
|
||||
<th>Reassessment</th>
|
||||
<th>Paper Setting</th>
|
||||
<th>Moderation</th>
|
||||
<th>PwD Paper Setting</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{teacherData.map((row, idx) => (
|
||||
<tr key={idx}>
|
||||
<td>{row.semester}</td>
|
||||
<td>{row.courseCode}</td>
|
||||
<td>{row.courseName}</td>
|
||||
<td>{row.examType}</td>
|
||||
<td>{row.year}</td>
|
||||
<td>{row.marks}</td>
|
||||
<td>{row.Name}</td>
|
||||
<td>{row.affiliation}</td>
|
||||
<td>{row.qualification}</td>
|
||||
<td>{row.experience}</td>
|
||||
<td>{row.oralPractical}</td>
|
||||
<td>{row.assessment}</td>
|
||||
<td>{row.reassessment}</td>
|
||||
<td>{row.paperSetting}</td>
|
||||
<td>{row.moderation}</td>
|
||||
<td>{row.pwdPaperSetting}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
{/* Individual CSV Download Button */}
|
||||
<CSVLink
|
||||
data={teacherData}
|
||||
filename={`${teacher.replace(/\s+/g, "_")}_table.csv`}
|
||||
className="btn btn-primary"
|
||||
<div
|
||||
style={{
|
||||
padding: "10px 15px",
|
||||
backgroundColor: "#007bff",
|
||||
display: "flex",
|
||||
justifyContent: "space-between",
|
||||
alignItems: "center",
|
||||
cursor: "pointer",
|
||||
backgroundColor: "#ffffff",
|
||||
color: "white",
|
||||
textDecoration: "none",
|
||||
padding: "10px",
|
||||
borderRadius: "5px",
|
||||
}}
|
||||
ref={(el) => (csvLinksRef.current[index] = el)} // Store ref for bulk download
|
||||
onClick={() => setExpandedTeacher(expandedTeacher === teacher ? null : teacher)}
|
||||
>
|
||||
Download {teacher}'s CSV
|
||||
</CSVLink>
|
||||
<h2 style={{color:'black', margin: 0 }}>{teacher}'s Table</h2>
|
||||
<div>
|
||||
<button
|
||||
onClick={() => createExcelFile(teacherData, teacher)}
|
||||
className="btn btn-primary"
|
||||
style={{
|
||||
padding: "10px 15px",
|
||||
backgroundColor: "#007bff",
|
||||
color: "black",
|
||||
textDecoration: "none",
|
||||
borderRadius: "5px",
|
||||
marginRight: "10px",
|
||||
}}
|
||||
>
|
||||
Download {teacher}'s Table
|
||||
</button>
|
||||
<button
|
||||
onClick={() => handleSendEmail(teacher, teacherData)}
|
||||
className="btn btn-secondary"
|
||||
style={{
|
||||
padding: "10px 15px",
|
||||
backgroundColor: "#6c757d",
|
||||
color: "white",
|
||||
textDecoration: "none",
|
||||
borderRadius: "5px",
|
||||
}}
|
||||
>
|
||||
Send {teacher}'s CSV via Email
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{expandedTeacher === teacher && (
|
||||
<table
|
||||
border="1"
|
||||
style={{
|
||||
width: "100%",
|
||||
textAlign: "left",
|
||||
marginTop: "20px",
|
||||
}}
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Semester</th>
|
||||
<th>Course Code</th>
|
||||
<th>Course Name</th>
|
||||
<th>Exam Type</th>
|
||||
<th>Year</th>
|
||||
<th>Marks</th>
|
||||
<th>Name</th>
|
||||
<th>Affiliation/College</th>
|
||||
<th>Highest Qualification</th>
|
||||
<th>Career Experience</th>
|
||||
<th>Oral/Practical</th>
|
||||
<th>Assessment</th>
|
||||
<th>Reassessment</th>
|
||||
<th>Paper Setting</th>
|
||||
<th>Moderation</th>
|
||||
<th>PwD Paper Setting</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{teacherData.map((row, idx) => (
|
||||
<tr key={idx}>
|
||||
<td>{row.semester}</td>
|
||||
<td>{row.courseCode}</td>
|
||||
<td>{row.courseName}</td>
|
||||
<td>{row.examType}</td>
|
||||
<td>{row.year}</td>
|
||||
<td>{row.marks}</td>
|
||||
<td>{row.Name}</td>
|
||||
<td>{row.affiliation}</td>
|
||||
<td>{row.qualification}</td>
|
||||
<td>{row.experience}</td>
|
||||
<td>{row.oralPractical}</td>
|
||||
<td>{row.assessment}</td>
|
||||
<td>{row.reassessment}</td>
|
||||
<td>{row.paperSetting}</td>
|
||||
<td>{row.moderation}</td>
|
||||
<td>{row.pwdPaperSetting}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
|
||||
{/* Pagination controls */}
|
||||
<div style={{ textAlign: "center", marginTop: "20px" }}>
|
||||
<button
|
||||
onClick={handlePrevPage}
|
||||
disabled={currentPage === 1}
|
||||
style={{
|
||||
padding: "10px 15px",
|
||||
marginRight: "10px",
|
||||
backgroundColor: currentPage === 1 ? "#ccc" : "#007bff",
|
||||
color: "white",
|
||||
borderRadius: "5px",
|
||||
border: "none",
|
||||
}}
|
||||
>
|
||||
Previous
|
||||
</button>
|
||||
<span>
|
||||
Page {currentPage} of {totalPages}
|
||||
</span>
|
||||
<button
|
||||
onClick={handleNextPage}
|
||||
disabled={currentPage === totalPages}
|
||||
style={{
|
||||
padding: "10px 15px",
|
||||
marginLeft: "10px",
|
||||
backgroundColor: currentPage === totalPages ? "#ccc" : "#007bff",
|
||||
color: "white",
|
||||
borderRadius: "5px",
|
||||
border: "none",
|
||||
}}
|
||||
>
|
||||
Next
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -9,11 +9,8 @@ const CourseForm = () => {
|
||||
const navigate = useNavigate();
|
||||
const { course } = location.state || {};
|
||||
|
||||
const [options, setOptions] = useState({
|
||||
faculties: [], // List of all faculties
|
||||
});
|
||||
|
||||
const [suggestions, setSuggestions] = useState({}); // To hold suggestions for each field
|
||||
const [options, setOptions] = useState({ faculties: [] });
|
||||
const [suggestions, setSuggestions] = useState({});
|
||||
const [formData, setFormData] = useState({
|
||||
oralsPracticals: "",
|
||||
assessment: "",
|
||||
@@ -32,46 +29,38 @@ const CourseForm = () => {
|
||||
pwdPaperSetter: [],
|
||||
});
|
||||
|
||||
const [examPeriod, setExamPeriod] = useState({
|
||||
year: "",
|
||||
startMonth: "",
|
||||
endMonth: "",
|
||||
});
|
||||
|
||||
const [errors, setErrors] = useState({});
|
||||
|
||||
// Fetch faculty list on mount
|
||||
useEffect(() => {
|
||||
const fetchOptionsAndFaculties = async () => {
|
||||
try {
|
||||
const facultiesData = await fetchFaculties(); // Fetch faculty names from backend
|
||||
const facultiesData = await fetchFaculties();
|
||||
setOptions((prev) => ({ ...prev, faculties: facultiesData }));
|
||||
} catch (error) {
|
||||
console.error("Failed to fetch faculties:", error);
|
||||
}
|
||||
};
|
||||
|
||||
fetchOptionsAndFaculties();
|
||||
}, []);
|
||||
|
||||
// Handle input changes for form fields
|
||||
const handleInputChange = (e) => {
|
||||
const { name, value } = e.target;
|
||||
|
||||
setFormData({ ...formData, [name]: value });
|
||||
|
||||
if (value.trim() === "") {
|
||||
// Clear suggestions if input is empty
|
||||
setSuggestions((prev) => ({
|
||||
...prev,
|
||||
[name]: [],
|
||||
}));
|
||||
setSuggestions((prev) => ({ ...prev, [name]: [] }));
|
||||
return;
|
||||
}
|
||||
|
||||
// Filter suggestions for the current field
|
||||
if (options.faculties.length > 0) {
|
||||
const filteredSuggestions = options.faculties.filter((faculty) =>
|
||||
faculty.name.toLowerCase().includes(value.toLowerCase())
|
||||
);
|
||||
setSuggestions((prev) => ({
|
||||
...prev,
|
||||
[name]: filteredSuggestions,
|
||||
}));
|
||||
setSuggestions((prev) => ({ ...prev, [name]: filteredSuggestions }));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -79,96 +68,75 @@ const CourseForm = () => {
|
||||
const selectedFaculty = options.faculties.find(
|
||||
(faculty) => faculty.name === formData[field]
|
||||
);
|
||||
|
||||
if (selectedFaculty) {
|
||||
setTempAssignments((prev) => ({
|
||||
...prev,
|
||||
[field]: [...prev[field], selectedFaculty],
|
||||
}));
|
||||
setFormData({ ...formData, [field]: "" }); // Clear input field
|
||||
setSuggestions((prev) => ({ ...prev, [field]: [] })); // Clear suggestions
|
||||
setFormData({ ...formData, [field]: "" });
|
||||
setSuggestions((prev) => ({ ...prev, [field]: [] }));
|
||||
}
|
||||
};
|
||||
|
||||
const handleRemoveFaculty = (field, index) => {
|
||||
setTempAssignments((prev) => {
|
||||
const updatedAssignments = [...prev[field]]; // Create a shallow copy of the current list for this field
|
||||
updatedAssignments.splice(index, 1); // Remove the faculty at the specified index
|
||||
return { ...prev, [field]: updatedAssignments }; // Update the tempAssignments state
|
||||
const updatedAssignments = [...prev[field]];
|
||||
updatedAssignments.splice(index, 1);
|
||||
return { ...prev, [field]: updatedAssignments };
|
||||
});
|
||||
};
|
||||
|
||||
const validateForm = () => {
|
||||
const newErrors = {};
|
||||
|
||||
// Validate that each field in tempAssignments has at least one assigned faculty
|
||||
Object.keys(tempAssignments).forEach((field) => {
|
||||
if (!tempAssignments[field] || tempAssignments[field].length === 0) {
|
||||
newErrors[field] = "At least one faculty must be assigned.";
|
||||
}
|
||||
});
|
||||
|
||||
if (!examPeriod.year || !examPeriod.startMonth || !examPeriod.endMonth) {
|
||||
newErrors.examPeriod = "Exam period is required.";
|
||||
}
|
||||
|
||||
setErrors(newErrors);
|
||||
return Object.keys(newErrors).length === 0; // Form is valid if no errors
|
||||
return Object.keys(newErrors).length === 0;
|
||||
};
|
||||
|
||||
// Handle form submission
|
||||
const handleSubmit = async (e) => {
|
||||
e.preventDefault(); // Prevent default form submission behavior
|
||||
e.preventDefault();
|
||||
|
||||
// Validate the form based on tempAssignments
|
||||
if (validateForm()) {
|
||||
try {
|
||||
const groupedTasks = {};
|
||||
|
||||
// Transform tempAssignments into grouped tasks by facultyId
|
||||
Object.entries(tempAssignments).forEach(([field, facultyList]) => {
|
||||
facultyList.forEach((faculty) => {
|
||||
// Assuming faculty is an object, not just the faculty name
|
||||
const assignedFaculty = options.faculties.find(
|
||||
(optionFaculty) => optionFaculty.facultyId === faculty.facultyId
|
||||
);
|
||||
|
||||
if (assignedFaculty) {
|
||||
// Check if the facultyId already exists in groupedTasks
|
||||
if (!groupedTasks[assignedFaculty.facultyId]) {
|
||||
groupedTasks[assignedFaculty.facultyId] = {
|
||||
facultyId: assignedFaculty.facultyId,
|
||||
courseId: course?.courseId || id,
|
||||
tasks: [],
|
||||
examPeriod: `${examPeriod.year} (${examPeriod.startMonth} - ${examPeriod.endMonth})`,
|
||||
};
|
||||
}
|
||||
// Push the task (field) into the tasks array for that faculty
|
||||
groupedTasks[assignedFaculty.facultyId].tasks.push(field);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
console.log(groupedTasks);
|
||||
const payload = Object.values(groupedTasks); // Convert grouped tasks into an array
|
||||
console.log("Saving appointment with payload:", payload);
|
||||
|
||||
if (payload.length === 0) {
|
||||
throw new Error("No assignments to submit.");
|
||||
}
|
||||
|
||||
// Call API to save appointments
|
||||
const payload = Object.values(groupedTasks);
|
||||
await saveAppointment(payload);
|
||||
await updateCourseStatus(course?.courseId || id);
|
||||
|
||||
console.log("Form submitted successfully:", payload);
|
||||
|
||||
const filteredCourses =
|
||||
JSON.parse(localStorage.getItem("filteredCourses")) || [];
|
||||
|
||||
// Redirect to courses page after successful submission
|
||||
navigate("/courses", {
|
||||
state: {
|
||||
courses: filteredCourses,
|
||||
updatedCourse: {
|
||||
...course,
|
||||
status: "Submitted",
|
||||
},
|
||||
updatedCourse: { ...course, status: "Submitted" },
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
@@ -227,7 +195,7 @@ const CourseForm = () => {
|
||||
key={faculty.facultyId}
|
||||
onClick={() => {
|
||||
setFormData({ ...formData, [name]: faculty.name });
|
||||
setSuggestions((prev) => ({ ...prev, [name]: [] })); // Clear suggestions for this field
|
||||
setSuggestions((prev) => ({ ...prev, [name]: [] }));
|
||||
}}
|
||||
>
|
||||
{faculty.name}
|
||||
@@ -245,7 +213,7 @@ const CourseForm = () => {
|
||||
onClick={() => handleRemoveFaculty(name, index)}
|
||||
className="remove-faculty-btn"
|
||||
>
|
||||
✕ {/* This is the "X" symbol */}
|
||||
✕
|
||||
</button>
|
||||
</li>
|
||||
))}
|
||||
@@ -256,6 +224,75 @@ const CourseForm = () => {
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
<div className={errors.examPeriod ? "error" : ""}>
|
||||
<label>Exam Period:</label>
|
||||
<select
|
||||
value={examPeriod.year}
|
||||
onChange={(e) => setExamPeriod({ ...examPeriod, year: e.target.value })}
|
||||
>
|
||||
<option value="">Year</option>
|
||||
{[2025, 2026, 2027].map((year) => (
|
||||
<option key={year} value={year}>
|
||||
{year}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
<select
|
||||
value={examPeriod.startMonth}
|
||||
onChange={(e) =>
|
||||
setExamPeriod({ ...examPeriod, startMonth: e.target.value })
|
||||
}
|
||||
>
|
||||
<option value="">Start Month</option>
|
||||
{[
|
||||
"January",
|
||||
"February",
|
||||
"March",
|
||||
"April",
|
||||
"May",
|
||||
"June",
|
||||
"July",
|
||||
"August",
|
||||
"September",
|
||||
"October",
|
||||
"November",
|
||||
"December",
|
||||
].map((month) => (
|
||||
<option key={month} value={month}>
|
||||
{month}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
<select
|
||||
value={examPeriod.endMonth}
|
||||
onChange={(e) =>
|
||||
setExamPeriod({ ...examPeriod, endMonth: e.target.value })
|
||||
}
|
||||
>
|
||||
<option value="">End Month</option>
|
||||
{[
|
||||
"January",
|
||||
"February",
|
||||
"March",
|
||||
"April",
|
||||
"May",
|
||||
"June",
|
||||
"July",
|
||||
"August",
|
||||
"September",
|
||||
"October",
|
||||
"November",
|
||||
"December",
|
||||
].map((month) => (
|
||||
<option key={month} value={month}>
|
||||
{month}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
{errors.examPeriod && (
|
||||
<span className="error-message">{errors.examPeriod}</span>
|
||||
)}
|
||||
</div>
|
||||
<button type="submit">Submit</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -26,23 +26,6 @@ const CourseTable = () => {
|
||||
fetchAllCourses();
|
||||
}, [state?.courses]);
|
||||
|
||||
// useEffect(() => {
|
||||
// if (state?.updatedCourse) {
|
||||
// setCourses((prevCourses) => {
|
||||
// // Filter only the updated course
|
||||
// const filteredCourses = prevCourses.filter((course) =>
|
||||
// course.courseId === state.updatedCourse.courseId
|
||||
// );
|
||||
|
||||
// return filteredCourses.map((course) =>
|
||||
// course.courseId === state.updatedCourse.courseId
|
||||
// ? { ...course, status: "Submitted" } // Update status
|
||||
// : course
|
||||
// );
|
||||
// });
|
||||
// }
|
||||
// }, [state?.updatedCourse]);
|
||||
|
||||
useEffect(() => {
|
||||
if (state?.updatedCourse) {
|
||||
setCourses((prevCourses) =>
|
||||
|
||||
@@ -23,26 +23,6 @@ const FilterPage = () => {
|
||||
}
|
||||
};
|
||||
|
||||
// const handleApplyFilter = async () => {
|
||||
// if (!formData.scheme || !formData.semester || !formData.department || !formData.program) {
|
||||
// alert("Please fill all the fields before applying the filter.");
|
||||
// return;
|
||||
// }
|
||||
|
||||
// try {
|
||||
// const filteredCourses = await fetchCourses(formData);
|
||||
// console.log(formData);
|
||||
// if (filteredCourses.length > 0) {
|
||||
// navigate("/courses", { state: { courses: filteredCourses } });
|
||||
// } else {
|
||||
// alert("No courses found for the selected filters.");
|
||||
// }
|
||||
// } catch (error) {
|
||||
// console.error("Error fetching courses:", error);
|
||||
// alert("Failed to fetch courses. Please try again later.");
|
||||
// }
|
||||
// };
|
||||
|
||||
const handleApplyFilter = async () => {
|
||||
if (!formData.scheme || !formData.semester || !formData.department || !formData.program) {
|
||||
alert("Please fill all the fields before applying the filter.");
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
const BASE_URL = "http://localhost:8080/api";
|
||||
const XLSX = require("xlsx-js-style");
|
||||
|
||||
// Helper function for handling fetch requests
|
||||
const fetchData = async (url, options) => {
|
||||
@@ -77,6 +78,7 @@ export const fetchOptions = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Save multiple appointments to MongoDB
|
||||
export const saveAppointment = async (appointmentsData) => {
|
||||
console.log("Saving appointments with payload:", appointmentsData);
|
||||
@@ -137,3 +139,172 @@ export const updateCourseStatus = async (courseId) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const sendEmail = async (formData) => {
|
||||
try {
|
||||
const url = `${BASE_URL}/send-email`;
|
||||
const response = await fetch(url, {
|
||||
method: "POST",
|
||||
body: formData, // Directly pass FormData
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
let errorDetails = {};
|
||||
try {
|
||||
errorDetails = await response.json();
|
||||
} catch (err) {
|
||||
console.warn("Failed to parse error details:", err);
|
||||
}
|
||||
throw new Error(
|
||||
`Error: ${response.statusText} (${response.status}) - ${
|
||||
errorDetails.message || "No details available"
|
||||
}`
|
||||
);
|
||||
}
|
||||
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
console.error( error.message);
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
export const createExcelBook = (teacherData, teacher) => {
|
||||
const workbook = XLSX.utils.book_new();
|
||||
|
||||
// Define header information
|
||||
const headerInfo = [
|
||||
["Somaiya Vidyavihar University"],
|
||||
["K. J. SOMAIYA COLLEGE OF ENGINEERING"],
|
||||
[
|
||||
"Appointment of Internal Examiners for Paper Setting / OR/PR/Assessment/Reassessment",
|
||||
],
|
||||
["Class: B Tech/M Tech/Honour/Minor"],
|
||||
["Department - Computer Engineering"],
|
||||
[],
|
||||
];
|
||||
|
||||
const tableHeaders = [
|
||||
[
|
||||
"Sr No",
|
||||
"Semester",
|
||||
"Course Code",
|
||||
"Course Name",
|
||||
"Exam Type",
|
||||
"Year",
|
||||
"Marks",
|
||||
"Name",
|
||||
"Affiliation/College",
|
||||
"Highest Qualification",
|
||||
"Career Experience",
|
||||
"Oral/Practical",
|
||||
"Assessment",
|
||||
"Reassessment",
|
||||
"Paper Setting",
|
||||
"Moderation",
|
||||
"PwD Paper Setting",
|
||||
],
|
||||
];
|
||||
|
||||
const dataRows = teacherData.map((row, index) => [
|
||||
index + 1,
|
||||
row.semester,
|
||||
row.courseCode,
|
||||
row.courseName,
|
||||
row.examType,
|
||||
row.year,
|
||||
row.marks,
|
||||
row.Name,
|
||||
row.affiliation,
|
||||
row.qualification,
|
||||
row.experience,
|
||||
row.oralPractical,
|
||||
row.assessment,
|
||||
row.reassessment,
|
||||
row.paperSetting,
|
||||
row.moderation,
|
||||
row.pwdPaperSetting,
|
||||
]);
|
||||
|
||||
const sheetData = [...headerInfo, ...tableHeaders, ...dataRows];
|
||||
const worksheet = XLSX.utils.aoa_to_sheet(sheetData);
|
||||
|
||||
// Add merged cells
|
||||
worksheet["!merges"] = [
|
||||
{ s: { r: 0, c: 0 }, e: { r: 0, c: 18 } },
|
||||
{ s: { r: 1, c: 0 }, e: { r: 1, c: 18 } },
|
||||
{ s: { r: 2, c: 0 }, e: { r: 2, c: 18 } },
|
||||
{ s: { r: 3, c: 0 }, e: { r: 3, c: 18 } },
|
||||
{ s: { r: 4, c: 0 }, e: { r: 4, c: 18 } },
|
||||
];
|
||||
|
||||
// Define styles
|
||||
const boldStyle = {
|
||||
font: { bold: true, name: "Times New Roman", sz: 14 },
|
||||
alignment: { horizontal: "center", vertical: "center" },
|
||||
};
|
||||
|
||||
const redStyle = {
|
||||
font: {
|
||||
bold: true,
|
||||
color: { rgb: "FF0000" },
|
||||
name: "Times New Roman",
|
||||
sz: 14,
|
||||
},
|
||||
alignment: { horizontal: "center", vertical: "center" },
|
||||
};
|
||||
|
||||
const normalStyle = {
|
||||
font: { name: "Times New Roman", sz: 12 },
|
||||
};
|
||||
|
||||
// Apply styles to headers
|
||||
const headerRanges = [
|
||||
{ row: 0, style: boldStyle },
|
||||
{ row: 1, style: boldStyle },
|
||||
{ row: 2, style: boldStyle },
|
||||
{ row: 3, style: boldStyle },
|
||||
{ row: 4, style: redStyle },
|
||||
];
|
||||
|
||||
headerRanges.forEach(({ row, style }) => {
|
||||
for (let col = 0; col <= 18; col++) {
|
||||
const cellAddress = XLSX.utils.encode_cell({ r: row, c: col });
|
||||
if (!worksheet[cellAddress]) continue; // Skip empty cells
|
||||
worksheet[cellAddress].s = style;
|
||||
}
|
||||
});
|
||||
|
||||
// Set column widths for better readability
|
||||
worksheet["!cols"] = [
|
||||
{ wch: 10 }, // Sr No
|
||||
{ wch: 12 }, // Semester
|
||||
{ wch: 15 }, // Course Code
|
||||
{ wch: 25 }, // Course Name
|
||||
{ wch: 15 }, // Exam Type
|
||||
{ wch: 10 }, // Year
|
||||
{ wch: 10 }, // Marks
|
||||
{ wch: 15 }, // Surname
|
||||
{ wch: 15 }, // First Name
|
||||
{ wch: 15 }, // Middle Name
|
||||
{ wch: 20 }, // Affiliation
|
||||
{ wch: 20 }, // Qualification
|
||||
{ wch: 15 }, // Career Experience
|
||||
{ wch: 15 }, // Oral/Practical
|
||||
{ wch: 15 }, // Assessment
|
||||
{ wch: 15 }, // Reassessment
|
||||
{ wch: 15 }, // Paper Setting
|
||||
{ wch: 15 }, // Moderation
|
||||
{ wch: 15 }, // PwD Paper Setting
|
||||
];
|
||||
|
||||
// Apply normal font style to all cells
|
||||
Object.keys(worksheet).forEach((key) => {
|
||||
if (worksheet[key] && key[0] !== "!") {
|
||||
worksheet[key].s = worksheet[key].s || normalStyle;
|
||||
}
|
||||
});
|
||||
|
||||
// Add worksheet to workbook and save file
|
||||
XLSX.utils.book_append_sheet(workbook, worksheet, teacher);
|
||||
return workbook;
|
||||
}
|
||||
Reference in New Issue
Block a user