From ca821cc9ce961f629112a201a938a892c0acf458 Mon Sep 17 00:00:00 2001 From: Limezy Date: Sat, 28 Jan 2023 15:48:31 +0700 Subject: [PATCH] Remove anthropologiebiblique patches --- sources/patches/app-03-visitor.patch | 126 ------------------------- sources/patches/app-04-bible.patch | 135 --------------------------- sources/patches/app-05-login.patch | 59 ------------ 3 files changed, 320 deletions(-) delete mode 100644 sources/patches/app-03-visitor.patch delete mode 100644 sources/patches/app-04-bible.patch delete mode 100644 sources/patches/app-05-login.patch diff --git a/sources/patches/app-03-visitor.patch b/sources/patches/app-03-visitor.patch deleted file mode 100644 index 7aeb1a7..0000000 --- a/sources/patches/app-03-visitor.patch +++ /dev/null @@ -1,126 +0,0 @@ -diff --git a/server/routes/auth/providers/req.ts b/server/routes/auth/providers/req.ts -new file mode 100644 -index 000000000..be344d2e2 ---- /dev/null -+++ b/server/routes/auth/providers/req.ts -@@ -0,0 +1,62 @@ -+import passport from "@outlinewiki/koa-passport"; -+import Router from "koa-router"; -+import { capitalize } from "lodash"; -+import { Strategy as ReqStrategy } from "passport-req"; -+import accountProvisioner from "@server/commands/accountProvisioner"; -+import env from "@server/env"; -+import passportMiddleware from "@server/middlewares/passport"; -+import { StateStore } from "@server/utils/passport"; -+ -+const router = new Router(); -+const providerName = "req"; -+ -+export const config = { -+ name: "visiteur", -+ enabled: true, -+}; -+ -+if (true) { -+ passport.use( -+ new ReqStrategy( -+ async function (req,done) { -+ try { -+ const domain = "domain.tld"; -+ const subdomain = domain.split(".")[0]; -+ const teamName = capitalize(subdomain); -+ const name = "visiteur"; -+ const email = "visiteur@anthropologiebiblique.fr"; -+ const result = await accountProvisioner({ -+ ip: req.ip, -+ team: { -+ name: teamName, -+ domain, -+ subdomain, -+ }, -+ user: { -+ name: name, -+ email: email, -+ avatarUrl: null, -+ }, -+ authenticationProvider: { -+ name: providerName, -+ providerId: domain, -+ }, -+ authentication: { -+ providerId: "1234", -+ accessToken: null, -+ refreshToken: null, -+ scopes: [], -+ }, -+ }); -+ return done(null, result.user, result); -+ } catch (err) { -+ return done(err, null); -+ } -+ } -+ ) -+ ); -+ -+ router.get("req", passportMiddleware(providerName)); -+} -+ -+export default router; -diff --git a/yarn.lock b/yarn.lock -index 67d407ca7..150665e94 100644 ---- a/yarn.lock -+++ b/yarn.lock -@@ -12100,6 +12100,14 @@ passport-oauth@1.0.x: - passport-oauth1 "1.x.x" - passport-oauth2 "1.x.x" - -+passport-req@^0.1.1: -+ version "0.1.1" -+ resolved "https://registry.yarnpkg.com/passport-req/-/passport-req-0.1.1.tgz#451bff1500b3d464a768d42f0762328a21236a18" -+ integrity sha512-9qmM0vD5v7jYLWxezNNCleOw+8IkVAuvOwQ6NJaUuJkdFJTR1KatXH1i5MxWgffx+libLWYLRUPtc6GHOmn+6w== -+ dependencies: -+ passport "~0.1.1" -+ pkginfo "0.2.x" -+ - passport-slack-oauth2@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/passport-slack-oauth2/-/passport-slack-oauth2-1.1.1.tgz#d831ffc3f1e968fcc3622e6ecf41643c8d8f9cbc" -@@ -12122,6 +12130,14 @@ passport@^0.6.0: - pause "0.0.1" - utils-merge "^1.0.1" - -+passport@~0.1.1: -+ version "0.1.18" -+ resolved "https://registry.yarnpkg.com/passport/-/passport-0.1.18.tgz#c8264479dcb6414cadbb66752d12b37e0b6525a1" -+ integrity sha512-qteYojKG/qth7UBbbGU7aqhe5ndJs6YaUkH2B6+7FWQ0OeyYmWknzOATpMhdoSTDcLLliq9n4Fcy1mGs80iUMw== -+ dependencies: -+ pause "0.0.1" -+ pkginfo "0.2.x" -+ - passthrough-counter@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/passthrough-counter/-/passthrough-counter-1.0.0.tgz#1967d9e66da572b5c023c787db112a387ab166fa" -@@ -12348,6 +12364,11 @@ pkg-up@^3.1.0: - dependencies: - find-up "^3.0.0" - -+pkginfo@0.2.x: -+ version "0.2.3" -+ resolved "https://registry.yarnpkg.com/pkginfo/-/pkginfo-0.2.3.tgz#7239c42a5ef6c30b8f328439d9b9ff71042490f8" -+ integrity sha512-7W7wTrE/NsY8xv/DTGjwNIyNah81EQH0MWcTzrHL6pOpMocOGZc0Mbdz9aXxSrp+U0mSmkU8jrNCDCfUs3sOBg== -+ - pkginfo@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/pkginfo/-/pkginfo-0.4.1.tgz#b5418ef0439de5425fc4995042dced14fb2a84ff" -diff --git a/package.json b/package.json -index d64914567..ca674a5cd 100644 ---- a/package.json -+++ b/package.json -@@ -145,6 +145,7 @@ - "passport": "^0.6.0", - "passport-google-oauth2": "^0.2.0", - "passport-oauth2": "^1.6.1", -+ "passport-req": "^0.1.1", - "passport-slack-oauth2": "^1.1.1", - "pg": "^8.8.0", - "pg-hstore": "^2.3.4", diff --git a/sources/patches/app-04-bible.patch b/sources/patches/app-04-bible.patch deleted file mode 100644 index 37961d1..0000000 --- a/sources/patches/app-04-bible.patch +++ /dev/null @@ -1,135 +0,0 @@ -diff --git a/app/editor/menus/block.tsx b/app/editor/menus/block.tsx -index 42269b5e4..f5e5041e3 100644 ---- a/app/editor/menus/block.tsx -+++ b/app/editor/menus/block.tsx -@@ -19,6 +19,7 @@ import { - ClockIcon, - CalendarIcon, - MathIcon, -+ BookmarkedIcon, - } from "outline-icons"; - import * as React from "react"; - import styled from "styled-components"; -@@ -187,6 +188,13 @@ export default function blockMenuItems(dictionary: Dictionary): MenuItem[] { - keywords: "notice card suggestion", - attrs: { style: "tip" }, - }, -+ { -+ name: "container_notice", -+ title: dictionary.bibleNotice, -+ icon: BookmarkedIcon, -+ keywords: "notice card suggestion", -+ attrs: { style: "bible" }, -+ }, - { - name: "separator", - }, -diff --git a/app/hooks/useDictionary.ts b/app/hooks/useDictionary.ts -index 5b9196de5..90caf27d7 100644 ---- a/app/hooks/useDictionary.ts -+++ b/app/hooks/useDictionary.ts -@@ -75,6 +75,8 @@ export default function useDictionary() { - showSource: t("Show source"), - warning: t("Warning"), - warningNotice: t("Warning notice"), -+ bible: t("Bible"), -+ bibleNotice: t("Bible quote"), - insertDate: t("Current date"), - insertTime: t("Current time"), - insertDateTime: t("Current date and time"), -diff --git a/app/typings/styled-components.d.ts b/app/typings/styled-components.d.ts -index 5a4d4a079..e43c4fc29 100644 ---- a/app/typings/styled-components.d.ts -+++ b/app/typings/styled-components.d.ts -@@ -53,6 +53,8 @@ declare module "styled-components" { - noticeTipText: string; - noticeWarningBackground: string; - noticeWarningText: string; -+ noticeBibleBackground: string; -+ noticeBibleText: string; - } - - interface Colors { -diff --git a/shared/editor/components/Styles.ts b/shared/editor/components/Styles.ts -index c61b0fdb4..6ea2a6798 100644 ---- a/shared/editor/components/Styles.ts -+++ b/shared/editor/components/Styles.ts -@@ -635,6 +635,20 @@ h6 { - } - } - -+.notice-block.bible { -+ background: ${transparentize(0.9, props.theme.noticeBibleBackground)}; -+ border-left: 4px solid ${props.theme.noticeBibleBackground}; -+ color: ${props.theme.noticeBibleText}; -+ -+ .icon { -+ color: ${props.theme.noticeBibleBackground}; -+ } -+ -+ a { -+ color: ${props.theme.noticeBibleText}; -+ } -+} -+ - blockquote { - margin: 0; - padding-left: 1.5em; -diff --git a/shared/editor/nodes/Notice.tsx b/shared/editor/nodes/Notice.tsx -index 158a0dfb9..f297c3433 100644 ---- a/shared/editor/nodes/Notice.tsx -+++ b/shared/editor/nodes/Notice.tsx -@@ -1,5 +1,5 @@ - import Token from "markdown-it/lib/token"; --import { WarningIcon, InfoIcon, StarredIcon } from "outline-icons"; -+import { WarningIcon, InfoIcon, StarredIcon, BookmarkedIcon } from "outline-icons"; - import { wrappingInputRule } from "prosemirror-inputrules"; - import { NodeSpec, Node as ProsemirrorNode, NodeType } from "prosemirror-model"; - import * as React from "react"; -@@ -15,6 +15,7 @@ export default class Notice extends Node { - info: this.options.dictionary.info, - warning: this.options.dictionary.warning, - tip: this.options.dictionary.tip, -+ bible: this.options.dictionary.bible, - }); - } - -@@ -47,6 +48,8 @@ export default class Notice extends Node { - ? "tip" - : dom.className.includes("warning") - ? "warning" -+ : dom.className.includes("bible") -+ ? "bible" - : undefined, - }), - }, -@@ -75,6 +78,8 @@ export default class Notice extends Node { - component = ; - } else if (node.attrs.style === "warning") { - component = ; -+ } else if (node.attrs.style === "bible") { -+ component = ; - } else { - component = ; - } -diff --git a/shared/styles/theme.ts b/shared/styles/theme.ts -index f28d552c0..1e6490890 100644 ---- a/shared/styles/theme.ts -+++ b/shared/styles/theme.ts -@@ -88,6 +88,8 @@ export const base = { - noticeTipText: colors.almostBlack, - noticeWarningBackground: "#d73a49", - noticeWarningText: colors.almostBlack, -+ noticeBibleBackground: "#996633", -+ noticeBibleText: colors.almostBlack, - breakpoints, - }; - -@@ -213,6 +215,7 @@ export const dark = { - noticeInfoText: colors.white, - noticeTipText: colors.white, - noticeWarningText: colors.white, -+ noticeBibleText: colors.white, - progressBarBackground: colors.slate, - scrollbarBackground: colors.black, - scrollbarThumb: colors.lightBlack, \ No newline at end of file diff --git a/sources/patches/app-05-login.patch b/sources/patches/app-05-login.patch deleted file mode 100644 index 04d1af9..0000000 --- a/sources/patches/app-05-login.patch +++ /dev/null @@ -1,59 +0,0 @@ -diff --git a/app/scenes/Login/AuthenticationProvider.tsx b/app/scenes/Login/AuthenticationProvider.tsx -index 7e124c124..0deb00a85 100644 ---- a/app/scenes/Login/AuthenticationProvider.tsx -+++ b/app/scenes/Login/AuthenticationProvider.tsx -@@ -91,7 +91,7 @@ function AuthenticationProvider(props: Props) { - - -- {t("Sign In")} → -+ {t("S'identifier")} → - - - ) : ( - } fullwidth> -- {t("Continue with Email")} -+ {t("Accès membre (email)")} - - )} - -@@ -120,7 +120,7 @@ function AuthenticationProvider(props: Props) { - icon={} - fullwidth - > -- {t("Continue with {{ authProviderName }}", { -+ {t("Accès {{ authProviderName }}", { - authProviderName: name, - })} - -diff --git a/app/scenes/Login/index.tsx b/app/scenes/Login/index.tsx -index 168165b08..9e1ec2f5d 100644 ---- a/app/scenes/Login/index.tsx -+++ b/app/scenes/Login/index.tsx -@@ -214,7 +214,7 @@ function Login({ children }: Props) { - ) : ( - <> - -- {t("Login to {{ authProviderName }}", { -+ {t("Bienvenue sur Anthropologie Biblique", { - authProviderName: config.name || env.APP_NAME, - })} - -@@ -232,7 +232,7 @@ function Login({ children }: Props) { - {hasMultipleProviders && ( - <> - -- {t("You signed in with {{ authProviderName }} last time.", { -+ {t("Vous vous êtes authentifié avec l'accès {{ authProviderName }} la dernière fois.", { - authProviderName: defaultProvider.name, - })} -