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

[ALS-5909] Landing Page in New UI #8

Merged
merged 5 commits into from
Mar 5, 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
14 changes: 7 additions & 7 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@ module.exports = {
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:svelte/recommended',
'prettier'
'prettier',
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
extraFileExtensions: ['.svelte']
extraFileExtensions: ['.svelte'],
},
env: {
browser: true,
es2017: true,
node: true
node: true,
},
overrides: [
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser'
}
}
]
parser: '@typescript-eslint/parser',
},
},
],
};
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"useTabs": false,
"singleQuote": true,
"trailingComma": "none",
"trailingComma": "all",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte"],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
Expand Down
33 changes: 17 additions & 16 deletions package-lock.json

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

11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
"playwright": "playwright test --ui"
},
"devDependencies": {
"@playwright/test": "^1.28.1",
"@playwright/test": "^1.42.0",
"@skeletonlabs/skeleton": "2.6.0",
"@skeletonlabs/tw-plugin": "0.3.0",
"@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/adapter-node": "^2.0.0",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/adapter-node": "^2.1.2",
"@sveltejs/kit": "^2.4.3",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"@tailwindcss/forms": "0.5.7",
"@tailwindcss/typography": "0.5.10",
Expand All @@ -37,10 +37,11 @@
"prettier-plugin-svelte": "^3.1.2",
"svelte": "^4.2.7",
"svelte-check": "^3.6.0",
"svelte-eslint-parser": "^0.33.1",
"tailwindcss": "3.3.6",
"tslib": "^2.4.1",
"typescript": "^5.0.0",
"vite": "^5.0.3",
"typescript": "^5.3.3",
"vite": "^5.0.12",
"vite-plugin-tailwind-purgecss": "0.2.0",
"vitest": "^1.0.0"
},
Expand Down
4 changes: 2 additions & 2 deletions pic-sure-theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,6 @@ export const picSureTheme: CustomThemeConfig = {
'--color-surface-600': '167 167 167', // #a7a7a7
'--color-surface-700': '140 140 140', // #8c8c8c
'--color-surface-800': '112 112 112', // #707070
'--color-surface-900': '91 91 91' // #5b5b5b
}
'--color-surface-900': '91 91 91', // #5b5b5b
},
};
4 changes: 2 additions & 2 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import type { PlaywrightTestConfig } from '@playwright/test';
const config: PlaywrightTestConfig = {
webServer: {
command: 'npm run build && npm run preview',
port: 4173
port: 4173,
},
testDir: 'tests',
testMatch: /(.+\.)?(test|spec)\.[jt]s/,
reporter: [['list'], ['html']]
reporter: [['list'], ['html']],
};

export default config;
4 changes: 2 additions & 2 deletions postcss.config.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {}
}
autoprefixer: {},
},
};
12 changes: 6 additions & 6 deletions src/lib/component/navigation.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
import logo from '$lib/assets/app-logo.png';

const routes = [
{ path: '/', id: 'home', text: 'Home' },
{ path: '/explorer', text: 'Query Builder' },
{ path: '/users', text: 'Users' },
{ path: '/api', text: 'API' },
{ path: '/dataset', text: 'Dataset Management' },
{ path: '/help', text: 'Help' },
{ path: '/admin', text: 'Admin' },
{ path: '/#', id: 'logout', text: 'Logout' }
{ path: '/admin/super', text: 'Super Admin' },
{ path: '/#', id: 'logout', text: 'Logout' },
];

function getId({ path, id }: { path: string; id?: string; text: string }) {
Expand All @@ -21,18 +21,18 @@

<AppBar padding="p-0">
<svelte:fragment slot="lead">
<img id="nav-logo" alt="PIC-Sure logo" src={logo} class="mx-1" />
<a href="/" aria-current="page"
><img id="nav-logo" alt="PIC-Sure logo" src={logo} class="mx-1" /></a
>
</svelte:fragment>
<svelte:fragment slot="trail">
<nav id="page-navigation">
{#each routes as route}
<a
id={getId(route)}
href={route.path}
aria-current={$page.url.pathname === route.path ? 'page' : undefined}
aria-current={$page.url.pathname === route.path ? 'page' : undefined}>{route.text}</a
>
{route.text}
</a>
{/each}
</nav>
</svelte:fragment>
Expand Down
44 changes: 44 additions & 0 deletions src/lib/configuration.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,48 @@
export const branding = {
landing: {
searchPlaceholder: 'Search terms or variables of interest…',
description:
'PIC-SURE can be used to search phenotypic variables and genomic variants, apply filters, build cohorts, and export participant-level data.',
actions: [
{
description: 'Explore data, apply filters, and build cohorts',
icon: 'fa-solid fa-magnifying-glass fa-5x',
url: '/explorer',
},
{
description: 'Manage Previously Saved Datasets',
icon: 'fa-solid fa-table-list fa-5x',
url: '/dataset',
},
{
description: 'Take a tour of the PIC-SURE API',
icon: 'fa-solid fa-route fa-5x',
url: '/explorer?tour=true',
},
{
description: 'Learn more about PIC‑SURE',
icon: 'fa-solid fa-circle-question fa-5x',
url: 'https://pic-sure.org/about',
},
],
stats: [
{
title: 'Data Sources',
value: '10',
valueSrc: undefined,
},
{
title: 'Variables',
value: '1,000,000',
valueSrc: undefined,
},
{
title: 'Participants with Genomic Data',
value: '1,000',
valueSrc: undefined,
},
],
},
help: {
links: [
{
Expand Down
10 changes: 10 additions & 0 deletions src/lib/content.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script lang="ts">
export let title = 'Unknown page title';
</script>

<section class="main-content">
<h1 class="h1 mb-4">
{title}
</h1>
<slot />
</section>
5 changes: 5 additions & 0 deletions src/lib/models/value.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export interface Value {
title: string;
value?: string;
valueSrc?: string;
}
Loading