mirror of
				https://github.com/bartvdbraak/omnidash.git
				synced 2025-10-30 16:09:11 +00:00 
			
		
		
		
	Merge pull request #207 from bartvdbraak/lint-and-lighthouse
Fix linting and formatting
This commit is contained in:
		
						commit
						db164196d6
					
				
					 11 changed files with 95 additions and 179 deletions
				
			
		|  | @ -11,3 +11,4 @@ node_modules | ||||||
| pnpm-lock.yaml | pnpm-lock.yaml | ||||||
| package-lock.json | package-lock.json | ||||||
| yarn.lock | yarn.lock | ||||||
|  | /backend | ||||||
							
								
								
									
										16
									
								
								.github/dependabot.yaml
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										16
									
								
								.github/dependabot.yaml
									
										
									
									
										vendored
									
									
								
							|  | @ -1,14 +1,14 @@ | ||||||
| version: 2 | version: 2 | ||||||
| updates: | updates: | ||||||
|   - package-ecosystem: "npm" |   - package-ecosystem: 'npm' | ||||||
|     directory: "/" |     directory: '/' | ||||||
|     schedule: |     schedule: | ||||||
|       interval: "daily" |       interval: 'daily' | ||||||
|     reviewers: |     reviewers: | ||||||
|       - "bartvdbraak" |       - 'bartvdbraak' | ||||||
|   - package-ecosystem: "github-actions" |   - package-ecosystem: 'github-actions' | ||||||
|     directory: "/" |     directory: '/' | ||||||
|     schedule: |     schedule: | ||||||
|       interval: "weekly" |       interval: 'weekly' | ||||||
|     reviewers: |     reviewers: | ||||||
|       - "bartvdbraak" |       - 'bartvdbraak' | ||||||
|  |  | ||||||
|  | @ -2,3 +2,4 @@ | ||||||
| pnpm-lock.yaml | pnpm-lock.yaml | ||||||
| package-lock.json | package-lock.json | ||||||
| yarn.lock | yarn.lock | ||||||
|  | /backend | ||||||
|  | @ -1,33 +0,0 @@ | ||||||
| /// <reference path="../pb_data/types.d.ts" />
 |  | ||||||
| migrate((db) => { |  | ||||||
|   const dao = new Dao(db) |  | ||||||
|   const collection = dao.findCollectionByNameOrId("_pb_users_auth_") |  | ||||||
| 
 |  | ||||||
|   // add
 |  | ||||||
|   collection.schema.addField(new SchemaField({ |  | ||||||
|     "system": false, |  | ||||||
|     "id": "rncq13xn", |  | ||||||
|     "name": "appearance_mode", |  | ||||||
|     "type": "select", |  | ||||||
|     "required": false, |  | ||||||
|     "presentable": false, |  | ||||||
|     "unique": false, |  | ||||||
|     "options": { |  | ||||||
|       "maxSelect": 1, |  | ||||||
|       "values": [ |  | ||||||
|         "light", |  | ||||||
|         "dark" |  | ||||||
|       ] |  | ||||||
|     } |  | ||||||
|   })) |  | ||||||
| 
 |  | ||||||
|   return dao.saveCollection(collection) |  | ||||||
| }, (db) => { |  | ||||||
|   const dao = new Dao(db) |  | ||||||
|   const collection = dao.findCollectionByNameOrId("_pb_users_auth_") |  | ||||||
| 
 |  | ||||||
|   // remove
 |  | ||||||
|   collection.schema.removeField("rncq13xn") |  | ||||||
| 
 |  | ||||||
|   return dao.saveCollection(collection) |  | ||||||
| }) |  | ||||||
|  | @ -1,49 +0,0 @@ | ||||||
| /// <reference path="../pb_data/types.d.ts" />
 |  | ||||||
| migrate((db) => { |  | ||||||
|   const dao = new Dao(db) |  | ||||||
|   const collection = dao.findCollectionByNameOrId("_pb_users_auth_") |  | ||||||
| 
 |  | ||||||
|   // update
 |  | ||||||
|   collection.schema.addField(new SchemaField({ |  | ||||||
|     "system": false, |  | ||||||
|     "id": "rncq13xn", |  | ||||||
|     "name": "appearance_mode", |  | ||||||
|     "type": "select", |  | ||||||
|     "required": false, |  | ||||||
|     "presentable": false, |  | ||||||
|     "unique": false, |  | ||||||
|     "options": { |  | ||||||
|       "maxSelect": 1, |  | ||||||
|       "values": [ |  | ||||||
|         "light", |  | ||||||
|         "dark", |  | ||||||
|         "system" |  | ||||||
|       ] |  | ||||||
|     } |  | ||||||
|   })) |  | ||||||
| 
 |  | ||||||
|   return dao.saveCollection(collection) |  | ||||||
| }, (db) => { |  | ||||||
|   const dao = new Dao(db) |  | ||||||
|   const collection = dao.findCollectionByNameOrId("_pb_users_auth_") |  | ||||||
| 
 |  | ||||||
|   // update
 |  | ||||||
|   collection.schema.addField(new SchemaField({ |  | ||||||
|     "system": false, |  | ||||||
|     "id": "rncq13xn", |  | ||||||
|     "name": "appearance_mode", |  | ||||||
|     "type": "select", |  | ||||||
|     "required": false, |  | ||||||
|     "presentable": false, |  | ||||||
|     "unique": false, |  | ||||||
|     "options": { |  | ||||||
|       "maxSelect": 1, |  | ||||||
|       "values": [ |  | ||||||
|         "light", |  | ||||||
|         "dark" |  | ||||||
|       ] |  | ||||||
|     } |  | ||||||
|   })) |  | ||||||
| 
 |  | ||||||
|   return dao.saveCollection(collection) |  | ||||||
| }) |  | ||||||
|  | @ -1,50 +1,35 @@ | ||||||
| /// <reference path="../pb_data/types.d.ts" />
 | /// <reference path="../pb_data/types.d.ts" />
 | ||||||
