merge master brance
This commit is contained in:
commit
4d1abaf9aa
|
|
@ -567,7 +567,7 @@ async function validateStep(step) {
|
||||||
// Validate other required fields
|
// Validate other required fields
|
||||||
const requiredFields = form.querySelectorAll('[required]');
|
const requiredFields = form.querySelectorAll('[required]');
|
||||||
requiredFields.forEach(field => {
|
requiredFields.forEach(field => {
|
||||||
if (!field.value.trim()) {
|
if (field.id !== 'email' && !field.value.trim()) {
|
||||||
isValid = false;
|
isValid = false;
|
||||||
field.classList.add('field-error');
|
field.classList.add('field-error');
|
||||||
} else if (field.id !== 'email') {
|
} else if (field.id !== 'email') {
|
||||||
|
|
@ -902,7 +902,7 @@ async function detectLocation() {
|
||||||
await populateStates(countryCode, 'state');
|
await populateStates(countryCode, 'state');
|
||||||
await populateStates(countryCode, 'billing-state');
|
await populateStates(countryCode, 'billing-state');
|
||||||
|
|
||||||
// // auto populate state if region matches
|
// auto populate state if region matches
|
||||||
// const stateSelect = document.getElementById('state');
|
// const stateSelect = document.getElementById('state');
|
||||||
// const billingStateSelect = document.getElementById('billing-state');
|
// const billingStateSelect = document.getElementById('billing-state');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import mongoose from "mongoose";
|
||||||
import { LoggedModel, WorkTrackModel, ProjectModel, VAModel } from "../../../models/vaModel.js";
|
import { LoggedModel, WorkTrackModel, ProjectModel, VAModel } from "../../../models/vaModel.js";
|
||||||
import authFetch from "../../../utils/authFetch.js";
|
import authFetch from "../../../utils/authFetch.js";
|
||||||
import getDayNumber from "../../../utils/getDayNumber.js";
|
import getDayNumber from "../../../utils/getDayNumber.js";
|
||||||
|
|
@ -296,7 +297,7 @@ async function va_project_log_callback(req, res) {
|
||||||
const { logId } = payload;
|
const { logId } = payload;
|
||||||
|
|
||||||
const workTrackData = await WorkTrackModel.find({
|
const workTrackData = await WorkTrackModel.find({
|
||||||
logId: logId
|
logId: new mongoose.Types.ObjectId(logId)
|
||||||
});
|
});
|
||||||
|
|
||||||
// console.log(`Found work track data for logout:`, workTrackData);
|
// console.log(`Found work track data for logout:`, workTrackData);
|
||||||
|
|
|
||||||
|
|
@ -595,6 +595,24 @@ app.post("/post-test", (req, res) => {
|
||||||
return res.status(200).json({ "success": true, "message": "POST request received", "data": req.body })
|
return res.status(200).json({ "success": true, "message": "POST request received", "data": req.body })
|
||||||
});
|
});
|
||||||
|
|
||||||
|
app.get("/tnyk/:sf_token", (req, res) => {
|
||||||
|
const sf_token = req.params.sf_token;
|
||||||
|
console.log("Received token:", sf_token);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const decoded = jwt.verify(sf_token, process.env.JWT_SECRET_SF_TOKEN);
|
||||||
|
if (decoded) {
|
||||||
|
res.render('client/dashboard-dashboard', { sf_token: sf_token });
|
||||||
|
} else {
|
||||||
|
res.render('not_found', { title: "Client" });
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
res.render('not_found', { title: "Client" });
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
app.use((req, res) => {
|
app.use((req, res) => {
|
||||||
res.status(404).render("not_found", {
|
res.status(404).render("not_found", {
|
||||||
layout: "layouts/error",
|
layout: "layouts/error",
|
||||||
|
|
|
||||||
|
|
@ -171,12 +171,20 @@
|
||||||
|
|
||||||
// -------- Download --------
|
// -------- Download --------
|
||||||
downloadBtn.addEventListener("click", () => {
|
downloadBtn.addEventListener("click", () => {
|
||||||
|
const activeBtn = document.querySelector(".os-btn.active")
|
||||||
|
const os = activeBtn.dataset.os;
|
||||||
|
|
||||||
const link = document.createElement("a");
|
const link = document.createElement("a");
|
||||||
|
|
||||||
|
if(os === "mac") {
|
||||||
|
link.href = `/public/builds/build-1.1.1.1/mac/VA Tracker-1.1.1-universal.dmg`;
|
||||||
|
link.setAttribute("download", "");
|
||||||
|
} else if (os === "windows") {
|
||||||
link.href = `/public/builds/build-1.1.1.1/windows/VA Tracker-Setup-1.1.1.exe`;
|
link.href = `/public/builds/build-1.1.1.1/windows/VA Tracker-Setup-1.1.1.exe`;
|
||||||
link.setAttribute("download", "");
|
link.setAttribute("download", "");
|
||||||
link.click()
|
}
|
||||||
|
|
||||||
|
link.click()
|
||||||
// window.location.href = ``;
|
// window.location.href = ``;
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue