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

LWS-244: Filter sort #1103

Merged
merged 10 commits into from
Sep 19, 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
17 changes: 17 additions & 0 deletions lxl-web/package-lock.json

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

2 changes: 2 additions & 0 deletions lxl-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@sveltejs/vite-plugin-svelte": "^3.1.1",
"@types/eslint": "^9.6.0",
"@types/jmespath": "^0.15.2",
"@types/js-cookie": "^3.0.6",
"autoprefixer": "^10.4.20",
"cssnano": "^7.0.5",
"eslint": "^9.9.0",
Expand All @@ -42,6 +43,7 @@
"globals": "^15.9.0",
"husky": "^9.1.4",
"jmespath": "^0.16.0",
"js-cookie": "^3.0.5",
"lint-staged": "^15.2.9",
"lxljs": "file:../lxljs",
"magic-string": "^0.30.11",
Expand Down
9 changes: 8 additions & 1 deletion lxl-web/src/app.d.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
// See https://kit.svelte.dev/docs/types#app
// for information about these interfaces
import type { UserSettings } from '$lib/types/userSettings';
import type { DisplayUtil, VocabUtil } from '$lib/utils/xl';
import 'unplugin-icons/types/svelte';

declare global {
namespace App {
interface Error {
status?: string;
}
// interface Locals {}
interface Locals {
vocab: VocabUtil;
display: DisplayUtil;
userSettings: UserSettings;
}
interface PageData {
locale: import('$lib/i18n/locales').LocaleCode;
t: Awaited<ReturnType<typeof import('$lib/i18n').getTranslator>>;
userSettings: UserSettings;
}
interface PageState {
expandedInstances?: string[];
Expand Down
13 changes: 13 additions & 0 deletions lxl-web/src/hooks.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { DisplayUtil, VocabUtil } from '$lib/utils/xl';
import fs from 'fs';
import { DERIVED_LENSES } from '$lib/types/display';
import displayWeb from '$lib/assets/json/display-web.json';
import type { UserSettings } from '$lib/types/userSettings';

let utilCache;

Expand All @@ -12,6 +13,18 @@ export const handle = async ({ event, resolve }) => {
event.locals.vocab = vocabUtil;
event.locals.display = displayUtil;

// Get the settings cookie
let userSettings: UserSettings;
const settingsCookie = event.cookies.get('userSettings');
if (settingsCookie) {
try {
userSettings = JSON.parse(settingsCookie);
} catch (e) {
console.warn('Failed to parse user settings', e);
}
}
event.locals.userSettings = userSettings;

// set HTML lang
// https://github.com/sveltejs/kit/issues/3091#issuecomment-1112589090
const path = event.url.pathname;
Expand Down
4 changes: 2 additions & 2 deletions lxl-web/src/lib/assets/json/display-web.json
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@
"@type": "fresnel:Format",
"fresnel:classFormatDomain": ["Contribution"],
"fresnel:propertyFormatDomain": ["role"],
"fresnel:propertyStyle": ["secondary", "small"],
"fresnel:propertyStyle": ["text-secondary", "text-sm"],
"fresnel:propertyFormat": {
"fresnel:contentBefore": " (",
"fresnel:contentFirst": "(",
Expand Down Expand Up @@ -671,7 +671,7 @@
"@type": "fresnel:Format",
"fresnel:classFormatDomain": ["Collection"],
"fresnel:propertyFormatDomain": ["sigel"],
"fresnel:propertyStyle": ["secondary", "small"],
"fresnel:propertyStyle": ["text-secondary", "text-sm"],
"fresnel:propertyFormat": {
"fresnel:contentBefore": " (",
"fresnel:contentFirst": "(",
Expand Down
8 changes: 0 additions & 8 deletions lxl-web/src/lib/components/DecoratedData.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -264,14 +264,6 @@
@apply underline decoration-dotted;
}

.small {
@apply text-sm;
}

.secondary {
@apply text-secondary;
}

.pill {
@apply mb-1 mr-1 inline-block rounded-full bg-pill/8 px-3 py-1 no-underline;
}
Expand Down
Loading
Loading