| migrate((db) => { | migrate( | ||||||
|   const dao = new Dao(db) | 	(db) => { | ||||||
|   const collection = dao.findCollectionByNameOrId("_pb_users_auth_") | 		const dao = new Dao(db); | ||||||
|  | 		const collection = dao.findCollectionByNameOrId('_pb_users_auth_'); | ||||||
| 
 | 
 | ||||||
| 		// update
 | 		// update
 | ||||||
|   collection.schema.addField(new SchemaField({ | 		collection.schema.addField( | ||||||
|     "system": false, | 			new SchemaField({ | ||||||
|     "id": "rncq13xn", | 				system: false, | ||||||
|     "name": "appearanceMode", | 				id: 'rncq13xn', | ||||||
|     "type": "select", | 				name: 'appearanceMode', | ||||||
|     "required": false, | 				type: 'select', | ||||||
|     "presentable": false, | 				required: false, | ||||||
|     "unique": false, | 				presentable: false, | ||||||
|     "options": { | 				unique: false, | ||||||
|       "maxSelect": 1, | 				options: { | ||||||
|       "values": [ | 					maxSelect: 1, | ||||||
|         "light", | 					values: ['light', 'dark', 'system'] | ||||||
|         "dark", |  | ||||||
|         "system" |  | ||||||
|       ] |  | ||||||
| 				} | 				} | ||||||
|   })) | 			}) | ||||||
|  | 		); | ||||||
| 
 | 
 | ||||||
|   return dao.saveCollection(collection) | 		return dao.saveCollection(collection); | ||||||
| }, (db) => { | 	}, | ||||||
|   const dao = new Dao(db) | 	(db) => { | ||||||
|   const collection = dao.findCollectionByNameOrId("_pb_users_auth_") | 		const dao = new Dao(db); | ||||||
|  | 		const collection = dao.findCollectionByNameOrId('_pb_users_auth_'); | ||||||
| 
 | 
 | ||||||
|   // update
 | 		// remove
 | ||||||
|   collection.schema.addField(new SchemaField({ | 		collection.schema.removeField('rncq13xn'); | ||||||
|     "system": false, | 
 | ||||||
|     "id": "rncq13xn", | 		return dao.saveCollection(collection); | ||||||
|     "name": "appearance_mode", |  | ||||||
|     "type": "select", |  | ||||||
|     "required": false, |  | ||||||
|     "presentable": false, |  | ||||||
|     "unique": false, |  | ||||||
|     "options": { |  | ||||||
|       "maxSelect": 1, |  | ||||||
|       "values": [ |  | ||||||
|         "light", |  | ||||||
|         "dark", |  | ||||||
|         "system" |  | ||||||
|       ] |  | ||||||
| 	} | 	} | ||||||
|   })) | ); | ||||||
| 
 |  | ||||||
|   return dao.saveCollection(collection) |  | ||||||
| }) |  | ||||||
|  |  | ||||||
|  | @ -1,17 +1,17 @@ | ||||||
| <script lang="ts" context="module"> | <script lang="ts" context="module"> | ||||||
| 	const MAX_IMAGE_SIZE = 5; | 	// const MAX_IMAGE_SIZE = 5; | ||||||
| 	const ACCEPTED_IMAGE_TYPES = [ | 	// const ACCEPTED_IMAGE_TYPES = [ | ||||||
| 		'image/jpeg', | 	// 	'image/jpeg', | ||||||
| 		'image/png', | 	// 	'image/png', | ||||||
| 		'image/svg+xml', | 	// 	'image/svg+xml', | ||||||
| 		'image/gif', | 	// 	'image/gif', | ||||||
| 		'image/webp' | 	// 	'image/webp' | ||||||
| 	]; | 	// ]; | ||||||
| 	import { z } from 'zod'; | 	import { z } from 'zod'; | ||||||
| 	const sizeInMB = (sizeInBytes: number, decimalsNum = 2) => { | 	// const sizeInMB = (sizeInBytes: number, decimalsNum = 2) => { | ||||||
| 		const result = sizeInBytes / (1024 * 1024); | 	// 	const result = sizeInBytes / (1024 * 1024); | ||||||
| 		return +result.toFixed(decimalsNum); | 	// 	return +result.toFixed(decimalsNum); | ||||||
| 	}; | 	// }; | ||||||
| 	export const avatarFormSchema = z.object({ | 	export const avatarFormSchema = z.object({ | ||||||
| 		avatar: z.any() | 		avatar: z.any() | ||||||
| 		// .custom<FileList>() | 		// .custom<FileList>() | ||||||
|  |  | ||||||
|  | @ -34,28 +34,39 @@ | ||||||
| 		> | 		> | ||||||
| 			<Form.Item> | 			<Form.Item> | ||||||
| 				<Form.Field {config} name="type"> | 				<Form.Field {config} name="type"> | ||||||
| 				<Form.RadioGroup | 					<Form.RadioGroup class="grid max-w-xl grid-cols-3 gap-8 pt-2" orientation="horizontal"> | ||||||
| 					class="grid max-w-xl grid-cols-3 gap-8 pt-2" |  | ||||||
| 					orientation="horizontal" |  | ||||||
| 					> |  | ||||||
| 						<!-- value={user?.appearanceMode} --> | 						<!-- value={user?.appearanceMode} --> | ||||||
| 					<Label for="all" class="flex flex-col items-center justify-between rounded-md border-2 border-muted bg-popover p-4 hover:bg-accent hover:text-accent-foreground [&:has([data-state=checked])]:border-primary"> | 						<Label | ||||||
|  | 							for="all" | ||||||
|  | 							class="flex flex-col items-center justify-between rounded-md border-2 border-muted bg-popover p-4 hover:bg-accent hover:text-accent-foreground [&:has([data-state=checked])]:border-primary" | ||||||
|  | 						> | ||||||
| 							<Form.RadioItem id="all" value="all" class="sr-only" /> | 							<Form.RadioItem id="all" value="all" class="sr-only" /> | ||||||
| 							<Bell class="mb-3 h-6 w-6" /> | 							<Bell class="mb-3 h-6 w-6" /> | ||||||
| 							<span class="block w-full p-2 text-center font-normal">Everything</span> | 							<span class="block w-full p-2 text-center font-normal">Everything</span> | ||||||
| 						<span class="text-sm text-center text-muted-foreground">New tickets and updates.</span> | 							<span class="text-center text-sm text-muted-foreground">New tickets and updates.</span | ||||||
|  | 							> | ||||||
| 						</Label> | 						</Label> | ||||||
| 					<Label for="tickets" class="flex flex-col items-center justify-between rounded-md border-2 border-muted bg-popover p-4 hover:bg-accent hover:text-accent-foreground [&:has([data-state=checked])]:border-primary"> | 						<Label | ||||||
|  | 							for="tickets" | ||||||
|  | 							class="flex flex-col items-center justify-between rounded-md border-2 border-muted bg-popover p-4 hover:bg-accent hover:text-accent-foreground [&:has([data-state=checked])]:border-primary" | ||||||
|  | 						> | ||||||
| 							<Form.RadioItem id="tickets" value="tickets" class="sr-only" /> | 							<Form.RadioItem id="tickets" value="tickets" class="sr-only" /> | ||||||
| 							<Person class="mb-3 h-6 w-6" /> | 							<Person class="mb-3 h-6 w-6" /> | ||||||
| 							<span class="block w-full p-2 text-center font-normal">New tickets</span> | 							<span class="block w-full p-2 text-center font-normal">New tickets</span> | ||||||
| 						<span class="text-sm text-center text-muted-foreground">Only new unassigned tickets</span> | 							<span class="text-center text-sm text-muted-foreground" | ||||||
|  | 								>Only new unassigned tickets</span | ||||||
|  | 							> | ||||||
| 						</Label> | 						</Label> | ||||||
| 					<Label for="none" class="flex flex-col items-center justify-between rounded-md border-2 border-muted bg-popover p-4 hover:bg-accent hover:text-accent-foreground [&:has([data-state=checked])]:border-primary"> | 						<Label | ||||||
|  | 							for="none" | ||||||
|  | 							class="flex flex-col items-center justify-between rounded-md border-2 border-muted bg-popover p-4 hover:bg-accent hover:text-accent-foreground [&:has([data-state=checked])]:border-primary" | ||||||
|  | 						> | ||||||
| 							<Form.RadioItem id="none" value="none" class="sr-only" /> | 							<Form.RadioItem id="none" value="none" class="sr-only" /> | ||||||
| 							<EyeNone class="mb-3 h-6 w-6" /> | 							<EyeNone class="mb-3 h-6 w-6" /> | ||||||
| 							<span class="block w-full p-2 text-center font-normal">Ignore</span> | 							<span class="block w-full p-2 text-center font-normal">Ignore</span> | ||||||
| 						<span class="text-sm text-center text-muted-foreground">Turn off all notifications.</span> | 							<span class="text-center text-sm text-muted-foreground" | ||||||
|  | 								>Turn off all notifications.</span | ||||||
|  | 							> | ||||||
| 						</Label> | 						</Label> | ||||||
| 					</Form.RadioGroup> | 					</Form.RadioGroup> | ||||||
| 					<Form.Validation /> | 					<Form.Validation /> | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue