Skip to content

Commit

Permalink
Merge pull request #371 from vrk-kpa/REKDAT-225_fix-keyword-facets-in…
Browse files Browse the repository at this point in the history
…-groups-and-orgs

REKDAT-225: add missing IFacets implementations
  • Loading branch information
bzar authored Jan 13, 2025
2 parents 3e88fa6 + 78156a8 commit 35f3fa9
Showing 1 changed file with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from collections import OrderedDict

from flask import request
from typing import Optional

from . import helpers, validators, views
from .logic import action, auth
Expand Down Expand Up @@ -184,7 +185,7 @@ def get_commands(self):

# IFacets

def dataset_facets(self, facets_dict, package_type):
def _facets(self):
lang = helpers.get_lang_prefix()
facets_dict = OrderedDict([
('groups', toolkit._('Groups')),
Expand All @@ -194,6 +195,24 @@ def dataset_facets(self, facets_dict, package_type):
])
return facets_dict

def dataset_facets(self, facets_dict: OrderedDict[str, Any], package_type: str) -> OrderedDict[str, Any]:
return self._facets()

def group_facets(self,
facets_dict: OrderedDict[str, Any],
group_type: str,
package_type: Optional[str]) -> OrderedDict[str, Any]:

facets = self._facets()
del facets['groups']
return facets

def organization_facets(self,
facets_dict: OrderedDict[str, Any],
organization_type: str,
package_type: Optional[str]) -> OrderedDict[str, Any]:
return self._facets()

# IBlueprint

def get_blueprint(self):
Expand Down

0 comments on commit 35f3fa9

Please sign in to comment.