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

fix ticket issue with owners #47

Merged
merged 26 commits into from
May 6, 2023
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f2d40e8
Update login page button ARIA landmark
MAPReiff May 6, 2023
7eeec61
Update register page button ARIA landmark
MAPReiff May 6, 2023
8bb5720
Remove labels from removed rich text buttons as they caused issues no…
MAPReiff May 6, 2023
81e6f59
Update login page button ARIA landmark
MAPReiff May 6, 2023
e143bcf
Update register page button ARIA landmark
MAPReiff May 6, 2023
883c156
Remove labels from removed rich text buttons as they caused issues no…
MAPReiff May 6, 2023
0ef62b5
Merge branch 'tota11yFixes' of github.com:MAPReiff/cs546-group-44 int…
MAPReiff May 6, 2023
600e999
Rich text images now have a default alt text
MAPReiff May 6, 2023
8c77775
fixed invalid tag value
MAPReiff May 6, 2023
3467634
Fixed nave bar search
MAPReiff May 6, 2023
5cac8e6
fix ticket issue with owners
dbajollari1 May 6, 2023
6564ba3
Correct invalid HTML in make tickets
MAPReiff May 6, 2023
9695b88
Fix image alt text issue due to by previous change
MAPReiff May 6, 2023
c709875
Fix client side error checking for make ticket
MAPReiff May 6, 2023
970df1b
Further fixes to ticket js
MAPReiff May 6, 2023
f694b3e
Edit ticket now uses error checking
MAPReiff May 6, 2023
33bbf29
Update ticket route to pass users into makeTicket if an error is caug…
MAPReiff May 6, 2023
58a757f
Fix HTML validation on viewing tickets
MAPReiff May 6, 2023
5056233
Update edit ticket to match the same required values as make ticket
MAPReiff May 6, 2023
053a404
Fixed HTML validation on editTicket
MAPReiff May 6, 2023
623869d
Merge pull request #46 from MAPReiff/tota11yFixes
dbajollari1 May 6, 2023
fe3d034
Merge pull request #48 from MAPReiff/generalFixes
dbajollari1 May 6, 2023
2a92a17
fix ticket issue with no owners
dbajollari1 May 6, 2023
da6f663
fix ticket issue with owners
dbajollari1 May 6, 2023
29777c4
fix ticket issue with no owners
dbajollari1 May 6, 2023
1cbcf34
Merge branch 'fix-ticket' of github.com:MAPReiff/cs546-group-44 into …
MAPReiff May 6, 2023
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
Prev Previous commit
Next Next commit
Further fixes to ticket js
The check for deadline was completed busted as well.

Regex wasnt checking the right form of date

I dont even know how the day/month.year substrings were being extracted but it clearly did not do anything so had to be fixed

tried to compare with the created on data which is not even passed in..

Scroll to top of page when error so they can see it
  • Loading branch information
MAPReiff committed May 6, 2023
commit 970df1bc2ce938e2ff9dffbade8ba03ed8f8d324
28 changes: 18 additions & 10 deletions public/js/makeTicket.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ document.addEventListener("DOMContentLoaded", function () {
} catch (e) {
errorP.innerHTML = `${e}`;
errorP.hidden = false;
// scroll to top of page so they can see the error
window.scrollTo(0, 0);
}
});
}
Expand Down Expand Up @@ -119,18 +121,24 @@ function checkTicketDeadline(data) {
return NaN;
}

var t = data.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);
let t = data.match(/^\d{4}-\d{2}-\d{2}$/);
if (t !== null) {
var d = +t[1],
m = +t[2],
y = +t[3];
var date = new Date(y, m - 1, d);
if (date.getFullYear() === y && date.getMonth() === m - 1) {
if (new Date(deadline).getTime() === NaN) {
// var d = +t[1],
// m = +t[2],
// y = +t[3];
let date = new Date(data);
let y = data.substring(0, 4);
let m = data.substring(5, 7);
let d = data.substring(8, 10);


if (date.getFullYear() == y && date.getMonth() == m - 1) {
if (new Date(data).getTime() === NaN) {
throw new Error("provided dealine is not a valid timestamp");
} else if (new Date(deadline).getTime() < createdOn) {
throw new Error("provided dealine in the past");
}
}
// else if (new Date(data).getTime() < createdOn) {
// throw new Error("provided dealine in the past");
// }
return data;
} else {
throw Error("ticket deadline must be in the format YYYY-DD-MM");
Expand Down