Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ericof committed Nov 12, 2024
1 parent c361907 commit 3e814ba
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 21 deletions.
15 changes: 4 additions & 11 deletions backend/src/kitconcept/intranet/behaviors/theming.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@
from plone.autoform.interfaces import IFormFieldProvider
from plone.namedfile.field import NamedBlobImage
from plone.supermodel import model
from plone.volto.sitesettings import SettingsSchema
from zope.interface import provider
from zope.schema import TextLine


messages = {
"accent_color": {
"default": "Fat menu background",
"description": "This is also the color used as accent color in buttons font text and for the breadcumbs background",
"description": (
"This is also the color used as accent color in buttons font text "
"and for the breadcumbs background"
),
},
"accent_foreground_color": {
"default": "Fat menu font color",
Expand Down Expand Up @@ -89,15 +91,6 @@ class ITheming(model.Schema):
required=False,
)

# directives.widget("primary_color", frontendOptions={"widget": "themingColorPicker"})
# primary_color = TextLine(
# title=_("label_primary_color", default=messages["primary_color"]["default"]),
# description=_(
# "help_primary_color", default=messages["primary_color"]["description"]
# ),
# required=False,
# )

directives.widget(
"primary_foreground_color", frontendOptions={"widget": "themingColorPicker"}
)
Expand Down
16 changes: 8 additions & 8 deletions backend/src/kitconcept/intranet/configure.zcml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:i18n="http://namespaces.zope.org/i18n"
xmlns:browser="http://namespaces.zope.org/browser"
xmlns:i18n="http://namespaces.zope.org/i18n"
i18n_domain="kitconcept.intranet"
>

Expand All @@ -25,12 +25,12 @@
<include package=".behaviors" />
<include package=".services" />

<browser:page
allowed_attributes="scale tag"
class="plone.namedfile.scaling.NavigationRootScaling"
for="plone.app.layout.navigation.interfaces.INavigationRoot"
name="images"
permission="zope2.View"
/>
<browser:page
name="images"
for="plone.app.layout.navigation.interfaces.INavigationRoot"
class="plone.namedfile.scaling.NavigationRootScaling"
allowed_attributes="scale tag"
permission="zope2.View"
/>

</configure>
3 changes: 1 addition & 2 deletions backend/src/kitconcept/intranet/services/navroot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from kitconcept.intranet.interfaces import IBrowserLayer
from plone.restapi.services import Service
from plone.restapi.services.navroot.get import Navroot
Expand All @@ -21,7 +20,7 @@
@adapter(Interface, IBrowserLayer)
class CustomNavroot(Navroot):
def filterAttributes(self, data):
return {key: data.get(key) for key in data.keys() if key in SETTINGS}
return {key: data.get(key) for key in data if key in SETTINGS}

def __call__(self, expand=False):
result = super().__call__(expand)
Expand Down
3 changes: 3 additions & 0 deletions frontend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ help: ## Show this help
@echo -e "$$(grep -hE '^\S+:.*##' $(MAKEFILE_LIST) | sed -e 's/:.*##\s*/:/' -e 's/^\(.\+\):\(.*\)/\\x1b[36m\1\\x1b[m:\2/' | column -c2 -t -s :)"

# Dev Helpers
.PHONY: clean
clean: ## Clean up environment
rm -Rf core node_modules packages/volto-light-theme packages/volto-intranet/node_modules

.PHONY: install
install: ## Installs the add-on in a development environment
Expand Down

0 comments on commit 3e814ba

Please sign in to comment.