@@ -18,7 +18,7 @@ export function DateTimeFormatter(props) {
|
||||
: null;
|
||||
}
|
||||
export function DateTimeFormatterFunction(date) {
|
||||
return moment(date).format("MM/DD/YYYY hh:mm a");
|
||||
return dayjs(date).format("MM/DD/YYYY hh:mm a");
|
||||
}
|
||||
export function TimeFormatter(props) {
|
||||
return props.children
|
||||
|
||||
@@ -12,6 +12,8 @@ import apolloLogger from "apollo-link-logger";
|
||||
//import axios from "axios";
|
||||
import { auth } from "../firebase/firebase.utils";
|
||||
import errorLink from "../graphql/apollo-error-handling";
|
||||
import { SentryLink } from "apollo-link-sentry";
|
||||
|
||||
//import { store } from "../redux/store";
|
||||
const httpLink = new HttpLink({
|
||||
uri: process.env.REACT_APP_GRAPHQL_ENDPOINT,
|
||||
@@ -105,18 +107,30 @@ const link = split(
|
||||
const authLink = setContext((_, { headers }) => {
|
||||
return (
|
||||
auth.currentUser &&
|
||||
auth.currentUser.getIdToken().then((token) => {
|
||||
if (token) {
|
||||
return {
|
||||
headers: {
|
||||
...headers,
|
||||
authorization: token ? `Bearer ${token}` : "",
|
||||
},
|
||||
};
|
||||
} else {
|
||||
auth.currentUser
|
||||
.getIdToken()
|
||||
.then((token) => {
|
||||
if (token) {
|
||||
return {
|
||||
headers: {
|
||||
...headers,
|
||||
authorization: token ? `Bearer ${token}` : "",
|
||||
},
|
||||
};
|
||||
} else {
|
||||
console.error(
|
||||
"Authentication error. Unable to add authorization token because it was empty."
|
||||
);
|
||||
return { headers };
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error(
|
||||
"Authentication error. Unable to add authorization token.",
|
||||
error.message
|
||||
);
|
||||
return { headers };
|
||||
}
|
||||
})
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
@@ -138,8 +152,10 @@ if (process.env.NODE_ENV === "development") {
|
||||
}
|
||||
|
||||
middlewares.push(
|
||||
roundTripLink.concat(
|
||||
retryLink.concat(errorLink.concat(authLink.concat(link)))
|
||||
new SentryLink().concat(
|
||||
roundTripLink.concat(
|
||||
retryLink.concat(errorLink.concat(authLink.concat(link)))
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@@ -32,11 +32,6 @@ import objectSupport from 'dayjs/plugin/objectSupport';
|
||||
import toArray from 'dayjs/plugin/toArray';
|
||||
import toObject from 'dayjs/plugin/toObject';
|
||||
|
||||
// import badMutable from 'dayjs/plugin/badMutable';
|
||||
// import preParsePostFormat from 'dayjs/plugin/preParsePostFormat';
|
||||
|
||||
|
||||
// dayjs.extend(badMutable); // TODO: Client Update - This is not advised, scoreboard page
|
||||
dayjs.extend(toObject);
|
||||
dayjs.extend(toArray);
|
||||
dayjs.extend(objectSupport);
|
||||
@@ -46,7 +41,6 @@ dayjs.extend(isToday);
|
||||
dayjs.extend(localeData);
|
||||
dayjs.extend(quarterOfYear);
|
||||
dayjs.extend(localizedFormat);
|
||||
// dayjs.extend(preParsePostFormat); // TODO: This should not be needed
|
||||
dayjs.extend(isLeapYear);
|
||||
dayjs.extend(isoWeeksInYear);
|
||||
dayjs.extend(isoWeek);
|
||||
|
||||
16
client/src/utils/eulaize.js
Normal file
16
client/src/utils/eulaize.js
Normal file
@@ -0,0 +1,16 @@
|
||||
const fs = require('fs');
|
||||
|
||||
|
||||
const filename = process.argv[2];
|
||||
|
||||
fs.readFile(filename, 'utf8', (err, data) => {
|
||||
if (err) {
|
||||
console.error(`Error reading file ${filename}:`, err);
|
||||
return;
|
||||
}
|
||||
const filteredData = JSON.stringify(data);
|
||||
console.log('Select the content between the quotes below and paste it into the EULA Content field in the EULA Content table in the database.')
|
||||
console.log('--------------------------------------------------')
|
||||
console.log(filteredData);
|
||||
console.log('--------------------------------------------------')
|
||||
});
|
||||
Reference in New Issue
Block a user