Skip to content

Commit

Permalink
Merge branch 'saved-projects' into last-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lillijo committed Jul 3, 2024
2 parents 50e7f31 + 8014e75 commit 5ef57a8
Show file tree
Hide file tree
Showing 55 changed files with 617 additions and 377 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: '⚠️‼️ deploy_prod → rundgang.udk-berlin.de'

on:
#push:
# branches: [ main ]
workflow_dispatch:
inputs:
ref:
description: The branch, tag or SHA to checkout
required: true
default: 'main'

jobs:
deploy_prod:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
ref: ${{github.event.inputs.ref}}

- name: Sync files to remote host
uses: up9cloud/[email protected]
env:
HOST: rundgang.udk-berlin.de
KEY: ${{secrets.SSH_RUNDGANG_UDK_BERLIN_DE}}
TARGET: /opt/rundgang-website-2024/
VERBOSE: true
USER: root
PORT: 22
ARGS: --recursive --update --delete --compress --exclude=/.env --exclude=/.git/ --exclude=/public/fonts/
SSH_ARGS: '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
SOURCE: .

- name: Restart rundgang-website-2024 service
uses: fifsky/[email protected]
with:
command: |
cd /opt/rundgang-website-2024/
npm clean-install
npm run build
systemctl restart rundgang-website-2024.service
host: rundgang.udk-berlin.de
user: root
key: ${{secrets.SSH_RUNDGANG_UDK_BERLIN_DE}}
2 changes: 1 addition & 1 deletion locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"rooms": "Räume",
"level": "Etage",
"room": "Raum",
"all": "alle"
"all": "Alle"
},
"RootLayout": {
"title": "Rundgang – Tage der offenen Tür 2024 UdK Berlin",
Expand Down
6 changes: 3 additions & 3 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"description": "Map of the locations for the Rundgang – Open Days 2024 UdK Berlin",
"levels": "Levels",
"rooms": "Rooms",
"level": "level",
"room": "room",
"all": "all"
"level": "Level",
"room": "Room",
"all": "All"
},
"RootLayout": {
"title": "Rundgang – Open Days 2024 UdK Berlin",
Expand Down
16 changes: 12 additions & 4 deletions src/api/graphql/filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,10 @@ export const getExistingGraphQLFilters = cache(
async (
items: Item[],
searchParams: { [key: string]: string | string[] | undefined },
returnOnlyExisting: boolean = false,
) => {
return getGraphQLFilters().then((filters) =>
filterExisting(items, filters, searchParams),
filterExisting(items, filters, searchParams, returnOnlyExisting),
);
},
);
Expand All @@ -101,6 +102,7 @@ function filterExisting(
items: Item[],
filters: Filters,
searchParams: { [key: string]: string | string[] | undefined },
returnOnlyExisting: boolean = false,
) {
let filteredFormats = filters.formats.map((format: Filter) => ({
...format,
Expand Down Expand Up @@ -130,8 +132,14 @@ function filterExisting(
}));

return {
formats: filteredFormats,
faculties: filteredFaculties,
languages: filteredLanguages,
formats: returnOnlyExisting
? filteredFormats.filter((f) => f.exists)
: filteredFormats,
faculties: returnOnlyExisting
? filteredFaculties.filter((f) => f.exists)
: filteredFaculties,
languages: returnOnlyExisting
? filteredLanguages.filter((f) => f.exists)
: filteredLanguages,
};
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Filter, ReactNodeProps } from '@/types/types';
import ContextTagLink from '@/components/contextTag/link';
import ContextTag from '@/components/contextTag/contextTag.server';

export type FilterGroupProps = {
filters: Filter[];
Expand All @@ -9,7 +9,7 @@ export default function LandingFiltersGroup({ filters }: FilterGroupProps) {
return (
<LandingFiltersGroupContainer>
{filters.map((filter) => (
<ContextTagLink key={filter.id} context={filter} />
<ContextTag key={filter.id} type="link" context={filter} />
))}
</LandingFiltersGroupContainer>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { getGraphQLFilters } from '@/api/graphql/filters';
import { getExistingGraphQLFilters } from '@/api/graphql/filters';
import LandingFiltersGroup from '@/app/(landing)/components/desktop/filters/groups/group.server';
import { getFilteredGraphQLItems } from '@/api/graphql/items';

const keys: ('formats' | 'faculties' | 'languages')[] = [
'formats',
Expand All @@ -8,11 +9,12 @@ const keys: ('formats' | 'faculties' | 'languages')[] = [
];

export default async function LandingFiltersGroupsSuspend() {
const filters = await getGraphQLFilters();
const items = await getFilteredGraphQLItems({});
const contextGroups = await getExistingGraphQLFilters(items, {}, true);
return (
<>
{keys.map((key) => (
<LandingFiltersGroup key={key} filters={filters[key]} />
<LandingFiltersGroup key={key} filters={contextGroups[key]} />
))}
</>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Filter, ReactNodeProps } from '@/types/types';
import { useTranslations } from 'next-intl';
import ContextTagLink from '@/components/contextTag/link';
import ContextTag from '@/components/contextTag/contextTag.server';

export type FilterGroupProps = {
translationKey: 'format' | 'faculty' | 'language';
Expand All @@ -18,7 +19,7 @@ export default function LandingFiltersGroup({
{t(translationKey, { count: 2 })}
</div>
{filters.map((filter) => (
<ContextTagLink key={filter.id} context={filter} />
<ContextTag key={filter.id} type="link" context={filter} />
))}
</LandingFiltersGroupContainer>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { getGraphQLFilters } from '@/api/graphql/filters';
import { getExistingGraphQLFilters } from '@/api/graphql/filters';
import LandingFiltersGroup from '@/app/(landing)/components/mobile/filters/groups/group.server';
import { getFilteredGraphQLItems } from '@/api/graphql/items';

const fetchers: {
translationKey: 'format' | 'faculty' | 'language';
Expand All @@ -11,14 +12,15 @@ const fetchers: {
];

export default async function LandingFiltersGroups() {
const filters = await getGraphQLFilters();
const items = await getFilteredGraphQLItems({});
const contextGroups = await getExistingGraphQLFilters(items, {}, true);
return (
<>
{fetchers.map((fetcher) => (
<LandingFiltersGroup
key={fetcher.translationKey}
translationKey={fetcher.translationKey}
filters={filters[fetcher.filtersKey]}
filters={contextGroups[fetcher.filtersKey]}
/>
))}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function LandingProjectHandwriting({
return (
<LandingProjectHandwritingContainer>
<Image
className="h-[80%] w-auto dark:invert"
className="pointer-events-none h-[80%] w-auto dark:invert"
src={`/assets/projects/${language}/mobile.png`}
width={1207}
height={587}
Expand All @@ -24,8 +24,8 @@ function LandingProjectHandwritingContainer({
children: ReactNode;
}) {
return (
<div className="absolute bottom-0 left-0 right-0 top-0">
<div className="flex h-full w-full items-center justify-center">
<div className="pointer-events-none absolute bottom-0 left-0 right-0 top-0">
<div className="pointer-events-none flex h-full w-full items-center justify-center">
{children}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
'use client';
import { ReactNodeProps } from '@/types/types';
import { useSidebarStore } from '@/lib/sidebareStore';
import { useShallow } from 'zustand/react/shallow';
import cx from 'classnames';
import { useLandingSidebarStore } from '@/lib/stores/sidebar/landing';

export default function SidebarContainer({ children }: ReactNodeProps) {
const [isOpen] = useSidebarStore(useShallow((state) => [state.isOpen]));
const [isOpen] = useLandingSidebarStore(
useShallow((state) => [state.isOpen]),
);
return (
<div
className={cx(
'fixed grid w-[166.66vw] grid-cols-5 bg-primary transition-[left] duration-700',
isOpen ? 'left-[-66.66vw]' : 'left-[0vw]',
isOpen ? 'left-[calc(-66.66vw+1px)]' : 'left-[0vw]',
)}
>
{children}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import ArrowRight from '@/components/icons/arrowRight';
import { cn } from '@/lib/utils';
import { ReactNodeProps } from '@/types/types';
import { useShallow } from 'zustand/react/shallow';
import { useSidebarStore } from '@/lib/sidebareStore';
import { useLandingSidebarStore } from '@/lib/stores/sidebar/landing';

export default function SidebarToggle() {
const [isOpen, toggleIsOpen] = useSidebarStore(
const [isOpen, toggleIsOpen] = useLandingSidebarStore(
useShallow((state) => [state.isOpen, state.toggleIsOpen]),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function DesignContentOpenSidebar() {
<DesignContentOpenSidebarContainer onClick={onClick}>
<div
className={cn(
'transition-transform duration-700',
'fill-secondary transition-transform duration-700',
sidebarIsOpen ? 'rotate-0' : 'rotate-180',
)}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ export default function DesignContentProjectFilters({ project }) {
/>
<DesignContentProjectFilter
title={t('language', { count: 1 })}
value={ISO6391.getNativeName(project.language.iso_639_1_code)}
value={
project.language.nativeName
? project.language.nativeName
: ISO6391.getNativeName(project.language.iso_639_1_code)
}
/>
</DesignContentProjectFiltersContainer>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function DesignContentProjectsContainer({ children }: HtmlProps) {
return (
<div>
<div className="hidden h-content-header max-h-content-header min-h-content-header md:block" />
<div className="scrollable md:border-r-xs md:border-t-xs col-span-4 grid h-content max-h-content min-h-content grid-cols-1 gap-border overflow-y-auto border-border border-y-0 bg-primary md:h-content-body md:max-h-content-body md:min-h-content-body md:grid-cols-4">
<div className="scrollable col-span-4 grid h-content max-h-content min-h-content grid-cols-1 gap-border overflow-y-auto border-border border-y-0 bg-primary md:h-content-body md:max-h-content-body md:min-h-content-body md:grid-cols-4 md:border-r-xs md:border-t-xs">
{children}
</div>
</div>
Expand Down
28 changes: 15 additions & 13 deletions src/app/[locale]/locations/[[...slug]]/components/place.server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,21 @@ export default async function Place({ place }: PlaceProps) {
<div className="pointer-events-none relative z-40 col-span-3 h-fit pr-0 sm:h-content sm:overflow-y-scroll sm:overscroll-y-contain">
<div className="bg-transparent pointer-events-none h-[50dvh] border-r-xs "></div>
<Suspense>
<div className="min-h-[calc(50dvh - var(--header-height) - var(--footer-height))] pointer-events-auto relative max-h-fit items-start rounded-md border-border border-primary bg-secondary sm:grid sm:min-h-place sm:grid-cols-2 sm:border-r-0 sm:border-t-border">
<Subnavigation location={location} />
{location.image != 'simple' && <Floorplan location={location} />}
<Link href="/locations" scroll={false}>
<SmoothButton
className="absolute right-2 top-0 p-2"
top
color="primary"
>
<Cross color="secondary" className="rotate-45 p-gutter-sm" />
</SmoothButton>
</Link>
</div>
<div className="bg-primary">
<div className="min-h-[calc(50dvh - var(--header-height) - var(--footer-height))] pointer-events-auto relative max-h-fit items-start rounded-md border-border border-primary bg-secondary sm:grid sm:min-h-place sm:grid-cols-2 sm:border-r-0 sm:border-t-border">
<Subnavigation location={location} />
{location.image != 'simple' && <Floorplan location={location} />}
<Link href="/locations" scroll={false}>
<SmoothButton
className="absolute right-2 top-0 p-2"
top
color="primary"
>
<Cross color="secondary" className="rotate-45 p-gutter-sm" />
</SmoothButton>
</Link>
</div>
</div>
</Suspense>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import cx from 'classnames';
import { Link } from '@/navigation';
import TagPlain from '@/components/tag/plain.server';

export type SubLocationTagProps = {
sublocation: { name: string; id: string };
Expand All @@ -21,16 +21,16 @@ export default function SubLocationTag({
className="cursor-pointer pl-1 pt-1"
scroll={false}
>
<div
className={cx(
'relative w-fit rounded-md border-white px-[13px] py-[8px] text-xxs ring-2 ring-primary',
<TagPlain
className={
isSelected
? 'bg-highlight text-black'
: 'bg-secondary text-primary hover:bg-highlight hover:text-black',
)}
>
{prefix} {sublocation.name}
</div>
? '!bg-highlight text-black'
: 'hover:bg-highlight hover:text-black'
}
prefix={prefix}
title={sublocation.name}
withBorder
/>
</Link>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default async function Page({ params }: PageProps) {
function PageContainer({ children }: ReactNodeProps) {
return (
<div className="order-1 col-span-3 w-full md:order-3 md:col-span-1">
<div className="fixed mt-content-header h-content-body max-h-content-body min-h-content-body w-[100vw] overflow-y-auto border-x-border bg-primary md:w-[40vw] md:border-x-0">
<div className="fixed mt-content-header h-content-body max-h-content-body min-h-content-body w-[100vw] overflow-y-auto border-l-border bg-primary md:w-[40vw] md:border-l-0">
{children}
</div>
</div>
Expand Down

This file was deleted.

Loading

0 comments on commit 5ef57a8

Please sign in to comment.