Skip to content

Commit

Permalink
Exercício 36
Browse files Browse the repository at this point in the history
  • Loading branch information
jadirj committed Oct 15, 2024
1 parent 97eaa77 commit db7fa3e
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/src/trepr/intranet/profiles/default/metadata.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<version>1006</version>
<version>1007</version>
<dependencies>
<dependency>profile-plone.volto:default</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<registry xmlns:i18n="http://xml.zope.org/namespaces/i18n"
i18n:domain="trepr.intranet"
>

<!-- Area -->
<records interface="plone.app.querystring.interfaces.IQueryField"
prefix="plone.app.querystring.field.area"
>
<value key="title"
i18n:translate="label_area"
>Área</value>
<value key="description"
i18n:translate="description_area"
>Filtrar por Área.</value>
<value key="enabled">True</value>
<value key="sortable">False</value>
<value key="group"
i18n:translate=""
>Intranet</value>
<value key="operations">
<element>plone.app.querystring.operation.selection.any</element>
</value>
<value key="vocabulary">trepr.intranet.vocabulary.areas</value>
</records>

<!-- Cargo -->
<records interface="plone.app.querystring.interfaces.IQueryField"
prefix="plone.app.querystring.field.cargo"
>
<value key="title"
i18n:translate="label_cargo"
>Cargo</value>
<value key="description"
i18n:translate="description_cargo"
>Filtrar por cargo.</value>
<value key="enabled">True</value>
<value key="sortable">False</value>
<value key="group"
i18n:translate=""
>Intranet</value>
<value key="operations">
<element>plone.app.querystring.operation.selection.any</element>
</value>
<value key="vocabulary">trepr.intranet.vocabulary.cargos</value>
</records>

</registry>
11 changes: 11 additions & 0 deletions backend/src/trepr/intranet/upgrades/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,15 @@
/>
</genericsetup:upgradeSteps>

<genericsetup:upgradeSteps
profile="trepr.intranet:default"
source="1006"
destination="1007"
>
<genericsetup:upgradeDepends
title="Adiciona filtros por Área e Cargo"
import_steps="plone.app.registry"
/>
</genericsetup:upgradeSteps>

</configure>
2 changes: 1 addition & 1 deletion backend/tests/setup/test_setup_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ def test_browserlayer(self, browser_layers):

def test_latest_version(self, profile_last_version):
"""Test latest version of default profile."""
assert profile_last_version(f"{PACKAGE_NAME}:default") == "1006"
assert profile_last_version(f"{PACKAGE_NAME}:default") == "1007"

0 comments on commit db7fa3e

Please sign in to comment.