Skip to content

Commit

Permalink
add svelte-sonner for notifications and update URL handling in routes
Browse files Browse the repository at this point in the history
  • Loading branch information
Spikeysanju committed Oct 30, 2024
1 parent d95c3e7 commit e734f97
Show file tree
Hide file tree
Showing 16 changed files with 724 additions and 443 deletions.
Binary file modified bun.lockb
Binary file not shown.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
},
"dependencies": {
"nanoid": "^5.0.7",
"pocketbase": "^0.21.5"
"pocketbase": "^0.21.5",
"svelte-sonner": "^0.3.28"
}
}
16 changes: 16 additions & 0 deletions pocketbase/pb_migrations/1730306469_updated_urls.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("yq7y9q93v9mlxmq")

collection.createRule = "@request.data.id != \"\" && @request.auth.id = @collection.users.id"

return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("yq7y9q93v9mlxmq")

collection.createRule = ""

return dao.saveCollection(collection)
})
33 changes: 33 additions & 0 deletions pocketbase/pb_migrations/1730306609_updated_urls.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("yq7y9q93v9mlxmq")

// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "oqmxf691",
"name": "created_by",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "_pb_users_auth_",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}))

return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("yq7y9q93v9mlxmq")

// remove
collection.schema.removeField("oqmxf691")

return dao.saveCollection(collection)
})
22 changes: 22 additions & 0 deletions pocketbase/pb_migrations/1730306650_updated_urls.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("yq7y9q93v9mlxmq")

collection.listRule = "@request.auth.id = @collection.urls.created_by"
collection.viewRule = "@request.auth.id = @collection.urls.created_by"
collection.updateRule = "@request.auth.id = @collection.urls.created_by"
collection.deleteRule = "@request.auth.id = @collection.urls.created_by"

return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("yq7y9q93v9mlxmq")

collection.listRule = ""
collection.viewRule = ""
collection.updateRule = ""
collection.deleteRule = ""

return dao.saveCollection(collection)
})
16 changes: 16 additions & 0 deletions pocketbase/pb_migrations/1730307172_updated_urls.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("yq7y9q93v9mlxmq")

collection.createRule = "@request.data.id != \"\""

return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("yq7y9q93v9mlxmq")

collection.createRule = "@request.data.id != \"\" && @request.auth.id = @collection.users.id"

return dao.saveCollection(collection)
})
16 changes: 16 additions & 0 deletions pocketbase/pb_migrations/1730307346_updated_urls.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("yq7y9q93v9mlxmq")

collection.createRule = ""

return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("yq7y9q93v9mlxmq")

collection.createRule = "@request.data.id != \"\""

return dao.saveCollection(collection)
})
16 changes: 16 additions & 0 deletions pocketbase/pb_migrations/1730307378_updated_urls.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("yq7y9q93v9mlxmq")

collection.createRule = "@request.auth.id != ''"

return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("yq7y9q93v9mlxmq")

collection.createRule = ""

return dao.saveCollection(collection)
})
22 changes: 22 additions & 0 deletions pocketbase/pb_migrations/1730307635_updated_urls.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("yq7y9q93v9mlxmq")

collection.listRule = "@request.auth.id != ''"
collection.viewRule = "@request.auth.id != ''"
collection.updateRule = "@request.auth.id != ''"
collection.deleteRule = "@request.auth.id != ''"

return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("yq7y9q93v9mlxmq")

collection.listRule = "@request.auth.id = @collection.urls.created_by"
collection.viewRule = "@request.auth.id = @collection.urls.created_by"
collection.updateRule = "@request.auth.id = @collection.urls.created_by"
collection.deleteRule = "@request.auth.id = @collection.urls.created_by"

return dao.saveCollection(collection)
})
22 changes: 22 additions & 0 deletions pocketbase/pb_migrations/1730307708_updated_urls.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("yq7y9q93v9mlxmq")

collection.listRule = ""
collection.viewRule = ""
collection.updateRule = ""
collection.deleteRule = ""

return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("yq7y9q93v9mlxmq")

collection.listRule = "@request.auth.id != ''"
collection.viewRule = "@request.auth.id != ''"
collection.updateRule = "@request.auth.id != ''"
collection.deleteRule = "@request.auth.id != ''"

return dao.saveCollection(collection)
})
48 changes: 43 additions & 5 deletions src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,50 @@
@import "tailwindcss/utilities";

:root {
--background: 210 40% 98%; /* Cool light background */
--card: 0 0% 100%; /* Pure white */
--ring: 215 25% 92%; /* Subtle blue-gray ring */
--border: 215 20% 92%; /* Subtle blue-gray border */
--background: 0 0% 98%; /* Almost white */
--foreground: 0 0% 12%; /* Dark gray for text */
--card: 0 0% 100%; /* Pure white */
--card-foreground: 0 0% 12%;
--popover: 0 0% 100%;
--popover-foreground: 0 0% 12%;
--primary: 0 0% 12%; /* Dark gray */
--primary-foreground: 0 0% 98%;
--secondary: 0 0% 96%; /* Light gray */
--secondary-foreground: 0 0% 12%;
--muted: 0 0% 96%;
--muted-foreground: 0 0% 45%;
--accent: 0 0% 96%;
--accent-foreground: 0 0% 12%;
--destructive: 0 84% 60%; /* Red for destructive actions */
--destructive-foreground: 0 0% 98%;
--border: 0 0% 89%; /* Gray border */
--input: 0 0% 89%;
--ring: 0 0% 82%;
}

.dark {
--background: 0 0% 5%; /* Almost black */
--foreground: 0 0% 98%; /* Almost white */
--card: 0 0% 8%; /* Dark gray */
--card-foreground: 0 0% 98%;
--popover: 0 0% 8%;
--popover-foreground: 0 0% 98%;
--primary: 0 0% 98%; /* Almost white */
--primary-foreground: 0 0% 5%;
--secondary: 0 0% 12%; /* Darker gray */
--secondary-foreground: 0 0% 98%;
--muted: 0 0% 12%;
--muted-foreground: 0 0% 63%;
--accent: 0 0% 12%;
--accent-foreground: 0 0% 98%;
--destructive: 0 84% 60%; /* Keep red for destructive actions */
--destructive-foreground: 0 0% 98%;
--border: 0 0% 15%;
--input: 0 0% 15%;
--ring: 0 0% 22%;
}

body {
background-color: #F8FAFC; /* Matches the background variable */
background-color: hsl(var(--background));
color: hsl(var(--foreground));
}
Loading

0 comments on commit e734f97

Please sign in to comment.