Skip to content

Commit

Permalink
Merge branch 'stage' into Names-colors-more-generic
Browse files Browse the repository at this point in the history
  • Loading branch information
LuizFNJ authored Nov 14, 2024
2 parents 8e2b165 + 1855618 commit d57c866
Show file tree
Hide file tree
Showing 8 changed files with 133 additions and 125 deletions.
205 changes: 103 additions & 102 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,108 +4,109 @@
name: Aletheia CI

on:
push:
branches: [stage, develop]
pull_request:
branches: [stage, develop]
push:
branches: [stage, develop]
pull_request:
branches: [stage, develop]

env:
UMAMI_SITE_ID: ${{ secrets.DEVELOPMENT_UMAMI_SITE_ID }}
ORY_SDK_URL: http://127.0.0.1:4433 #${{ secrets.DEVELOPMENT_ORY_SDK_URL }}
# ORY_ACCESS_TOKEN: ${{ secrets.DEVELOPMENT_ORY_ACCESS_TOKEN }}
ALETHEIA_SCHEMA_ID: ${{ secrets.DEVELOPMENT_ALETHEIA_SCHEMA_ID }}
CI_ORY_USERID: ${{ secrets.CI_ORY_USERID }}
CI_ORY_USER_PASSWORD: ${{ secrets.CI_ORY_USER_PASSWORD }}
CI_MONGODB_URI: mongodb://127.0.0.1:35025/Aletheia
TEST_RECAPTCHA_SECRET: 6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe # public secret for CI tests provided by google
TEST_RECAPTCHA_SITEKEY: 6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI # public sitekey for CI tests provided by google
NEXT_PUBLIC_RECAPTCHA_SITEKEY: 6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI # public sitekey for CI tests provided by google
AWS_SDK_BUCKET: ${{ secrets.DEVELOPMENT_AWS_SDK_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.DEVELOPMENT_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DEVELOPMENT_AWS_SECRET_ACCESS_KEY }}
GITLAB_FEATURE_FLAG_URL: ${{ secrets.GITLAB_FEATURE_FLAG_URL }}
GITLAB_FEATURE_FLAG_INSTANCE_ID: ${{ secrets.GITLAB_FEATURE_FLAG_INSTANCE_ID }}
MONGOMS_VERSION: 6.0.17
UMAMI_SITE_ID: ${{ secrets.DEVELOPMENT_UMAMI_SITE_ID }}
ORY_SDK_URL: http://127.0.0.1:4433 #${{ secrets.DEVELOPMENT_ORY_SDK_URL }}
# ORY_ACCESS_TOKEN: ${{ secrets.DEVELOPMENT_ORY_ACCESS_TOKEN }}
ALETHEIA_SCHEMA_ID: ${{ secrets.DEVELOPMENT_ALETHEIA_SCHEMA_ID }}
CI_ORY_USERID: ${{ secrets.CI_ORY_USERID }}
CI_ORY_USER_PASSWORD: ${{ secrets.CI_ORY_USER_PASSWORD }}
CI_MONGODB_URI: mongodb://127.0.0.1:35025/Aletheia
TEST_RECAPTCHA_SECRET: 6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe # public secret for CI tests provided by google
TEST_RECAPTCHA_SITEKEY: 6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI # public sitekey for CI tests provided by google
NEXT_PUBLIC_RECAPTCHA_SITEKEY: 6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI # public sitekey for CI tests provided by google
AWS_SDK_BUCKET: ${{ secrets.DEVELOPMENT_AWS_SDK_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.DEVELOPMENT_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DEVELOPMENT_AWS_SECRET_ACCESS_KEY }}
GITLAB_FEATURE_FLAG_URL: ${{ secrets.GITLAB_FEATURE_FLAG_URL }}
GITLAB_FEATURE_FLAG_INSTANCE_ID: ${{ secrets.GITLAB_FEATURE_FLAG_INSTANCE_ID }}
MONGOMS_VERSION: 6.0.17
jobs:
test-docker:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.19.1]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Test docker image build before merge
run: |
docker build --build-arg ENVIRONMENT=development \
--build-arg NEXT_PUBLIC_UMAMI_SITE_ID=$NEXT_PUBLIC_UMAMI_SITE_ID \
--build-arg NEXT_PUBLIC_RECAPTCHA_SITEKEY=${{ secrets.NEXT_PUBLIC_RECAPTCHA_SITEKEY }} .
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.19.1]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: yarn install
- run: cp config/localConfig.example.ts config/localConfig.ts
- run: yarn build
- uses: actions/upload-artifact@v3
with:
name: aletheia-dist
path: dist/
test-lint:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.19.1]
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: aletheia-dist
path: dist
- run: yarn install
- run: yarn lint
- run: yarn test
env:
NODE_OPTIONS: "--max_old_space_size=4096"
# sonarcloud:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# node-version: [18.19.1]
# steps:
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
cypress-run:
needs: build
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: aletheia-dist
path: dist
- run: |
echo '{"CI_ORY_USER_PASSWORD": "${{ env.CI_ORY_USER_PASSWORD }}"}' > ./cypress.env.json
yarn install
- run: cp config/localConfig.example.ts config/localConfig.ts
- run: yarn build
- name: Cypress run
uses: cypress-io/github-action@v6
with:
start: yarn test:e2e:cy
wait-on: "http://localhost:3000"
env:
CI: true
test-docker:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.19.1]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Test docker image build before merge
run: |
docker build --build-arg ENVIRONMENT=development \
--build-arg NEXT_PUBLIC_UMAMI_SITE_ID=$NEXT_PUBLIC_UMAMI_SITE_ID \
--build-arg NEXT_PUBLIC_RECAPTCHA_SITEKEY=${{ secrets.NEXT_PUBLIC_RECAPTCHA_SITEKEY }} .
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.19.1]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: yarn install
- run: cp config/localConfig.example.ts config/localConfig.ts
- run: yarn build
- uses: actions/upload-artifact@v3
with:
name: aletheia-dist
path: dist/
test-lint:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.19.1]
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: aletheia-dist
path: dist
- run: yarn install
- run: cp config/localConfig.example.ts config/localConfig.ts
- run: yarn lint
- run: yarn test
env:
NODE_OPTIONS: "--max_old_space_size=4096"
# sonarcloud:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# node-version: [18.19.1]
# steps:
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
cypress-run:
needs: build
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: aletheia-dist
path: dist
- run: |
echo '{"CI_ORY_USER_PASSWORD": "${{ env.CI_ORY_USER_PASSWORD }}"}' > ./cypress.env.json
yarn install
- run: cp config/localConfig.example.ts config/localConfig.ts
- run: yarn build
- name: Cypress run
uses: cypress-io/github-action@v6
with:
start: yarn test:e2e:cy
wait-on: "http://localhost:3000"
env:
CI: true
2 changes: 1 addition & 1 deletion src/components/Footer/AletheiaSocialMediaFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useTranslation } from "next-i18next";
import React from "react";
import colors from "../../styles/colors";
import AletheiaSocialMediaIcons from "./AletheiaSocialMediaIcons";
import localConfig from "../../../config/localConfig.example";
import localConfig from "../../../config/localConfig";
import { SocialIcon } from "react-social-icons";
import { NameSpaceEnum } from "../../types/Namespace";
import { currentNameSpace } from "../../atoms/namespace";
Expand Down
26 changes: 14 additions & 12 deletions src/components/Footer/FooterInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import { useAppSelector } from "../../store/store";

