-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'notification-support' into develop
- Loading branch information
Showing
34 changed files
with
2,048 additions
and
1,525 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,5 @@ | ||
--- | ||
"forager": patch | ||
--- | ||
|
||
Fix overflow issue when too many forables available in popup |
This file was deleted.
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
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,86 @@ | ||
package migrations | ||
|
||
import ( | ||
"github.com/pocketbase/dbx" | ||
"github.com/pocketbase/pocketbase/daos" | ||
m "github.com/pocketbase/pocketbase/migrations" | ||
"github.com/pocketbase/pocketbase/models" | ||
"github.com/pocketbase/pocketbase/models/schema" | ||
"github.com/pocketbase/pocketbase/tools/types" | ||
) | ||
|
||
func init() { | ||
m.Register(func(db dbx.Builder) error { | ||
dao := daos.New(db) | ||
|
||
ownerOnly := types.Pointer("@request.auth.id != '' && owner.id ?= @request.auth.id") | ||
usersCollection, err := dao.FindCollectionByNameOrId("users") | ||
if err != nil { | ||
return err | ||
} | ||
|
||
collection := &models.Collection{ | ||
Name: "notifications", | ||
Type: models.CollectionTypeBase, | ||
ListRule: ownerOnly, | ||
ViewRule: ownerOnly, | ||
CreateRule: types.Pointer(""), | ||
UpdateRule: ownerOnly, | ||
DeleteRule: ownerOnly, | ||
System: false, | ||
Schema: schema.NewSchema( | ||
&schema.SchemaField{ | ||
Name: "owner", | ||
Type: schema.FieldTypeRelation, | ||
Required: true, | ||
System: false, | ||
Options: &schema.RelationOptions{ | ||
CollectionId: usersCollection.Id, | ||
CascadeDelete: false, | ||
MinSelect: types.Pointer(1), | ||
MaxSelect: types.Pointer(1), | ||
}, | ||
}, | ||
&schema.SchemaField{ | ||
Name: "type", | ||
Type: schema.FieldTypeText, | ||
Required: true, | ||
System: false, | ||
}, | ||
&schema.SchemaField{ | ||
Name: "title", | ||
Type: schema.FieldTypeText, | ||
Required: true, | ||
System: false, | ||
}, | ||
&schema.SchemaField{ | ||
Name: "body", | ||
Type: schema.FieldTypeText, | ||
Required: true, | ||
System: false, | ||
}, | ||
), | ||
} | ||
|
||
err = dao.SaveCollection(collection) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
return nil | ||
}, func(db dbx.Builder) error { | ||
dao := daos.New(db) | ||
|
||
collection, err := dao.FindCollectionByNameOrId("notifications") | ||
if err != nil { | ||
return err | ||
} | ||
|
||
err = dao.DeleteCollection(collection) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
return nil | ||
}) | ||
} |
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,15 @@ | ||
import antfu from '@antfu/eslint-config' | ||
|
||
export default await antfu({ | ||
ignores: ['dist', '**/dist/**', 'public', '**/public/**', 'coverage', '**/coverage/**', 'node_modules', '**/node_modules/**'], | ||
rules: { | ||
'no-console': 'error', | ||
'no-restricted-syntax': [ | ||
'error', | ||
'TSEnumDeclaration', | ||
'ClassDeclaration', | ||
'Decorator', | ||
'TSAnyKeyword', | ||
], | ||
}, | ||
}) |
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.