Skip to content

Commit

Permalink
records: expose theme field in search
Browse files Browse the repository at this point in the history
* add dedicated route
  • Loading branch information
kpsherva committed Feb 8, 2024
1 parent 69f21f2 commit cb1fc7b
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 1 deletion.
Empty file.
1 change: 1 addition & 0 deletions invenio_communities/communities/records/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class Community(Record):

#: Custom fields system field.
custom_fields = DictField(clear_none=True, create_if_missing=True)
theme = DictField(clear_none=True)

theme = DictField(clear_none=True)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,18 @@
"custom_fields": {
"type": "object"
},
"theme": {
"enabled": false,
"type": "object",
"properties": {
"brand": {
"type": "keyword"
},
"config": {
"type": "object"
}
}
},
"metadata": {
"properties": {
"title": {
Expand Down
16 changes: 15 additions & 1 deletion invenio_communities/communities/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,25 @@ class DeletionStatusSchema(Schema):
status = fields.String(dump_only=True)


class CommunityThemeConfigSchema(Schema):
"""Community Theme configuration schema."""

font = fields.Dict()
primaryColor = fields.Str()
secondaryColor = fields.Str()
tertiaryColor = fields.Str()
primaryTextColor = fields.Str()
secondaryTextColor = fields.Str()
tertiaryTextColor = fields.Str()
mainHeaderBackgroundColor = fields.Str()



class CommunityThemeSchema(Schema):
"""Community theme schema."""

config = fields.Nested(CommunityThemeConfigSchema)
enabled = fields.Boolean()
config = fields.Dict()
brand = fields.Str()


Expand Down
1 change: 1 addition & 0 deletions invenio_communities/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"search": "/communities/search",
"new": "/communities/new",
"details": "/communities/<pid_value>",
"upload": "/communities/<pid_value>/upload",
"settings": "/communities/<pid_value>/settings",
"requests": "/communities/<pid_value>/requests",
"settings_privileges": "/communities/<pid_value>/settings/privileges",
Expand Down

0 comments on commit cb1fc7b

Please sign in to comment.