import colors from "../../styles/colors";
import AletheiaButton, { ButtonType } from "../Button";
import localConfig from "../../../config/localConfig.example";
import localConfig from "../../../config/localConfig";

const FooterInfo = () => {
const { t } = useTranslation();
const { vw } = useAppSelector((state) => state);
const href = " https://github.com/AletheiaFact/aletheia"
const href = " https://github.com/AletheiaFact/aletheia";

return (
<Row justify={vw?.sm ? "center" : "start"}>
Expand All @@ -30,16 +30,18 @@ const FooterInfo = () => {
{href}
</a>
</span>
{localConfig.footer.showStatuteButton.show ? (<AletheiaButton
type={ButtonType.whiteBlue}
href={t("footer:statuteUrlButton")}
target="_blank"
rel="noreferrer"
>
<>
{t("about:labelButton")} <FileTextOutlined />
</>
</AletheiaButton>) : null}
{localConfig.footer.showStatuteButton.show ? (
<AletheiaButton
type={ButtonType.whiteBlue}
href={t("footer:statuteUrlButton")}
target="_blank"
rel="noreferrer"
>
<>
{t("about:labelButton")} <FileTextOutlined />
</>
</AletheiaButton>
) : null}
</Row>
);
};
Expand Down
1 change: 0 additions & 1 deletion src/components/Header/DonateButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from "react";
import AletheiaButton, { ButtonType } from "../Button";
import { trackUmamiEvent } from "../../lib/umami";
import { useTranslation } from "next-i18next";
import localConfig from "../../../config/localConfig.example";

const DonateButton = ({ header = false, style = {} }) => {
const { t } = useTranslation();
Expand Down
6 changes: 4 additions & 2 deletions src/components/Header/HeaderContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { useAtom } from "jotai";
import { currentNameSpace } from "../../atoms/namespace";
import { currentUserId } from "../../atoms/currentUser";
import { useRouter } from "next/router";
import localConfig from "../../../config/localConfig.example";
import localConfig from "../../../config/localConfig";

const HeaderContent = () => {
const dispatch = useDispatch();
Expand Down Expand Up @@ -83,7 +83,9 @@ const HeaderContent = () => {
/>
</AletheiaButton>
)}
{localConfig.header.donateButton.show ? (!hasSession && <DonateButton header={true} />) : null}
{localConfig.header.donateButton.show
? !hasSession && <DonateButton header={true} />
: null}

<NotificationMenu hasSession={hasSession} user={user} />
<UserMenu hasSession={hasSession} user={user} />
Expand Down
10 changes: 6 additions & 4 deletions src/components/Home/CTA/CTASectionButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useAppSelector } from "../../../store/store";
import { useTranslation } from "next-i18next";
import { useAtom } from "jotai";
import { isUserLoggedIn } from "../../../atoms/currentUser";
import localConfig from "../../../../config/localConfig.example";
import localConfig from "../../../../config/localConfig";

const CTASectionButtons = () => {
const { t } = useTranslation();
Expand Down Expand Up @@ -49,9 +49,11 @@ const CTASectionButtons = () => {
)}
{!smallDevice && (
<Col md={11}>
{localConfig.header.donateButton.show ? <DonateButton
style={{ fontSize: mediumDevice ? "12px" : "14px" }}
/> : null}
{localConfig.header.donateButton.show ? (
<DonateButton
style={{ fontSize: mediumDevice ? "12px" : "14px" }}
/>
) : null}
</Col>
)}
</Col>
Expand Down
6 changes: 4 additions & 2 deletions src/components/MainApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Header from "./Header/Header";
import OverlaySearchResults from "./Search/OverlaySearchResults";
import Sidebar from "./Sidebar";
import AffixCTAButton from "./AffixButton/AffixCTAButton";
import localConfig from "../../config/localConfig.example";
import localConfig from "../../config/localConfig";

const copilotDrawerWidth = 350;

Expand Down Expand Up @@ -43,7 +43,9 @@ const MainApp = ({ children }) => {
<Sidebar />
<Layout style={{ background: colors.white }}>
<Header />
{localConfig.home.affixCTA ? <AffixCTAButton copilotDrawerWidth={copilotDrawerWidth} /> : null}
{localConfig.home.affixCTA ? (
<AffixCTAButton copilotDrawerWidth={copilotDrawerWidth} />
) : null}
<ContentWrapper>{children}</ContentWrapper>
<Footer />
{enableOverlay && <OverlaySearchResults />}
Expand Down
2 changes: 1 addition & 1 deletion src/styles/colors.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import localConfig from "../../config/localConfig.example";
import localConfig from "../../config/localConfig";

const colors = {
primary: "rgb(17, 39, 58)", //#11273a
Expand Down

0 comments on commit d57c866

Please sign in to comment.