Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slb 295 breadcrumbs #229

Merged
merged 20 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ runs:
shell: bash
run: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 pnpm i

- name: Check formatting
shell: bash
run: pnpm test:format

- name: Cache playwright binaries
uses: actions/cache@v3
id: playwright-cache
Expand Down
19 changes: 14 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,15 @@ jobs:

- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
run:
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >>
$GITHUB_OUTPUT
id: extract_branch

- name: Prepare deployment package
run: pnpm turbo:prep && pnpm deploy --filter "@custom/website" ../deploy --prod
run:
pnpm turbo:prep && pnpm deploy --filter "@custom/website" ../deploy
--prod
env:
VITE_DECAP_REPO: ${{ github.repository }}
VITE_DECAP_BRANCH: ${{ steps.extract_branch.outputs.branch }}
Expand All @@ -54,16 +58,21 @@ jobs:
- name: Deploy to dev
run: pnpm netlify deploy --prod --filter "@custom/website"
working-directory: ../deploy
if: github.ref == 'refs/heads/dev' && steps.netlify-check.outputs.available == 'true' && vars.NETLIFY_DEV_ID != ''
if:
github.ref == 'refs/heads/dev' &&
steps.netlify-check.outputs.available == 'true' && vars.NETLIFY_DEV_ID
!= ''
env:
NETLIFY_SITE_ID: ${{ vars.NETLIFY_DEV_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}

- name: Deploy to prod
run: pnpm netlify deploy --prod --filter "@custom/website"
working-directory: ../deploy
if: github.ref == 'refs/heads/prod' && steps.netlify-check.outputs.available == 'true' && vars.NETLIFY_PROD_ID != ''
if:
github.ref == 'refs/heads/prod' &&
steps.netlify-check.outputs.available == 'true' &&
vars.NETLIFY_PROD_ID != ''
env:
NETLIFY_SITE_ID: ${{ vars.NETLIFY_PROD_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}

8 changes: 6 additions & 2 deletions .github/workflows/high_content_volume.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ jobs:
run: pnpm --filter "@custom/website" clean

- name: 'Drupal: Create content'
run: pnpm --filter "@custom/cms" drush php:script scripts/create-lots-of-content/run.php
run:
pnpm --filter "@custom/cms" drush php:script
scripts/create-lots-of-content/run.php

- name: 'Gatsby: Full build'
run: pnpm --filter "@custom/website" build:gatsby
Expand All @@ -44,7 +46,9 @@ jobs:
run: pnpm --filter "@custom/website" build:gatsby

- name: 'Drupal: Create more content'
run: pnpm --filter "@custom/cms" drush php:script scripts/create-lots-of-content/create-100-pages.php
run:
pnpm --filter "@custom/cms" drush php:script
scripts/create-lots-of-content/create-100-pages.php

- name: 'Gatsby: Incremental build with new content'
run: pnpm --filter "@custom/website" build:gatsby
2 changes: 1 addition & 1 deletion .github/workflows/merge_dev_to_stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
with:
type: now
target_branch: stage
github_token: ${{ github.token }}
github_token: ${{ github.token }}
15 changes: 12 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ jobs:
steps:
- name: Init check
if: ${{ github.repository != 'AmazeeLabs/silverback-template'}}
run: echo 'Please run the INIT script. See the root README.md for instructions.' && false
run:
echo 'Please run the INIT script. See the root README.md for
instructions.' && false

- name: Checkout
uses: actions/checkout@v3
Expand All @@ -19,6 +21,9 @@ jobs:
- name: Setup
uses: ./.github/actions/setup

- name: Check formatting
run: pnpm test:format

- name: TurboRepo local server
uses: felixmosh/turborepo-gh-artifacts@v2
with:
Expand Down Expand Up @@ -77,7 +82,9 @@ jobs:

- name: Merge release to prod (silverback-template only)
uses: devmasx/[email protected]
if: ${{ github.repository == 'AmazeeLabs/silverback-template' && github.ref == 'refs/heads/release'}}
if:
${{ github.repository == 'AmazeeLabs/silverback-template' &&
github.ref == 'refs/heads/release'}}
with:
type: now
from_branch: release
Expand All @@ -86,7 +93,9 @@ jobs:

docker_build:
name: Docker Build
if: startsWith(github.ref_name, 'test-all/') || startsWith(github.head_ref, 'test-all/')
if:
startsWith(github.ref_name, 'test-all/') || startsWith(github.head_ref,
'test-all/')
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test_without_turbo_cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ jobs:
steps:
- name: Init check
if: ${{ github.repository != 'AmazeeLabs/silverback-template'}}
run: echo 'Please run the INIT script. See the root README.md for instructions.' && false
run:
echo 'Please run the INIT script. See the root README.md for
instructions.' && false

- name: Checkout
uses: actions/checkout@v3
Expand Down
5 changes: 0 additions & 5 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,3 @@ RUN chmod a+x phpactor.phar
RUN sudo mv phpactor.phar /usr/local/bin/phpactor
# Install gh cli
RUN sudo install-packages gh

RUN curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_0.40.2_Linux_x86_64.tar.gz" \
&& tar xf lazygit.tar.gz lazygit \
&& sudo install lazygit /usr/local/bin

2 changes: 1 addition & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
tasks:
- name: Setup
init: pnpm install && pnpm turbo build --no-daemon --go-fallback && gp sync-done setup
init: pnpm install && pnpm turbo build gp sync-done setup
env:
NETLIFY_URL: http://localhost:8000
DRUPAL_EXTERNAL_URL: http://localhost:8888
Expand Down
2 changes: 1 addition & 1 deletion .idea/prettier.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ apps
packages
tests
.turbo
pnpm-lock.yaml
2 changes: 2 additions & 0 deletions apps/cms/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
config/sync
composer.lock
8 changes: 4 additions & 4 deletions apps/cms/scaffold/all.services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
# To activate this feature, follow the instructions at the top of the
# 'example.settings.local.php' file, which sits next to this file.
parameters:
# Configure Cross-Site HTTP requests (CORS).
# Read https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS
# for more information about the topic in general.
# Note: By default the configuration is disabled.
# Configure Cross-Site HTTP requests (CORS).
# Read https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS
# for more information about the topic in general.
# Note: By default the configuration is disabled.
cors.config:
enabled: true
# Specify allowed headers, like 'x-allowed-header'.
Expand Down
7 changes: 5 additions & 2 deletions apps/website/netlify/functions/github-proxy.mts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ export default function (request: Request, context: Context) {
if (!process.env.DECAP_GITHUB_TOKEN) {
throw new Error('Missing environment variable DECAP_GITHUB_TOKEN.');
}
return githubProxy(request, process.env.DECAP_GITHUB_TOKEN, '/.netlify/functions/github-proxy');
return githubProxy(
request,
process.env.DECAP_GITHUB_TOKEN,
'/.netlify/functions/github-proxy',
);
}

11 changes: 4 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
version: '2.3'

x-volumes:
&default-volumes
# Define all volumes you would like to have real-time mounted into the docker containers
&default-volumes # Define all volumes you would like to have real-time mounted into the docker containers
volumes:
- ./packages/drupal:/app/web/modules/custom:delegated
- ./apps/cms:/app:delegated

x-environment:
&default-environment
x-environment: &default-environment
LAGOON_PROJECT: &lagoon-project ${COMPOSE_PROJECT_NAME:-slbtemplate}
# Route that should be used locally, if you are using pygmy, this route *must* end with .docker.amazee.io
LAGOON_ROUTE: &default-url http://${COMPOSE_PROJECT_NAME:-slbtemplate}.docker.amazee.io
Expand All @@ -17,8 +15,7 @@ x-environment:
# See example.docker-compose.override.yml for XDEBUG_ENABLE option

x-user:
&default-user
# The default user under which the containers should run. Change this if you are on linux and run with another user than id `1000`
&default-user # The default user under which the containers should run. Change this if you are on linux and run with another user than id `1000`
user: '1000'

services:
Expand Down Expand Up @@ -58,7 +55,7 @@ services:
depends_on:
- cli # basically just tells docker-compose to build the cli first
environment:
<< : *default-environment # loads the defined environment variables from the top
<<: *default-environment # loads the defined environment variables from the top
networks:
- amazeeio-network
- default
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"tb": "pnpm turbo --filter @custom/website",
"test:format": "pnpm test:format:root --check && pnpm test:format:workspaces --check",
"test:format:fix": "pnpm test:format:root --write && pnpm test:format:workspaces --write",
"test:format:root": "pnpm prettier '**/*.{js,cjs,mjs,ts,jsx,tsx,gql,graphql,graphqls,md,mdx,json,htm,html}' --ignore-path='./.prettierignore'",
"test:format:workspaces": "pnpm --workspace-concurrency=1 -r exec prettier '**/*.{js,cjs,mjs,ts,jsx,tsx,gql,graphql,graphqls,md,mdx,json,htm,html}' --ignore-path='./.gitignore'",
"test:format:root": "pnpm prettier --ignore-unknown '**/**'",
"test:format:workspaces": "pnpm --workspace-concurrency=1 -r exec prettier --ignore-unknown '**/**'",
"turbo:local": "if [ -z $CI ]; then echo $(date)$RANDOM > apps/cms/turbo-seed.txt; fi",
"turbo:test": "pnpm turbo:local && pnpm tb test:unit --no-daemon --go-fallback --output-logs=new-only && pnpm tb test:integration --no-daemon --go-fallback --output-logs=new-only --concurrency=1",
"turbo:test:force": "pnpm tb test:unit --no-daemon --go-fallback --output-logs=new-only --force && pnpm tb test:integration --no-daemon --go-fallback --output-logs=new-only --concurrency=1 --force",
Expand All @@ -38,7 +38,7 @@
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-simple-import-sort": "^10.0.0",
"husky": "^8.0.3",
"prettier": "^3.1.1",
"prettier": "^3.2.5",
"turbo": "^1.11.2",
"typescript": "^5.3.3",
"vitest": "^1.1.1"
Expand Down
6 changes: 3 additions & 3 deletions packages/drupal/gutenberg_blocks/css/edit.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* We can put any editor specific styling in here */
.gutenberg__editor .editor-styles-wrapper {
font-family:inherit;
font-family: inherit;
}

.gutenberg__editor blockquote {
margin:0;
margin: 0;
}

.gutenberg__editor blockquote .quote-image img {
Expand Down Expand Up @@ -40,4 +40,4 @@
left: 0;
transform-origin: 0 0;
transform: rotate(90deg);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ theme-support:
typography:
dropCap: false
libraries-edit:
- gutenberg_blocks/edit
- gutenberg_blocks/edit
2 changes: 1 addition & 1 deletion packages/drupal/gutenberg_blocks/gutenberg_blocks.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ package: Custom
core_version_requirement: ^9 || ^10
dependencies:
- gutenberg:gutenberg
- silverback_gutenberg:silverback_gutenberg
- silverback_gutenberg:silverback_gutenberg
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ customisations:
/gutenberg.css: { preprocess: false }
dependencies:
- core/drupalSettings

2 changes: 2 additions & 0 deletions packages/drupal/test_content/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
content
webforms
2 changes: 1 addition & 1 deletion packages/schema/src/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ type Hero {
}

union PageContent @resolveEditorBlockType =
BlockMarkup
| BlockMarkup
| BlockMedia
| BlockForm
| BlockImageTeasers
Expand Down
5 changes: 3 additions & 2 deletions packages/ui/src/components/Atoms/Container.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@
}

.nested-container .container-page:first-child .container-text,
.nested-container .container-page:first-child .container-text *:first-child{
.nested-container .container-page:first-child .container-text *:first-child {
@apply mt-0;
}
.nested-container .container-page:last-child .container-text,
.nested-container .container-page:last-child .container-text *:last-child {
@apply mb-0;
}

.container-nested .prose ul:not(ul ul), .container-nested .prose ol:not(ol ol) {
.container-nested .prose ul:not(ul ul),
.container-nested .prose ol:not(ol ol) {
@apply mt-0;
}
2 changes: 0 additions & 2 deletions packages/ui/src/components/Molecules/Breadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import { useBreadcrumbs } from '../Routes/Menu';
export function BreadCrumbs({ className }: { className?: string }) {
const breadcrumbs = useBreadcrumbs();

console.log('breadcrumbs:', breadcrumbs);

if (!breadcrumbs.length) {
return null;
}
Expand Down
15 changes: 15 additions & 0 deletions packages/ui/src/components/Organisms/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ export function Header() {
</Link>
) : (
<DesktopMenuDropDown title={item.title} key={item.title}>
<Link
key={item.target}
href={item.target}
className="m-1.5 block hover:text-blue-600 p-2 text-sm leading-[1.25rem] text-gray-900 font-bold"
>
{item.title}
</Link>
{item.children.map((child) =>
child.children.length === 0 ? (
<Link
Expand Down Expand Up @@ -126,6 +133,14 @@ export function Header() {
key={item.title}
nestLevel={1}
>
<Link
key={item.target}
href={item.target}
title={item.title}
className="block hover:text-blue-600 py-4 pr-8 pl-10 text-base text-gray-600"
>
{item.title}
</Link>
{item.children.map((child) =>
child.children.length === 0 ? (
<Link
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@ export function BlockMarkup(props: BlockMarkupFragment) {
<div
className={clsx([
'mx-auto max-w-3xl prose lg:prose-xl mt-10',
'prose-a:text-indigo-600',
'prose-em:text-indigo-600',
'prose-strong:text-indigo-600',
'marker:text-indigo-600 marker:font-bold',
'prose-h2:text-indigo-600 prose-h2:font-bold',
'marker:text-[#111928]',
'marker:font-bold',
])}
>
<Html
Expand All @@ -42,7 +39,7 @@ export function BlockMarkup(props: BlockMarkupFragment) {
className={clsx(className, { 'list-none relative': unordered })}
>
{unordered ? (
<ArrowRightCircleIcon className="not-prose w-6 h-6 absolute mt-1.5 left-[-1.5em] text-indigo-600" />
<ArrowRightCircleIcon className="not-prose w-6 h-6 absolute mt-1.5 left-[-1.5em] text-gray-900" />
) : null}
{children}
</li>
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/Organisms/PageDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function PageDisplay(page: PageFragment) {
<PageTransition>
<div>
{page.hero && <PageHero {...page.hero} />}
<div className="bg-white pt-5 pb-12 lg:px-8">
<div className="bg-white pt-5 pb-12 px-6 lg:px-8">
<BreadCrumbs className="mx-auto max-w-3xl" />
<div className="mx-auto max-w-3xl text-base leading-7 text-gray-700">
{page?.content?.filter(isTruthy).map((block, index) => {
Expand Down
Loading
Loading