From c0b8fc783c4dc6f2aef1b58cbb8025b504ef0a27 Mon Sep 17 00:00:00 2001 From: Aar-if Date: Tue, 12 Dec 2023 16:55:16 +0530 Subject: [PATCH 1/2] removed reminder --- packages/core/src/pages/StudentLogin.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/core/src/pages/StudentLogin.js b/packages/core/src/pages/StudentLogin.js index d32b8463..7963ab96 100644 --- a/packages/core/src/pages/StudentLogin.js +++ b/packages/core/src/pages/StudentLogin.js @@ -196,7 +196,7 @@ export default function StudentLogin({ swPath }) { let refreshToken = result.data.refresh_token; console.log(refreshToken); sessionStorage.setItem("refreshToken", refreshToken); - sessionStorage.setItem('token', token); + sessionStorage.setItem("token", token); let resultTeacher = {}; // try { @@ -266,16 +266,16 @@ export default function StudentLogin({ swPath }) {
-

+

Accelerated Learning via Technology (ALT)

-

+ {/*

Reminder : Dear Students, Thank you for participating in the ALT Version 1 pilot. We officially closed the pilot on 19th November, 2023. -

+ */}
From e006095e7cf3095db2fa819be8235f725f37a669 Mon Sep 17 00:00:00 2001 From: Aar-if Date: Wed, 13 Dec 2023 11:27:44 +0530 Subject: [PATCH 2/2] Scroll bar --- .../admin/src/components/StudentListView.jsx | 212 +++++++++--------- 1 file changed, 107 insertions(+), 105 deletions(-) diff --git a/packages/admin/src/components/StudentListView.jsx b/packages/admin/src/components/StudentListView.jsx index 7d6cc827..114ee8c6 100644 --- a/packages/admin/src/components/StudentListView.jsx +++ b/packages/admin/src/components/StudentListView.jsx @@ -25,7 +25,6 @@ function StudentListView() { const [rowData, setRowData] = useState([]); const [currentPage, setCurrentPage] = useState(2); - const openPrompt = async (data) => { let person = window.prompt( `Enter a new password for user ${data.username}` @@ -145,8 +144,6 @@ function StudentListView() { { field: "noOfSiblings" }, ]); - - //Download username and pass with prompt // const onBtnExportFields = useCallback(() => { @@ -192,50 +189,43 @@ function StudentListView() { console.log("cellClicked", event); }, []); - const onBtnExportFields = async() => { - - let person = window.prompt( - `Enter a School Udise` - ); + const onBtnExportFields = async () => { + let person = window.prompt(`Enter a School Udise`); if (person == null || person == "") { alert("Please enter a valid password"); } else { - console.log(person) - - + console.log(person); + const result = await studentUsernamePasswordAPI(person); if (result) { - const filteredData = result.data.data; console.log(filteredData); - const selectedFieldsData = filteredData.map((row) => ({ - Name: row.name, - UserName: row.username, - Password: row.password, - })); - - // Convert the data to CSV format using PapaParse - const csvData = Papa.unparse(selectedFieldsData); - - // Create a Blob containing the CSV data - const blob = new Blob([csvData], { type: "text/csv;charset=utf-8;" }); - - // Create a download link and trigger the download - const link = document.createElement("a"); - link.href = URL.createObjectURL(blob); - link.download = "student_data_filtered_user_password.csv"; - link.style.display = "none"; - document.body.appendChild(link); - link.click(); - document.body.removeChild(link); - } + const selectedFieldsData = filteredData.map((row) => ({ + Name: row.name, + UserName: row.username, + Password: row.password, + })); + + // Convert the data to CSV format using PapaParse + const csvData = Papa.unparse(selectedFieldsData); + + // Create a Blob containing the CSV data + const blob = new Blob([csvData], { type: "text/csv;charset=utf-8;" }); + + // Create a download link and trigger the download + const link = document.createElement("a"); + link.href = URL.createObjectURL(blob); + link.download = "student_data_filtered_user_password.csv"; + link.style.display = "none"; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); } + } }; - - - useEffect(() => { + useEffect(() => { const token = sessionStorage.getItem("token"); setToken(token); }, []); @@ -256,7 +246,9 @@ function StudentListView() { filters: {}, }; - const response = await axios.post(studentSearch, requestData, { headers }); + const response = await axios.post(studentSearch, requestData, { + headers, + }); setRowData(response.data.data); } catch (error) { console.error("Error fetching data:", error); @@ -266,73 +258,71 @@ function StudentListView() { fetchData(); }, [token]); - const handlePaginationChanged = () => { // Increment the current page when the "Next Page" button is clicked - console.log('clicked'); - - const fetchData = async () => { - try { - const headers = { - Accept: "*/*", - Authorization: `Bearer ${token}`, - "Content-Type": "application/json", - }; - - const requestData = { - limit: "5", - page: currentPage, - filters: {}, - }; - - const response = await axios.post(studentSearch, requestData, { headers }); - setRowData(response.data.data); - setCurrentPage(currentPage + 1); - } catch (error) { - console.error("Error fetching data:", error); - } - }; + console.log("clicked"); - fetchData(); - - }; + const fetchData = async () => { + try { + const headers = { + Accept: "*/*", + Authorization: `Bearer ${token}`, + "Content-Type": "application/json", + }; + const requestData = { + limit: "5", + page: currentPage, + filters: {}, + }; + + const response = await axios.post(studentSearch, requestData, { + headers, + }); + setRowData(response.data.data); + setCurrentPage(currentPage + 1); + } catch (error) { + console.error("Error fetching data:", error); + } + }; + + fetchData(); + }; const handlePaginationChanged2 = () => { // Increment the current page when the "Next Page" button is clicked - console.log('clicked'); - - const fetchData = async () => { - try { - const headers = { - Accept: "*/*", - Authorization: `Bearer ${token}`, - "Content-Type": "application/json", - }; - - const requestData = { - limit: "5", - page: currentPage, - filters: {}, - }; - - const response = await axios.post(studentSearch, requestData, { headers }); - setRowData(response.data.data); - setCurrentPage(currentPage - 1); - } catch (error) { - console.error("Error fetching data:", error); - } - }; + console.log("clicked"); - fetchData(); - + const fetchData = async () => { + try { + const headers = { + Accept: "*/*", + Authorization: `Bearer ${token}`, + "Content-Type": "application/json", + }; + + const requestData = { + limit: "5", + page: currentPage, + filters: {}, + }; + + const response = await axios.post(studentSearch, requestData, { + headers, + }); + setRowData(response.data.data); + setCurrentPage(currentPage - 1); + } catch (error) { + console.error("Error fetching data:", error); + } + }; + + fetchData(); }; - return (
-
- +
-
-
- - -
- +
+ + +
Loading Student records....'} - + pagination={true} + paginationAutoPageSize={true} + overlayNoRowsTemplate={"Loading Student records...."} >{" "} - -
); } -export default StudentListView; \ No newline at end of file +export default StudentListView;