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

[WIP ⚠️👷‍♀️] Issue 279 view historical data #10

Draft
wants to merge 20 commits into
base: the-one
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
526e6f1
Merge branch 'the-one' into issue-279-view-historical-data
marikadeveloper May 14, 2024
0cc2a5d
Issue 279 add first view line charts (#279)
marikadeveloper May 14, 2024
b800793
Issue 279 add first view line charts (#279)
marikadeveloper May 14, 2024
5f8081d
Issue 279 add first view line charts (#279)
marikadeveloper May 14, 2024
56c7400
Issue 279 add context module to login (#279)
marikadeveloper May 14, 2024
b7b2de8
Issue 279 extract global performance line chart (#279)
marikadeveloper May 14, 2024
cc42ccd
Issue 279 fix readme code (#279)
marikadeveloper May 14, 2024
edc1c9c
Issue 279 small code refactor
marikadeveloper May 14, 2024
2b012e9
fix the graph
Idrinth May 17, 2024
1c57a45
clean up and prepare the pages
Idrinth May 17, 2024
48b6ed9
clean up and prepare the pages
Idrinth May 17, 2024
6f3148e
clean up and prepare the pages
Idrinth May 17, 2024
445edd6
clean up and prepare the pages
Idrinth May 17, 2024
0370119
Merge branch 'issue-279-view-historical-data' of https://github.com/m…
marikadeveloper May 17, 2024
b5c9f57
Merge remote-tracking branch 'upstream/the-one' into issue-279-view-h…
marikadeveloper May 25, 2024
a391e5d
bugfix(routes): fixed route params #279
marikadeveloper Jun 13, 2024
10ad99a
Merge remote-tracking branch 'upstream/the-one' into issue-279-view-h…
marikadeveloper Jun 13, 2024
7894d38
feature(routing): add projects and routes links inside detail pages #279
marikadeveloper Jun 13, 2024
fb435c6
feature(navigation): add breadcrumbs #279
marikadeveloper Jun 13, 2024
6ebc7a1
cleanup: removed console.log
marikadeveloper Jun 13, 2024
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
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module.exports = {
],
parserOptions: {
extraFileExtensions: ['.svelte'],
sourceType: 'module',
},
overrides: [
{
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/cypress/screenshots
/src/locales
/dump.txt
.env*

# Editor directories and files
.DS_Store
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Svelte + TS</title>
</head>
<body>
<body class="dark-mode">
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
Expand Down
7 changes: 7 additions & 0 deletions language/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@ overview:
meta:
title: "Projekte"
description: "Alle Projekte in einer einfach zu verstehenden Übersicht."
login:
title: "Anmelden"
username: "Benutzername"
submit: "Anmelden"
meta:
title: "Anmelden"
description: "Melden Sie sich bei Ihrem Konto an."
7 changes: 7 additions & 0 deletions language/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@ overview:
meta:
title: "Projects"
description: "All your projects in an easy to grasp overview."
login:
username: "Username"
submit: "Login"
title: "Login"
meta:
title: "Login"
description: "Login to your account."
7 changes: 7 additions & 0 deletions language/it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@ overview:
meta:
title: "Progetti"
description: "Tutti i tuoi progetti in un'unica semplice interfaccia."
login:
title: "Accedi"
username: "Username"
submit: "Accedi"
meta:
title: "Accedi"
description: "Accedi al tuo account."
65 changes: 40 additions & 25 deletions package-lock.json

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

7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,16 @@
"svelte": "^4.2.16",
"svelte-check": "^3.6.4",
"svelte-eslint-parser": "^0.36.0",
"svelte-routing": "^2.13.0",
"typescript": "^5.2.2",
"vite": "^5.1.4"
},
"engines": {
"node": ">=20"
},
"engineStrict": true
"engineStrict": true,
"dependencies": {
"chart.js": "^4.4.2",
"svelte-chartjs": "^3.1.5"
}
}
23 changes: 3 additions & 20 deletions src/App.svelte
Original file line number Diff line number Diff line change
@@ -1,26 +1,9 @@
<script lang="ts" context="module">
import logo from '@idrinth-api-bench/assets/iab.svg';
import t from './lib/t.js';
import AppRouter from "./routes/AppRouter.svelte";
</script>

<main>
<header>
<img src={logo} class="logo" alt="Logo" />
</header>
<h1>{t('overview.title',)}</h1>

<div class="card">
</div>
<AppRouter />
</main>

<style>
.logo {
height: 6em;
padding: 1.5em;
will-change: filter;
transition: filter 300ms;
}
.logo:hover {
filter: drop-shadow(0 0 2em #646cffaa);
}
</style>

1 change: 1 addition & 0 deletions src/Home.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>Hello!</h1>
31 changes: 31 additions & 0 deletions src/Login.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<script lang="ts">
import t from "./lib/t";
import { login } from './lib/http-client';
import { navigate } from "svelte-routing";
marikadeveloper marked this conversation as resolved.
Show resolved Hide resolved

export let username = '';

async function handleSubmit() {
try {
await login(username);
navigate('/');
} catch (e) {
console.log(e);
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check login form submission logic.

The handleSubmit function handles login and navigation. Ensure error handling is robust and user feedback is provided.

-    } catch (e) {
-      console.log(e);
+    } catch (error) {
+      console.error(error);
+      // Provide user feedback for login failure
+      alert('Login failed. Please try again.');

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
async function handleSubmit() {
try {
await login(username);
navigate('/');
} catch (e) {
console.log(e);
}
}
async function handleSubmit() {
try {
await login(username);
navigate('/');
} catch (error) {
console.error(error);
// Provide user feedback for login failure
alert('Login failed. Please try again.');
}
}

</script>

<div class="login">
<h1>{t('login.title')}</h1>
<form on:submit|preventDefault="{handleSubmit}">
<input
class="form-field"
placeholder="{t('login.username')}"
type="text"
bind:value="{username}"
/>
<button type="submit">
{t('login.submit')}
</button>
</form>
</div>
Loading
Loading