diff --git a/bdit-flashcrow.code-workspace b/bdit-flashcrow.code-workspace index c759a085d..eb22aba6d 100644 --- a/bdit-flashcrow.code-workspace +++ b/bdit-flashcrow.code-workspace @@ -3,10 +3,10 @@ "recommendations": [ "cpylua.language-postcss", "dbaeumer.vscode-eslint", - "jcbuisson.vue", "ms-python.python", - "ms-vscode-remote.vscode-remote-extensionpack", - "thibaudcolas.stylelint" + "ms-vscode-remote.vscode-remote-extensionpack", + "octref.vetur", + "stylelint.vscode-stylelint" ] }, "folders": [ diff --git a/lib/Constants.js b/lib/Constants.js index 186755155..32a2f5b55 100644 --- a/lib/Constants.js +++ b/lib/Constants.js @@ -524,7 +524,7 @@ class StudyHours extends Enum { return 'Please specify your desired schedule below'; } const { times } = this; - const timesParts = times.map(([start, end]) => `${start}\u2013${end}`); + const timesParts = times.map(([start, end]) => `${start} -- ${end}`); return timesParts.join(', '); } } diff --git a/lib/controller/AuthController.js b/lib/controller/AuthController.js index fe09e4e77..8889e1818 100644 --- a/lib/controller/AuthController.js +++ b/lib/controller/AuthController.js @@ -100,7 +100,7 @@ AuthController.push({ return h.redirect(config.PUBLIC_PATH); } catch (err) { request.log(LogTag.ERROR, err); - return h.redirect('/login'); + return h.redirect('/'); } }, }); diff --git a/lib/i18n/Strings.js b/lib/i18n/Strings.js index 8dffbc9ec..f8bb627cb 100644 --- a/lib/i18n/Strings.js +++ b/lib/i18n/Strings.js @@ -43,6 +43,15 @@ const REQUEST_STUDY_NOT_FOUND = { text: 'Could not find study request.', }; +/* + * @memberof Strings + * @type {StringMessage} + */ +const REQUEST_STUDY_PROVIDE_URGENT_DUE_DATE = { + variant: 'info', + text: 'Please provide a due date for this request.', +}; + /* * @memberof Strings * @type {StringMessage} @@ -148,6 +157,7 @@ const Strings = { OPTIONAL, REQUEST_STUDY_FORBIDDEN, REQUEST_STUDY_NOT_FOUND, + REQUEST_STUDY_PROVIDE_URGENT_DUE_DATE, REQUEST_STUDY_PROVIDE_URGENT_REASON, REQUEST_STUDY_REQUIRES_LOCATION, REQUEST_STUDY_REQUIRES_REASONS, @@ -165,6 +175,7 @@ export { OPTIONAL, REQUEST_STUDY_FORBIDDEN, REQUEST_STUDY_NOT_FOUND, + REQUEST_STUDY_PROVIDE_URGENT_DUE_DATE, REQUEST_STUDY_PROVIDE_URGENT_REASON, REQUEST_STUDY_REQUIRES_LOCATION, REQUEST_STUDY_REQUIRES_REASONS, diff --git a/lib/reports/format/FormatCss.js b/lib/reports/format/FormatCss.js index 8522b9e0b..7b29bff92 100644 --- a/lib/reports/format/FormatCss.js +++ b/lib/reports/format/FormatCss.js @@ -11,7 +11,7 @@ import { InvalidCssVariableError } from '@/lib/error/MoveErrors'; */ /** - * Parses CSS variables from `web/css/main.postcss`. + * Parses CSS variables from `web/css/main.scss`. */ class FormatCss { /** @@ -53,7 +53,7 @@ class FormatCss { } /** - * Initializes `FormatCss.vars` from `main.postcss`. + * Initializes `FormatCss.vars` from `main.scss`. * * @returns {Promise} */ @@ -66,7 +66,7 @@ class FormatCss { try { const tdsPostcssPath = path.resolve( __dirname, - '../../../web/css/main.postcss', + '../../../web/css/main.scss', ); const tdsPostcss = readline.createInterface({ input: fs.createReadStream(tdsPostcssPath), diff --git a/lib/time/DateTime.js b/lib/time/DateTime.js index d20e11ab8..d3d6041b0 100644 --- a/lib/time/DateTime.js +++ b/lib/time/DateTime.js @@ -46,4 +46,9 @@ DateTime.fromJSON = function fromJSON(value) { return DateTime.fromSQL(value); }; +DateTime.fromLocaleString = function fromLocaleString(str) { + // TODO: get format from locale + return DateTime.fromFormat(str, 'M/d/yyyy'); +}; + export default DateTime; diff --git a/package.json b/package.json index 15717460a..fbbbf838f 100644 --- a/package.json +++ b/package.json @@ -124,7 +124,7 @@ "*.js": [ "vue-cli-service lint" ], - "*.postcss": [ + "*.scss": [ "stylelint" ], "*.py": [ diff --git a/src/styles/variables.scss b/src/styles/variables.scss new file mode 100644 index 000000000..2e7d3101d --- /dev/null +++ b/src/styles/variables.scss @@ -0,0 +1,7 @@ +/* + * This file indicates to `vuetify-loader` that Vuetify variable overrides are found at + * `@/styles/variables.scss`. However, we map `@` to the application root in order to + * share code between client and server. + * + * You can edit these styles at `styles/variables.scss` (without `src` in front). + */ diff --git a/styles/variables.scss b/styles/variables.scss new file mode 100644 index 000000000..ddf524f0b --- /dev/null +++ b/styles/variables.scss @@ -0,0 +1,53 @@ +$headings: ( + 'h1': ( + 'size': 3rem, + 'weight': normal, + 'line-height': 3.5rem + ), + 'h2': ( + 'size': 2.25rem, + 'weight': normal, + 'line-height': 2.5rem + ), + 'h3': ( + 'size': 1.5rem, + 'weight': 500, + 'line-height': 1.6875rem + ), + 'h4': ( + 'size': 1.25rem, + 'weight': normal, + 'line-height': 1.4375rem + ), + 'h5': ( + 'size': 1rem, + 'weight': 500, + 'line-height': 1.25rem + ), + 'h6': ( + 'size': 0.875rem, + 'weight': 500, + 'line-height': 1.25rem + ), + 'subtitle-1': ( + 'size': 0.875rem, + 'weight': normal, + 'line-height': 1rem + ), + 'subtitle-2': ( + 'size': 0.75rem, + 'weight': normal, + 'line-height': 1rem + ), + 'body-1': ( + 'size': 0.875rem, + 'weight': normal, + 'line-height': 1.25rem + ) +); + +$data-table-regular-header-font-size: map-get(map-get($headings, 'h6'), 'size'); +$data-table-regular-row-font-size: map-get(map-get($headings, 'body-1'), 'size'); +$tab-font-size: map-get(map-get($headings, 'h6'), 'size'); +$tab-font-weight: map-get(map-get($headings, 'h6'), 'weight'); +$tabs-item-letter-spacing: 0; diff --git a/tests/jest/unit/time/DateTime.spec.js b/tests/jest/unit/time/DateTime.spec.js index ccc6534aa..50517ea86 100644 --- a/tests/jest/unit/time/DateTime.spec.js +++ b/tests/jest/unit/time/DateTime.spec.js @@ -14,6 +14,16 @@ test('DateTime.local', () => { }); }); +test('DateTime.fromLocaleString', () => { + const actual = DateTime.fromLocaleString('2/18/2020'); + const expected = DateTime.fromObject({ + year: 2020, + month: 2, + day: 18, + }); + expect(actual.equals(expected)).toBe(true); +}); + test('DateTime.fromJSDate', () => { const dt = DateTime.fromJSDate(new Date()); expect(dt.zone).toEqual({ diff --git a/web/App.vue b/web/App.vue index 1a527e5e3..b917405d5 100644 --- a/web/App.vue +++ b/web/App.vue @@ -1,32 +1,14 @@ + + diff --git a/web/components/FcCommentsStudyRequest.vue b/web/components/FcCommentsStudyRequest.vue index 04b6101b0..b2761e9a0 100644 --- a/web/components/FcCommentsStudyRequest.vue +++ b/web/components/FcCommentsStudyRequest.vue @@ -1,6 +1,6 @@ + + diff --git a/web/components/inputs/FcCheckboxGroupChips.vue b/web/components/inputs/FcCheckboxGroupChips.vue index 467b88509..59ddbae04 100644 --- a/web/components/inputs/FcCheckboxGroupChips.vue +++ b/web/components/inputs/FcCheckboxGroupChips.vue @@ -7,7 +7,10 @@ v-for="{ selected, text, value } in itemsNormalized" :key="'' + value" class="mr-2" - :color="selected ? 'blue lighten-4' : null" + :class="{ + 'primary--text': selected, + }" + :color="selected ? 'light-blue lighten-5' : null" filter :value="value"> {{text}} diff --git a/web/components/inputs/FcDatePicker.vue b/web/components/inputs/FcDatePicker.vue index 002dc17b3..d67d2959f 100644 --- a/web/components/inputs/FcDatePicker.vue +++ b/web/components/inputs/FcDatePicker.vue @@ -11,10 +11,11 @@ + outlined + v-bind="$attrs">