Skip to content

Commit

Permalink
community: rename theme.config to theme.style to facilitate indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
kpsherva committed Feb 8, 2024
1 parent b65406a commit a94f155
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import PropTypes from "prop-types";
import _truncate from "lodash/truncate";

import { Image, InvenioPopup } from "react-invenio-forms";
import { Icon, Label } from "semantic-ui-react";
import { Icon, Label, Item } from "semantic-ui-react";
import { CommunityTypeLabel, RestrictedLabel } from "../labels";

export const CommunityCompactItemComputer = ({
Expand All @@ -25,19 +25,22 @@ export const CommunityCompactItemComputer = ({
const { metadata, ui, links, access, id } = result;
const communityType = ui?.type?.title_l10n;
return (
<div

<Item
key={id}
className={`community-item tablet computer only display-grid auto-column-grid no-wrap ${itemClassName}`}

>

<div className="flex align-items-center">
<Image
wrapped
size="tiny"
src={links.logo}
alt=""

className="community-image rel-mr-2"
/>

<div>
<div className="flex align-items-center rel-mb-1">
<a
Expand Down Expand Up @@ -95,7 +98,7 @@ export const CommunityCompactItemComputer = ({
)}
{actions}
</div>
</div>
</Item>
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@
"description": "Community theme settings.",
"additionalProperties": false,
"properties": {
"config": {
"description": "Theme config.",
"style": {
"description": "Theme style.",
"type": "object"
},
"brand": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
"brand": {
"type": "keyword"
},
"config": {
"style": {
"type": "object"
}
}
Expand Down
6 changes: 3 additions & 3 deletions invenio_communities/communities/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class DeletionStatusSchema(Schema):
status = fields.String(dump_only=True)


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

font = fields.Dict()
Expand All @@ -177,9 +177,9 @@ class CommunityThemeConfigSchema(Schema):
class CommunityThemeSchema(Schema):
"""Community theme schema."""

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


class CommunitySchema(BaseRecordSchema, FieldPermissionsMixin):
Expand Down
2 changes: 1 addition & 1 deletion invenio_communities/views/communities.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ def communities_curation_policy(pid_value, community, community_ui):
@pass_community(serialize=False)
def community_theme_css_config(pid_value, revision, community):
"""Community brand theme view to serve css config."""
theme_config = community.data.get("theme", {}).get("config")
theme_config = community.data.get("theme", {}).get("style")

if theme_config is None:
template = ""
Expand Down
2 changes: 1 addition & 1 deletion tests/communities/test_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ def test_theme_updates(

theme_data = {
"theme": {
"config": {
"style": {
"primaryColor": "#004494",
"tertiaryColor": "#e3eefd",
"secondaryColor": "#FFD617",
Expand Down

0 comments on commit a94f155

Please sign in to comment.