diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 77f4417543..082ccc7141 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,8 +1,8 @@ blank_issues_enabled: false contact_links: - name: Feature request - url: https://github.com/outline/outline/discussions/new + url: https://github.com/outline/outline/discussions/new?category=ideas about: Request a feature to be added to the project - name: Self hosting questions - url: https://github.com/outline/outline/discussions/new + url: https://github.com/outline/outline/discussions/new?category=self-hosting about: Ask questions and discuss running Outline with community members diff --git a/Dockerfile b/Dockerfile index dfbd27a7da..3e63fa589e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,8 @@ WORKDIR $APP_PATH # --- FROM node:18-alpine AS runner +LABEL org.opencontainers.image.source="https://github.com/outline/outline" + ARG APP_PATH WORKDIR $APP_PATH ENV NODE_ENV production diff --git a/Dockerfile.base b/Dockerfile.base index 4c322b0a64..16401bd4f7 100644 --- a/Dockerfile.base +++ b/Dockerfile.base @@ -1,5 +1,5 @@ ARG APP_PATH=/opt/outline -FROM node:16.14.2-alpine3.15 AS deps +FROM node:18-alpine AS deps RUN apk --no-cache add curl diff --git a/app.json b/app.json index e7d5919b76..a062974554 100644 --- a/app.json +++ b/app.json @@ -3,13 +3,7 @@ "description": "Open source wiki and knowledge base for growing teams", "website": "https://www.getoutline.com/", "repository": "https://github.com/outline/outline", - "keywords": [ - "wiki", - "team", - "node", - "markdown", - "slack" - ], + "keywords": ["wiki", "team", "node", "markdown", "slack"], "success_url": "/", "formation": { "web": { @@ -188,7 +182,7 @@ "required": false }, "GOOGLE_ANALYTICS_ID": { - "description": "UA-xxxx (optional)", + "description": "G-xxxx (optional)", "required": false }, "SENTRY_DSN": { diff --git a/app/actions/definitions/documents.tsx b/app/actions/definitions/documents.tsx index b8d53177f7..fe69dfa718 100644 --- a/app/actions/definitions/documents.tsx +++ b/app/actions/definitions/documents.tsx @@ -37,8 +37,8 @@ import { DocumentSection } from "~/actions/sections"; import env from "~/env"; import history from "~/utils/history"; import { - documentInsightsUrl, - documentHistoryUrl, + documentInsightsPath, + documentHistoryPath, homePath, newDocumentPath, searchPath, @@ -749,7 +749,7 @@ export const openDocumentHistory = createAction({ if (!document) { return; } - history.push(documentHistoryUrl(document)); + history.push(documentHistoryPath(document)); }, }); @@ -770,7 +770,7 @@ export const openDocumentInsights = createAction({ if (!document) { return; } - history.push(documentInsightsUrl(document)); + history.push(documentInsightsPath(document)); }, }); diff --git a/app/actions/definitions/revisions.tsx b/app/actions/definitions/revisions.tsx index 55f1ba1cdc..4ecb1bc03b 100644 --- a/app/actions/definitions/revisions.tsx +++ b/app/actions/definitions/revisions.tsx @@ -6,7 +6,10 @@ import stores from "~/stores"; import { createAction } from "~/actions"; import { RevisionSection } from "~/actions/sections"; import history from "~/utils/history"; -import { documentHistoryUrl, matchDocumentHistory } from "~/utils/routeHelpers"; +import { + documentHistoryPath, + matchDocumentHistory, +} from "~/utils/routeHelpers"; export const restoreRevision = createAction({ name: ({ t }) => t("Restore revision"), @@ -57,7 +60,7 @@ export const copyLinkToRevision = createAction({ return; } - const url = `${window.location.origin}${documentHistoryUrl( + const url = `${window.location.origin}${documentHistoryPath( document, revisionId )}`; diff --git a/app/actions/definitions/users.tsx b/app/actions/definitions/users.tsx index 07ddcc276e..c2ba446118 100644 --- a/app/actions/definitions/users.tsx +++ b/app/actions/definitions/users.tsx @@ -2,6 +2,7 @@ import { PlusIcon } from "outline-icons"; import * as React from "react"; import stores from "~/stores"; import Invite from "~/scenes/Invite"; +import { UserDeleteDialog } from "~/components/UserDialogs"; import { createAction } from "~/actions"; import { UserSection } from "~/actions/sections"; @@ -21,4 +22,31 @@ export const inviteUser = createAction({ }, }); +export const deleteUserActionFactory = (userId: string) => + createAction({ + name: ({ t }) => `${t("Delete user")}…`, + analyticsName: "Delete user", + keywords: "leave", + dangerous: true, + section: UserSection, + visible: ({ stores }) => stores.policies.abilities(userId).delete, + perform: ({ t }) => { + const user = stores.users.get(userId); + if (!user) { + return; + } + + stores.dialogs.openModal({ + title: t("Delete user"), + isCentered: true, + content: ( + + ), + }); + }, + }); + export const rootUserActions = [inviteUser]; diff --git a/app/components/Analytics.tsx b/app/components/Analytics.tsx index 79af34d880..d942668c55 100644 --- a/app/components/Analytics.tsx +++ b/app/components/Analytics.tsx @@ -8,7 +8,7 @@ import env from "~/env"; const Analytics: React.FC = ({ children }) => { // Google Analytics 3 React.useEffect(() => { - if (!env.GOOGLE_ANALYTICS_ID) { + if (!env.GOOGLE_ANALYTICS_ID?.startsWith("UA-")) { return; } @@ -37,25 +37,36 @@ const Analytics: React.FC = ({ children }) => { // Google Analytics 4 React.useEffect(() => { - if (env.analytics.service !== IntegrationService.GoogleAnalytics) { + const measurementIds = []; + + if (env.analytics.service === IntegrationService.GoogleAnalytics) { + measurementIds.push(escape(env.analytics.settings?.measurementId)); + } + if (env.GOOGLE_ANALYTICS_ID?.startsWith("G-")) { + measurementIds.push(env.GOOGLE_ANALYTICS_ID); + } + if (measurementIds.length === 0) { return; } - const measurementId = escape(env.analytics.settings?.measurementId); + const params = { + allow_google_signals: false, + restricted_data_processing: true, + }; window.dataLayer = window.dataLayer || []; window.gtag = function () { window.dataLayer.push(arguments); }; window.gtag("js", new Date()); - window.gtag("config", measurementId, { - allow_google_signals: false, - restricted_data_processing: true, - }); + + for (const measurementId of measurementIds) { + window.gtag("config", measurementId, params); + } const script = document.createElement("script"); script.type = "text/javascript"; - script.src = `https://www.googletagmanager.com/gtag/js?id=${measurementId}`; + script.src = `https://www.googletagmanager.com/gtag/js?id=${measurementIds[0]}`; script.async = true; document.getElementsByTagName("head")[0]?.appendChild(script); }, []); diff --git a/app/components/AuthenticatedLayout.tsx b/app/components/AuthenticatedLayout.tsx index fc4c29fff7..92b422a3cd 100644 --- a/app/components/AuthenticatedLayout.tsx +++ b/app/components/AuthenticatedLayout.tsx @@ -61,7 +61,7 @@ const AuthenticatedLayout: React.FC = ({ children }) => { return; } const { activeCollectionId } = ui; - if (!activeCollectionId || !can.update) { + if (!activeCollectionId || !can.createDocument) { return; } history.push(newDocumentPath(activeCollectionId)); diff --git a/app/components/CollectionDeleteDialog.tsx b/app/components/CollectionDeleteDialog.tsx index 27a82ec638..f51da8ed26 100644 --- a/app/components/CollectionDeleteDialog.tsx +++ b/app/components/CollectionDeleteDialog.tsx @@ -39,7 +39,7 @@ function CollectionDeleteDialog({ collection, onSubmit }: Props) { <> = ({ @@ -23,6 +25,7 @@ const ConfirmationDialog: React.FC = ({ submitText, savingText, danger, + disabled = false, }) => { const [isSaving, setIsSaving] = React.useState(false); const { dialogs } = useStores(); @@ -50,7 +53,12 @@ const ConfirmationDialog: React.FC = ({
{children} -
diff --git a/app/components/ContextMenu/Template.tsx b/app/components/ContextMenu/Template.tsx index 84cb0053c1..1b68bfc840 100644 --- a/app/components/ContextMenu/Template.tsx +++ b/app/components/ContextMenu/Template.tsx @@ -66,6 +66,7 @@ const SubMenu = React.forwardRef( {...menu} aria-label={t("Submenu")} onClick={parentMenuState.hide} + parentMenuState={parentMenuState} >