diff --git a/src/app.css b/src/app.css index 406273b8..d1219c1d 100644 --- a/src/app.css +++ b/src/app.css @@ -31,7 +31,11 @@ body { overflow-x: hidden; margin: 0; - font-family: -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif; + font-family: + -apple-system, + BlinkMacSystemFont, + Segoe UI, + sans-serif; line-height: 1.5; /* https://modern-fluid-typography.vercel.app */ font-size: clamp(1rem, 0.5vw + 1rem, 1.2rem); diff --git a/src/app.html b/src/app.html index dc9e04e1..9a2e528c 100644 --- a/src/app.html +++ b/src/app.html @@ -1,4 +1,4 @@ - + diff --git a/src/lib/azure.ts b/src/lib/azure.ts index 45be0818..a3cf7a3c 100644 --- a/src/lib/azure.ts +++ b/src/lib/azure.ts @@ -13,7 +13,7 @@ const to_str = (str: unknown) => (str ? String(str) : undefined) async function azure_post_new_records( base_id: string, table_id: string, - data: { [key: string]: unknown } + data: { [key: string]: unknown }, ) { const response = await fetch(azure_url(base_id, table_id), { method: `POST`, @@ -29,7 +29,7 @@ async function azure_post_new_records( export async function prepare_signup_data_for_azure( data: SignupStore, chapter_base_id: string, - test = false + test = false, ): Promise { const table = data.type.value === `student` ? `Studenten` : `Schüler` @@ -109,7 +109,7 @@ export async function prepare_signup_data_for_azure( export async function signup_form_submit_handler( fields_to_validate: (keyof SignupStore)[], chapters: Chapter[], - err_msg: Record + err_msg: Record, ): Promise<{ error?: Error; success?: boolean }> { // handles form validation and Plausible event reporting const signup_data = get(signup_store) diff --git a/src/lib/fetch.ts b/src/lib/fetch.ts index 2878d001..fde7815b 100644 --- a/src/lib/fetch.ts +++ b/src/lib/fetch.ts @@ -11,7 +11,7 @@ const prefixSlug = (prefix: string) => (obj: Page | Post) => { export async function airtable_fetch( query: string, - options = {} + options = {}, ): Promise> { const apiKey = import.meta.env.VITE_AIRTABLE_CHAPTER_BASE_APP_ID @@ -24,7 +24,7 @@ export async function airtable_fetch( headers: { 'Content-Type': `application/json` }, body: JSON.stringify({ query }), ...options, - } + }, ) const { data, error } = await response.json() @@ -81,7 +81,7 @@ export async function fetch_chapters(): Promise { export async function base64_thumbnail( url: string, - options?: { type?: string; w?: number; h?: number } + options?: { type?: string; w?: number; h?: number }, ): Promise { const { type = `jpg`, w = 10, h = 10 } = options ?? {} @@ -262,7 +262,7 @@ function title_to_slug(itm: Record & { title: string }) { export async function fetch_yaml_list( title: string, - slugPrefix: string + slugPrefix: string, ): Promise[]> { const list = await fetch_yaml(title) return list.map(parse_body).map(title_to_slug).map(prefixSlug(slugPrefix)) diff --git a/src/lib/stores.ts b/src/lib/stores.ts index 51015c40..47100915 100644 --- a/src/lib/stores.ts +++ b/src/lib/stores.ts @@ -9,16 +9,16 @@ export const colorModeKey = `color-mode` type ColorMode = `light` | `dark` | `system` export const colorMode = writable( - (has_local_store && localStorage[colorModeKey]) || `system` + (has_local_store && localStorage[colorModeKey]) || `system`, ) colorMode.subscribe( - (val: ColorMode) => has_local_store && (localStorage[colorModeKey] = val) + (val: ColorMode) => has_local_store && (localStorage[colorModeKey] = val), ) export const signupStore = session_store( `SignupStore`, - {} as SignupStore + {} as SignupStore, ) export const microcopy = writable({}) diff --git a/src/routes/+layout.ts b/src/routes/+layout.ts index 76d75e7c..b878a96b 100644 --- a/src/routes/+layout.ts +++ b/src/routes/+layout.ts @@ -8,7 +8,7 @@ export const load = async () => { const social = await fetch_yaml(`Social`) // don't show partner orgs in nav const chapters = (await fetch_chapters()).filter( - (chap) => chap.status != `partner` + (chap) => chap.status != `partner`, ) const smallTexts = await fetch_yaml(`smallTexts`) microcopy.set(smallTexts) diff --git a/src/routes/+page.server.ts b/src/routes/+page.server.ts index 993726fd..4aaf3070 100644 --- a/src/routes/+page.server.ts +++ b/src/routes/+page.server.ts @@ -1,20 +1,8 @@ import { fetch_chapters, fetch_page } from '$lib/fetch' -import type { PageServerLoad } from './$types' export const load = async () => { return { page: fetch_page(`/`), chapters: fetch_chapters(), - // ...airtable_fetch( - // `{ - // students: studentenStatistiken { - // id - // } - // pupils: schuelerStatistiken { - // id - // } - // }`, - // { cache: `force-cache` } - // ), } } diff --git a/src/utils/contentful.js b/src/utils/contentful.js index b8dc5d6a..e5470410 100644 --- a/src/utils/contentful.js +++ b/src/utils/contentful.js @@ -45,12 +45,12 @@ export async function search_string_in_content_type(args) { const env = await space.getEnvironment(`master`) let { items } = await env.getEntries({ content_type: contentType }) items = items.filter((item) => - item?.fields[field][locale]?.includes(searchTerm) + item?.fields[field][locale]?.includes(searchTerm), ) items = items.map((item) => item.fields.slug[locale]) console.log( `'${contentType}' entries containing '${searchTerm}' in field '${field}.${locale}':`, - items + items, ) } catch (error) { console.error(error) @@ -103,16 +103,16 @@ export async function replace_string_in_content_type(args) { itm.fields[field][locale] = itm?.fields[field][locale]?.replaceAll( searchTerm, - replaceTerm + replaceTerm, ) if (dryRun) { console.log( - `new ${field}.${locale} of ${contentType} ${itm?.fields?.title.de} after replacement: ${itm.fields[field][locale]}` + `new ${field}.${locale} of ${contentType} ${itm?.fields?.title.de} after replacement: ${itm.fields[field][locale]}`, ) } else { await itm.update() console.log( - `performed replacement in ${contentType} ${itm?.fields?.title.de}` + `performed replacement in ${contentType} ${itm?.fields?.title.de}`, ) // await itm.publish() } diff --git a/src/utils/deeplTranslate.js b/src/utils/deeplTranslate.js index 9cefe402..928b14cf 100644 --- a/src/utils/deeplTranslate.js +++ b/src/utils/deeplTranslate.js @@ -49,7 +49,7 @@ async function translateContentfulEntries() { const title = itm.fields.title[sourceLocale] // eslint-disable-next-line no-console console.log( - `successfully translated ${contentType} '${title}' to ${targetLocale}` + `successfully translated ${contentType} '${title}' to ${targetLocale}`, ) } } catch (error) { diff --git a/src/utils/googleTranslate.js b/src/utils/googleTranslate.js index 627f281d..a1622252 100644 --- a/src/utils/googleTranslate.js +++ b/src/utils/googleTranslate.js @@ -46,7 +46,7 @@ async function translateContentfulEntries() { const title = itm.fields.title[sourceLocale] // eslint-disable-next-line no-console console.log( - `successfully translated ${contentType} '${title}' to ${targetLocale}` + `successfully translated ${contentType} '${title}' to ${targetLocale}`, ) } } catch (error) { diff --git a/tests/helpers.ts b/tests/helpers.ts index 928b3376..01078c03 100644 --- a/tests/helpers.ts +++ b/tests/helpers.ts @@ -3,7 +3,7 @@ import type { Page } from '@playwright/test' export async function fill_select( page: Page, selector: string, - values: string[] + values: string[], ) { for (const value of values) { await page.fill(selector, value) diff --git a/tests/pupil-form.test.ts b/tests/pupil-form.test.ts index 8532e647..7bf451d2 100644 --- a/tests/pupil-form.test.ts +++ b/tests/pupil-form.test.ts @@ -34,7 +34,7 @@ test(`pupil signup form can be submitted after filling all required fields`, asy await page.fill( `#emailContact`, - `florian.kleinicke@studenten-bilden-schueler.de` + `florian.kleinicke@studenten-bilden-schueler.de`, ) await page.fill(`#orgContact`, `Privat`)