Skip to content

Commit

Permalink
fix: clean up, fix a11y, align tests with template
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanprobst committed Jun 16, 2024
1 parent ba004df commit 485439c
Show file tree
Hide file tree
Showing 80 changed files with 9,072 additions and 6,446 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
node_modules/
.pnpm-store/

# generated libs
/lib/*

# logs
*.log

Expand Down
1 change: 1 addition & 0 deletions .env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ NUXT_PUBLIC_API_BASE_URL="https://frischmuth-dev.acdh-dev.oeaw.ac.at"
# -------------------------------------------------------------------------------------------------
# analytics
# -------------------------------------------------------------------------------------------------
# NUXT_PUBLIC_GOOGLE_SITE_VERIFICATION=
NUXT_PUBLIC_MATOMO_BASE_URL="https://matomo.acdh.oeaw.ac.at"
# NUXT_PUBLIC_MATOMO_ID=
11 changes: 9 additions & 2 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:

jobs:
env:
name: Generate environment variables
runs-on: ubuntu-latest
steps:
- name: Derive environment from git ref
Expand Down Expand Up @@ -37,6 +38,7 @@ jobs:
image: ${{ github.repository }}

vars:
name: Generate public url
needs: [env]
runs-on: ubuntu-latest
environment:
Expand All @@ -56,11 +58,14 @@ jobs:
public_url: ${{ steps.public_url.outputs.PUBLIC_URL }}

build:
name: Build and push docker image
needs: [env, vars]
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
environment:
name: "${{ needs.env.outputs.environment }}"

steps:
- name: Checkout repository
Expand Down Expand Up @@ -97,17 +102,19 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
"NUXT_PUBLIC_APP_BASE_URL=${{ needs.vars.outputs.public_url }}"
"NUXT_PUBLIC_API_BASE_URL=${{ vars.NUXT_PUBLIC_API_BASE_URL }}"
"NUXT_PUBLIC_APP_BASE_URL=${{ needs.vars.outputs.public_url }}"
"NUXT_PUBLIC_GOOGLE_SITE_VERIFICATION=${{ vars.NUXT_PUBLIC_GOOGLE_SITE_VERIFICATION }}"
"NUXT_PUBLIC_MATOMO_BASE_URL=${{ vars.NUXT_PUBLIC_MATOMO_BASE_URL }}"
"NUXT_PUBLIC_MATOMO_ID=${{ vars.NUXT_PUBLIC_MATOMO_ID }}"
"NUXT_PUBLIC_REDMINE_ID=${{ vars.SERVICE_ID }}"
cache-from: type=gha
cache-to: type=gha,mode=max

deploy:
name: Deploy docker image
needs: [env, vars, build]
uses: acdh-oeaw/gl-autodevops-minimal-port/.github/workflows/deploy-cluster-2.yml@main
uses: acdh-oeaw/gl-autodevops-minimal-port/.github/workflows/deploy.yml@main
secrets: inherit
with:
environment: ${{ needs.env.outputs.environment }}
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ concurrency:
cancel-in-progress: true

on:
workflow_dispatch:
pull_request:
branches:
- main
Expand Down Expand Up @@ -33,7 +34,7 @@ jobs:
# Necessary because `actions/setup-node` does not yet support `corepack`.
# @see https://github.com/actions/setup-node/issues/531
- name: Install pnpm
uses: pnpm/action-setup@v3
uses: pnpm/action-setup@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
Expand Down Expand Up @@ -78,8 +79,8 @@ jobs:
- name: Build app
run: pnpm run build
env:
NUXT_PUBLIC_APP_BASE_URL: "http://localhost:3000"
NUXT_PUBLIC_API_BASE_URL: "${{vars.NUXT_PUBLIC_API_BASE_URL}}"
NUXT_PUBLIC_APP_BASE_URL: "http://localhost:3000"
NUXT_PUBLIC_REDMINE_ID: "${{ vars.SERVICE_ID }}"

- name: Run e2e tests
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
node_modules/
.pnpm-store/

#generated libs
lib/*
# generated libs
/lib/*

# logs
*.log
Expand Down
3 changes: 2 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
engine-strict=true
package-manager-strict=false
shell-emulator=true
use-node-version=20.11.0
use-node-version=20.14.0
2 changes: 1 addition & 1 deletion .vscode/app.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"",
"<template>",
"\t<MainContent class=\"container grid content-start gap-y-8 py-8\">",
"\t\t<PageTitle>{{ t(\"${1:Name}Page.title\") }}</PageTitle>",
"\t\t<h1>{{ t(\"${1:Name}Page.title\") }}</h1>",
"\t</MainContent>",
"</template>"
]
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ RUN sed -i "s/use-node-version/# use-node-version/" .npmrc
ARG NUXT_PUBLIC_API_BASE_URL
ARG NUXT_PUBLIC_APP_BASE_URL
ARG NUXT_PUBLIC_BOTS
ARG NUXT_PUBLIC_GOOGLE_SITE_VERIFICATION
ARG NUXT_PUBLIC_MATOMO_BASE_URL
ARG NUXT_PUBLIC_MATOMO_ID
ARG NUXT_PUBLIC_REDMINE_ID
Expand Down
16 changes: 9 additions & 7 deletions components/app-header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import type { NavLinkProps } from "@/components/nav-link.vue";
import { Separator } from "@/components/ui/separator";
const t = useTranslations();
const route = useRoute();
const homeLink = { href: { path: "/" } };
const links = computed(() => {
return {
Expand All @@ -18,21 +20,22 @@ const links = computed(() => {
<header class="border-b bg-frisch-marine">
<div class="w-full pb-4 pt-12">
<nav :aria-label="t('AppHeader.navigation-main')">
<ul class="container grid grid-cols-2 items-end" role="list">
<div class="container grid items-end gap-4 lg:grid-cols-2">
<div class="text-4xl font-semibold text-frisch-orange">
<NavLink :href="homeLink.href">
Digitales Archiv
<br aria-hidden="true" />
Barbara Frischmuth
</NavLink>
</div>
<div
<ul
:class="
route.path !== '/'
? 'opacity-100 translate-y-0'
: 'opacity-0 translate-y-5 pointer-events-none'
"
class="ml-auto flex gap-x-4 font-semibold transition"
class="ml-auto flex gap-x-4 font-bold transition"
role="list"
>
<li
v-for="(link, key, index) of links"
Expand All @@ -42,14 +45,13 @@ const links = computed(() => {
<Separator v-if="index > 0" class="h-full w-0.5 bg-frisch-orange" />
<NavLink
:href="link.href"
:class="route.path === `/${key}` ? 'text-frisch-indigo' : 'text-frisch-orange'"
class="hover:text-frisch-indigo"
class="text-frisch-orange transition hover:text-frisch-indigo aria-[current]:text-frisch-indigo"
>
{{ link.label }}
</NavLink>
</li>
</div>
</ul>
</ul>
</div>
</nav>
</div>
</header>
Expand Down
47 changes: 0 additions & 47 deletions components/route-announcer.vue

This file was deleted.

2 changes: 1 addition & 1 deletion components/search-data-table/data-table.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" setup>
import { type ColumnDef, FlexRender, getCoreRowModel, useVueTable } from "@tanstack/vue-table";
import {
Expand Down
2 changes: 1 addition & 1 deletion components/search-filter.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" setup>
const slider = { min: 1940, max: 2024 };
const sliderValue = ref([slider.min, slider.max]);
</script>
Expand Down
2 changes: 1 addition & 1 deletion components/search-form.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" setup>
export interface SearchFormData {
search: string;
}
Expand Down
2 changes: 1 addition & 1 deletion components/skip-link.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function onClick() {

<template>
<NuxtLink
class="fixed -translate-y-full rounded bg-white px-4 py-3 text-neutral-950 transition focus:translate-y-0"
class="fixed -translate-y-full rounded bg-background px-4 py-3 text-foreground transition focus:translate-y-0"
:href="{ hash: `#${props.targetId}` }"
@click="onClick"
>
Expand Down
2 changes: 1 addition & 1 deletion components/ui/button/Button.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" setup>
import { Primitive, type PrimitiveProps } from "radix-vue";
import type { HTMLAttributes } from "vue";
Expand Down
2 changes: 1 addition & 1 deletion components/ui/card/Card.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" setup>
import type { HTMLAttributes } from "vue";
import { cn } from "@/utils/styles";
Expand Down
2 changes: 1 addition & 1 deletion components/ui/card/CardContent.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" setup>
import type { HTMLAttributes } from "vue";
import { cn } from "@/utils/styles";
Expand Down
2 changes: 1 addition & 1 deletion components/ui/card/CardDescription.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" setup>
import type { HTMLAttributes } from "vue";
import { cn } from "@/utils/styles";
Expand Down
2 changes: 1 addition & 1 deletion components/ui/card/CardFooter.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" setup>
import type { HTMLAttributes } from "vue";
import { cn } from "@/utils/styles";
Expand Down
2 changes: 1 addition & 1 deletion components/ui/card/CardHeader.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" setup>
import type { HTMLAttributes } from "vue";
import { cn } from "@/utils/styles";
Expand Down
2 changes: 1 addition & 1 deletion components/ui/card/CardTitle.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" setup>
import type { HTMLAttributes } from "vue";
import { cn } from "@/utils/styles";
Expand Down
2 changes: 1 addition & 1 deletion components/ui/checkbox/Checkbox.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" setup>
import { CheckIcon } from "@radix-icons/vue";
import {
CheckboxIndicator,
Expand Down
2 changes: 1 addition & 1 deletion components/ui/input/Input.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" setup>
import { useVModel } from "@vueuse/core";
import type { HTMLAttributes } from "vue";
Expand Down
2 changes: 1 addition & 1 deletion components/ui/pagination/PaginationEllipsis.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" setup>
import { DotsHorizontalIcon } from "@radix-icons/vue";
import { PaginationEllipsis, type PaginationEllipsisProps } from "radix-vue";
import { computed, type HTMLAttributes } from "vue";
Expand Down
2 changes: 1 addition & 1 deletion components/ui/pagination/PaginationFirst.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" setup>
import { DoubleArrowLeftIcon } from "@radix-icons/vue";
import { PaginationFirst, type PaginationFirstProps } from "radix-vue";
import { computed, type HTMLAttributes } from "vue";
Expand Down
2 changes: 1 addition & 1 deletion components/ui/pagination/PaginationLast.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" setup>
import { DoubleArrowRightIcon } from "@radix-icons/vue";
import { PaginationLast, type PaginationLastProps } from "radix-vue";
import { computed, type HTMLAttributes } from "vue";
Expand Down
2 changes: 1 addition & 1 deletion components/ui/pagination/PaginationNext.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" setup>
import { ChevronRightIcon } from "@radix-icons/vue";
import { PaginationNext, type PaginationNextProps } from "radix-vue";
import { computed, type HTMLAttributes } from "vue";
Expand Down
2 changes: 1 addition & 1 deletion components/ui/pagination/PaginationPrev.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" setup>
import { ChevronLeftIcon } from "@radix-icons/vue";
import { PaginationPrev, type PaginationPrevProps } from "radix-vue";
import { computed, type HTMLAttributes } from "vue";
Expand Down
2 changes: 1 addition & 1 deletion components/ui/separator/Separator.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" setup>
import { Separator, type SeparatorProps } from "radix-vue";
import { computed, type HTMLAttributes } from "vue";
Expand Down
2 changes: 1 addition & 1 deletion components/ui/slider/Slider.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" setup>
import {
SliderRange,
SliderRoot,
Expand Down
2 changes: 1 addition & 1 deletion components/ui/table/Table.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" setup>
import type { HTMLAttributes } from "vue";
import { cn } from "@/utils/styles";
Expand Down
2 changes: 1 addition & 1 deletion components/ui/table/TableBody.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" setup>
import type { HTMLAttributes } from "vue";
import { cn } from "@/utils/styles";
Expand Down
2 changes: 1 addition & 1 deletion components/ui/table/TableCaption.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" setup>
import type { HTMLAttributes } from "vue";
import { cn } from "@/utils/styles";
Expand Down
2 changes: 1 addition & 1 deletion components/ui/table/TableCell.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" setup>
import type { HTMLAttributes } from "vue";
import { cn } from "@/utils/styles";
Expand Down
2 changes: 1 addition & 1 deletion components/ui/table/TableEmpty.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" setup>
import { computed, type HTMLAttributes } from "vue";
import { cn } from "@/utils/styles";
Expand Down
2 changes: 1 addition & 1 deletion components/ui/table/TableFooter.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" setup>
import type { HTMLAttributes } from "vue";
import { cn } from "@/utils/styles";
Expand Down
2 changes: 1 addition & 1 deletion components/ui/table/TableHead.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup lang="ts">
<script lang="ts" setup>
import type { HTMLAttributes } from "vue";
import { cn } from "@/utils/styles";
Expand Down
Loading

0 comments on commit 485439c

Please sign in to comment.