-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat/import and user settings (#260)
* feat: pretty solid init * feat: import, guide + delete of user * fix: removed unused importer service * feat: dockerfile * fix: docker file improvement * fix: missing env * fix: added redirect * fix: ofc i forgot a t * fix: PR comments * feat: 18n * feat: make sure wishes have rarity too * fix: installed * fix: removal of microsoft in simple icons * fix: microsoft removal here too * fix: lint + quality gate * fix: docker file creating sonnar issues
- Loading branch information
1 parent
348e12a
commit 5d984c8
Showing
48 changed files
with
891 additions
and
940 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
node_modules | ||
npm-debug.log | ||
yarn-error.log | ||
.git | ||
.gitignore | ||
.dockerignore | ||
Dockerfile | ||
*.md | ||
.vscode | ||
.idea | ||
.env | ||
.env.* | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,5 @@ node_modules | |
vite.config.js.timestamp-* | ||
vite.config.ts.timestamp-* | ||
.idea | ||
.vscode | ||
/.npm-only-allow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"sonarCloudOrganization": "dval-in", | ||
"projectKey": "dval-in_dvalin-frontend" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# sonarqube analysis should ignore this file | ||
# sonarqube.analysis.skip=true | ||
FROM node:20-alpine | ||
|
||
# Install pnpm | ||
RUN npm install -g pnpm | ||
|
||
WORKDIR /app | ||
|
||
COPY . . | ||
|
||
# Install dependencies | ||
RUN pnpm install --frozen-lockfile | ||
|
||
# Copy the rest of the application code | ||
COPY . . | ||
|
||
|
||
ARG VITE_BACKEND_URL | ||
ENV VITE_BACKEND_URL=$VITE_BACKEND_URL | ||
|
||
# Build the application | ||
RUN pnpm run build | ||
|
||
# Expose the port the app runs on | ||
EXPOSE 8080 | ||
|
||
# Command to run the application | ||
CMD ["pnpm", "run", "preview"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
<script lang="ts"> | ||
import { Button } from '$lib/components/ui/button'; | ||
import { Input } from '$lib/components/ui/input'; | ||
import { Label } from '$lib/components/ui/label'; | ||
import { AlertCircle } from 'lucide-svelte'; | ||
import { Alert, AlertDescription, AlertTitle } from '$lib/components/ui/alert'; | ||
import { Checkbox } from '$lib/components/ui/checkbox'; | ||
import H3 from '$lib/components/typography/H3.svelte'; | ||
import langFlagDE from '$lib/assets/languages/DE.svg'; | ||
import langFlagEN from '$lib/assets/languages/EN.svg'; | ||
import langFlagES from '$lib/assets/languages/ES.svg'; | ||
import langFlagFR from '$lib/assets/languages/FR.svg'; | ||
import langFlagIT from '$lib/assets/languages/IT.svg'; | ||
import langFlagPT from '$lib/assets/languages/PT.svg'; | ||
import langFlagPL from '$lib/assets/languages/PL.svg'; | ||
import langFlagRU from '$lib/assets/languages/RU.svg'; | ||
import langFlagTH from '$lib/assets/languages/TH.svg'; | ||
import langFlagZHS from '$lib/assets/languages/ZHS.svg'; | ||
import langFlagZHT from '$lib/assets/languages/ZHT.svg'; | ||
// Props | ||
export let onSubmit: (data: { user: UserData; config: ConfigData }) => void; | ||
const languages = [ | ||
{ code: 'en', name: 'English', flag: langFlagEN }, | ||
{ code: 'de', name: 'Deutsch', flag: langFlagDE }, | ||
{ code: 'es', name: 'Español', flag: langFlagES }, | ||
{ code: 'fr', name: 'Français', flag: langFlagFR }, | ||
{ code: 'it', name: 'Italiano', flag: langFlagIT }, | ||
{ code: 'pt', name: 'Português', flag: langFlagPT }, | ||
{ code: 'pl', name: 'Polski', flag: langFlagPL }, | ||
{ code: 'ru', name: 'Русский', flag: langFlagRU }, | ||
{ code: 'th', name: 'ไทย', flag: langFlagTH }, | ||
{ code: 'zh-CN', name: '简体中文', flag: langFlagZHS }, | ||
{ code: 'zh-TW', name: '繁體中文', flag: langFlagZHT } | ||
]; | ||
interface UserData { | ||
uid: number; | ||
} | ||
interface ConfigData { | ||
autoRefine3: boolean; | ||
autoRefine4: boolean; | ||
autoRefine5: boolean; | ||
preferedLanguage: string; | ||
} | ||
let user: UserData = { | ||
uid: 1 | ||
}; | ||
let config: ConfigData = { | ||
autoRefine3: false, | ||
autoRefine4: false, | ||
autoRefine5: false, | ||
preferedLanguage: 'en' | ||
}; | ||
let errors: Partial<{ uid: string }> = {}; | ||
function validateForm(): boolean { | ||
errors = {}; | ||
if (!user.uid || user.uid < 100000000 || user.uid > 999999999) { | ||
errors.uid = 'UID must be a 9-digit number'; | ||
} | ||
return Object.keys(errors).length === 0; | ||
} | ||
function handleSubmit() { | ||
if (!validateForm()) { | ||
return; | ||
} | ||
onSubmit({ user, config }); | ||
} | ||
</script> | ||
|
||
<form on:submit|preventDefault={handleSubmit} class="space-y-4 col-span-2 p-5"> | ||
{#if Object.keys(errors).length > 0} | ||
<Alert variant="destructive" class="mt-4"> | ||
<AlertCircle class="h-4 w-4" /> | ||
<AlertTitle>Error</AlertTitle> | ||
<AlertDescription> | ||
Please correct the errors in the form before submitting. | ||
</AlertDescription> | ||
</Alert> | ||
{/if} | ||
<div> | ||
<Label for="uid">UID</Label> | ||
<Input type="number" id="uid" bind:value={user.uid} /> | ||
{#if errors.uid} | ||
<p class="text-red-500 text-sm mt-1">{errors.uid}</p> | ||
{/if} | ||
</div> | ||
<H3>Add configuration information (optional)</H3> | ||
<div> | ||
<Label>Auto Refine Settings</Label> | ||
<div class="space-y-2"> | ||
<div class="flex items-center space-x-2"> | ||
<Checkbox bind:checked={config.autoRefine3} id="autoRefine3" /> | ||
<label for="autoRefine3">Auto Refine 3-star weapons</label> | ||
</div> | ||
<div class="flex items-center space-x-2"> | ||
<Checkbox bind:checked={config.autoRefine4} id="autoRefine4" /> | ||
<label for="autoRefine4">Auto Refine 4-star weapons</label> | ||
</div> | ||
<div class="flex items-center space-x-2"> | ||
<Checkbox bind:checked={config.autoRefine5} id="autoRefine5" /> | ||
<label for="autoRefine5">Auto Refine 5-star weapons</label> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div> | ||
<Label for="language">Preferred Language</Label> | ||
<div class="grid grid-cols-2 gap-2 mt-2"> | ||
{#each languages as lang} | ||
<Button | ||
type="button" | ||
variant={config.preferedLanguage === lang.code ? 'default' : 'outline'} | ||
class="flex items-center justify-start space-x-2" | ||
on:click={() => (config.preferedLanguage = lang.code)} | ||
> | ||
<img src={lang.flag} alt={lang.name} class="w-6 h-4" /> | ||
<span>{lang.name}</span> | ||
</Button> | ||
{/each} | ||
</div> | ||
</div> | ||
|
||
<div class="flex space-x-4"> | ||
<Button type="submit" class="flex-1 bg-primary text-primary-foreground"> | ||
Complete Profile | ||
</Button> | ||
</div> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.