diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index e6b7d26..fa52359 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -14,4 +14,5 @@ - Remain consistent in styling and code structure. - Avoid unncessary iterations. If problems is mostly solved, stop. - Split big components into subcomponents. Always create smaller subcomponents for better context management later. -- Do not do what you're not being asked. Stick to scope of my request. \ No newline at end of file +- Do not do what you're not being asked. Stick to scope of my request. +- Do not edit stores.ts ! Unless is explicitly allow you to. \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 9086028..b54115c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,6 @@ "@types/gapi.client.drive-v3": "^0.0.5", "@types/gapi.client.sheets-v4": "^0.0.4", "@types/google.accounts": "^0.0.17", - "@types/uuid": "^10.0.0", "fontkit": "^2.0.4", "heic-convert": "^2.1.0", "idb": "^8.0.3", @@ -29,6 +28,7 @@ "@sveltejs/kit": "^2.22.0", "@sveltejs/vite-plugin-svelte": "^6.0.0", "@tailwindcss/vite": "^4.0.0", + "@types/uuid": "^10.0.0", "prettier": "^3.4.2", "prettier-plugin-svelte": "^3.3.3", "prettier-plugin-tailwindcss": "^0.6.11", @@ -631,6 +631,9 @@ }, "node_modules/@types/uuid": { "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-10.0.0.tgz", + "integrity": "sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==", + "dev": true, "license": "MIT" }, "node_modules/@webgpu/types": { @@ -2019,6 +2022,8 @@ }, "node_modules/uuid": { "version": "11.1.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.0.tgz", + "integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==", "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" diff --git a/package.json b/package.json index 79932b1..55ea62f 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "@sveltejs/kit": "^2.22.0", "@sveltejs/vite-plugin-svelte": "^6.0.0", "@tailwindcss/vite": "^4.0.0", + "@types/uuid": "^10.0.0", "prettier": "^3.4.2", "prettier-plugin-svelte": "^3.3.3", "prettier-plugin-tailwindcss": "^0.6.11", @@ -36,7 +37,6 @@ "@types/gapi.client.drive-v3": "^0.0.5", "@types/gapi.client.sheets-v4": "^0.0.4", "@types/google.accounts": "^0.0.17", - "@types/uuid": "^10.0.0", "fontkit": "^2.0.4", "heic-convert": "^2.1.0", "idb": "^8.0.3", diff --git a/src/lib/components/Wizard.svelte b/src/lib/components/Wizard.svelte index 3d941b8..663db09 100644 --- a/src/lib/components/Wizard.svelte +++ b/src/lib/components/Wizard.svelte @@ -5,17 +5,15 @@ import StepColumnMap from './wizard/StepColumnMap.svelte'; import StepRowFilter from './wizard/StepRowFilter.svelte'; import StepCardDetails from './wizard/StepCardDetails.svelte'; - import StepGallery from './wizard/StepGallery.svelte'; - import StepGenerate from './wizard/StepGenerate.svelte'; + // import StepGallery from './wizard/StepGallery.svelte'; + // import StepGenerate from './wizard/StepGenerate.svelte'; const steps = [ StepAuth, StepSheetSearch, StepColumnMap, StepRowFilter, - StepCardDetails, - StepGallery, - StepGenerate + StepCardDetails ]; const stepTitles = [ @@ -23,9 +21,7 @@ 'Select Sheet', 'Map Columns', 'Filter Rows', - 'Card Details', - 'Review Photos', - 'Generate PDFs' + 'Enter Card Details' ]; diff --git a/src/lib/components/wizard/StepRowFilter.svelte b/src/lib/components/wizard/StepRowFilter.svelte index 5ffcd8f..372bbc6 100644 --- a/src/lib/components/wizard/StepRowFilter.svelte +++ b/src/lib/components/wizard/StepRowFilter.svelte @@ -1,251 +1,118 @@ -
- Review your data and select which rows you want to include in the card generation. Only rows - with all required fields will be available for selection. -
-+ Review your data and select which rows to include. Invalid or already printed rows are + disabled. +
+ {#if $selectedSheet?.id} ++ Need to make changes? + + Open Google Sheet + +
+ {/if}Loading data from Google Sheet...
+Please wait a moment.
+{error}
++ The selected sheet appears to be empty or could not be read. +
+| + | { - // Use event.preventDefault() to avoid default checkbox behavior - e.preventDefault(); - toggleSelectAll(); - }} class="h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500" - disabled={isLoading} + onchange={toggleSelectAll} + checked={allValidRowsSelected} /> | - - - {#each headers.filter((h) => h !== 'alreadyPrinted') as header} - !isLoading && handleSort(header)}
- >
-
- {getFieldLabel(header)}
- {#if sortColumn === header}
-
- {/if}
-
- |
- {/each}
-
-
sortBy('_rowIndex')}># | +sortBy('name')}>Name | +sortBy('surname')}>Surname | +sortBy('nationality')}>Nationality | +sortBy('birthday')}>Birthday | +sortBy('pictureUrl')}>Picture URL | +sortBy('alreadyPrinted')}>Printed | +sortBy('_valid')}>Status | - Status -
|---|---|---|---|---|---|---|---|---|---|---|
| - - | - - - {#each headers.filter((h) => h !== 'alreadyPrinted') as header} -- - | - {/each} - - -
-
-
-
- |
- ||||||||
| - {#if row._isValid} - { - // Use event.preventDefault() to avoid default checkbox behavior - e.preventDefault(); - toggleRowSelection(row._rowIndex); - }} - class="h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500" - /> - {:else} - - {/if} - | - - - {#each headers.filter((h) => h !== 'alreadyPrinted') as header} -- {row[header] || ''} - | - {/each} - - -
-
- {#if row._isValid}
-
- Valid
-
- {:else}
-
- Missing data
-
- {/if}
-
- {#if isRowAlreadyPrinted(row)}
-
- Already Printed
-
- {/if}
-
- |
- ||||||||
| + toggleRow(row.id)} + /> + | +{row._rowIndex} | +{row.name} | +{row.surname} | +{row.nationality} | +{row.birthday} | ++ link + | ++ {#if row.alreadyPrinted} + Yes + {:else} + No + {/if} + | ++ {#if row._valid} + Valid + {:else} + Invalid + {/if} + | +