diff --git a/.vscode/settings.json b/.vscode/settings.json index 2c4bf4a1a..91e78f999 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -55,4 +55,7 @@ "__generated__" ], "debug.node.autoAttach": "on", + "search.exclude": { + "package-lock.json": true + }, } diff --git a/src/core/client/admin/components/UserHistoryDrawer/RecentHistory.tsx b/src/core/client/admin/components/UserHistoryDrawer/RecentHistory.tsx index adcbfbeaa..dac85cdc4 100644 --- a/src/core/client/admin/components/UserHistoryDrawer/RecentHistory.tsx +++ b/src/core/client/admin/components/UserHistoryDrawer/RecentHistory.tsx @@ -2,7 +2,8 @@ import { Localized } from "@fluent/react/compat"; import cn from "classnames"; import React, { FunctionComponent } from "react"; -import { reduceSeconds, UNIT } from "coral-common/helpers/i18n"; +import { reduceSeconds } from "coral-common/helpers/i18n"; +import TIME from "coral-common/time"; import { Flex, HorizontalGutter, @@ -25,7 +26,7 @@ const RecentHistory: FunctionComponent = ({ rejectionRate, submitted, }) => { - const { scaled, unit } = reduceSeconds(timeFrame, [UNIT.DAYS]); + const { scaled, unit } = reduceSeconds(timeFrame, [TIME.DAY]); return ( diff --git a/src/core/client/admin/routes/Configure/sections/Advanced/CustomCSSConfig.tsx b/src/core/client/admin/routes/Configure/sections/Advanced/CustomCSSConfig.tsx index bce7da112..a0c92ef42 100644 --- a/src/core/client/admin/routes/Configure/sections/Advanced/CustomCSSConfig.tsx +++ b/src/core/client/admin/routes/Configure/sections/Advanced/CustomCSSConfig.tsx @@ -30,13 +30,10 @@ const CustomCSSConfig: FunctionComponent = ({ disabled }) => ( } > - } - > + }> URL of a CSS stylesheet that will override default Embed Stream - styles. Can be internal or external. + styles. diff --git a/src/core/client/admin/routes/Configure/sections/General/ClosingCommentStreamsConfig.tsx b/src/core/client/admin/routes/Configure/sections/General/ClosingCommentStreamsConfig.tsx index 708b56cf1..b0b86de0e 100644 --- a/src/core/client/admin/routes/Configure/sections/General/ClosingCommentStreamsConfig.tsx +++ b/src/core/client/admin/routes/Configure/sections/General/ClosingCommentStreamsConfig.tsx @@ -80,9 +80,9 @@ const ClosingCommentStreamsConfig: FunctionComponent = ({ = ({ disabled }) => ( = ({ disabled }) => { - + = ({ disabled }) => { {({ input, meta }) => ( <> - URL of a CSS stylesheet that will override default Embed Stream styles. Can be internal or external. + URL of a CSS stylesheet that will override default Embed Stream styles.

- Number of first comments sent for approval + Number of comments that must be approved
({ }, recentCommentHistory: { enabled: false, - // 7 days in seconds. - timeFrame: 604800, + timeFrame: 7 * TIME.DAY, // Rejection rate defaulting to 30%, once exceeded, comments will be // pre-moderated. triggerRejectionRate: 0.3, @@ -94,7 +94,7 @@ export const settings = createFixture({ }, }, auth: { - sessionDuration: DEFAULT_SESSION_LENGTH, + sessionDuration: DEFAULT_SESSION_DURATION, integrations: { local: { enabled: true, @@ -175,7 +175,7 @@ export const settingsWithEmptyAuth = createFixture( { id: "settings", auth: { - sessionDuration: DEFAULT_SESSION_LENGTH, + sessionDuration: DEFAULT_SESSION_DURATION, integrations: { local: { enabled: true, diff --git a/src/core/client/framework/components/DurationField.spec.tsx b/src/core/client/framework/components/DurationField.spec.tsx index 7cea24a92..b989597d7 100644 --- a/src/core/client/framework/components/DurationField.spec.tsx +++ b/src/core/client/framework/components/DurationField.spec.tsx @@ -24,7 +24,7 @@ it("renders correctly with specified units", () => { value: "", disabled: false, onChange: noop, - units: [DURATION_UNIT.SECONDS, DURATION_UNIT.HOURS], + units: [DURATION_UNIT.SECOND, DURATION_UNIT.HOUR], }; const renderer = createRenderer(); renderer.render(); @@ -37,7 +37,7 @@ it("use best matching unit", () => { value: "3600", disabled: false, onChange: noop, - units: [DURATION_UNIT.SECONDS, DURATION_UNIT.MINUTES, DURATION_UNIT.HOURS], + units: [DURATION_UNIT.SECOND, DURATION_UNIT.MINUTE, DURATION_UNIT.HOUR], }; const renderer = createRenderer(); renderer.render(); @@ -50,7 +50,7 @@ it("use initial unit if 0", () => { value: "0", disabled: false, onChange: noop, - units: [DURATION_UNIT.SECONDS, DURATION_UNIT.MINUTES, DURATION_UNIT.HOURS], + units: [DURATION_UNIT.SECOND, DURATION_UNIT.MINUTE, DURATION_UNIT.HOUR], }; const renderer = createRenderer(); renderer.render(); @@ -63,7 +63,7 @@ it("accepts invalid input", () => { value: "this is so invalid", disabled: false, onChange: noop, - units: [DURATION_UNIT.SECONDS, DURATION_UNIT.MINUTES, DURATION_UNIT.HOURS], + units: [DURATION_UNIT.SECOND, DURATION_UNIT.MINUTE, DURATION_UNIT.HOUR], }; const renderer = createRenderer(); renderer.render(); diff --git a/src/core/client/framework/components/DurationField.tsx b/src/core/client/framework/components/DurationField.tsx index 915b8274a..619c6a53f 100644 --- a/src/core/client/framework/components/DurationField.tsx +++ b/src/core/client/framework/components/DurationField.tsx @@ -8,7 +8,7 @@ import React, { useState, } from "react"; -import { UNIT } from "coral-common/helpers/i18n"; +import TIME from "coral-common/time"; import { Flex, Option, @@ -23,14 +23,14 @@ import styles from "./DurationField.css"; * DURATION_UNIT are units that can be used in the * DurationField components. */ -export const DURATION_UNIT = UNIT; +export const DURATION_UNIT = TIME; const DURATION_UNIT_MAP = { - [DURATION_UNIT.SECONDS]: "second", - [DURATION_UNIT.MINUTES]: "minute", - [DURATION_UNIT.HOURS]: "hour", - [DURATION_UNIT.DAYS]: "day", - [DURATION_UNIT.WEEKS]: "week", + [DURATION_UNIT.SECOND]: "second", + [DURATION_UNIT.MINUTE]: "minute", + [DURATION_UNIT.HOUR]: "hour", + [DURATION_UNIT.DAY]: "day", + [DURATION_UNIT.WEEK]: "week", }; interface Props { @@ -39,18 +39,18 @@ interface Props { disabled: boolean; onChange: (v: string) => void; /** Specifiy units to include */ - units?: ReadonlyArray; + units?: ReadonlyArray