Skip to content

Add Keywordmanager utility, services & controlpanel #1

Draft
jnptk wants to merge 65 commits into
mainfrom
keywordmanager
Draft

Add Keywordmanager utility, services & controlpanel #1
jnptk wants to merge 65 commits into
mainfrom
keywordmanager

Conversation

@jnptk
Copy link
Copy Markdown
Member

@jnptk jnptk commented Mar 30, 2026

No description provided.

@jnptk jnptk requested a review from davisagli March 30, 2026 09:03
Copy link
Copy Markdown
Member

@davisagli davisagli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed the REST services, but not the keywordmanager tool or the frontend yet.

@jnptk Is the keywordmanager tool mostly copied from Products.PloneKeywordManager, or are there specific things you changed that you'd like me to check?

Comment thread backend/src/kitconcept/keywordmanager/services/configure.zcml Outdated
Comment thread backend/src/kitconcept/keywordmanager/services/configure.zcml
Comment thread backend/src/kitconcept/keywordmanager/services/delete.py Outdated
Comment thread backend/src/kitconcept/keywordmanager/services/delete.py
Comment thread backend/src/kitconcept/keywordmanager/services/get.py Outdated
Comment thread backend/src/kitconcept/keywordmanager/services/update.py Outdated
Comment thread backend/src/kitconcept/keywordmanager/services/delete.py Outdated
Comment thread backend/src/kitconcept/keywordmanager/services/update.py Outdated
Copy link
Copy Markdown
Member

@davisagli davisagli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to have functional tests for the API endpoints.

@jnptk
Copy link
Copy Markdown
Member Author

jnptk commented Apr 28, 2026

@davisagli how can I get the KeywordIndex a keyword is from to the KeywordView component? It works for now because standard Plone only has the Subject KeywordIndex and the keyword manager falls back to querying this index by default but if a user wants to view a keyword from a different index it won't work because the component doesn't know where the keyword came from so the keyword manager will query the Subject index...

@davisagli
Copy link
Copy Markdown
Member

@jnptk I would change the route for KeywordView to path: '/controlpanel/keyword-manager/:keywordIndex/:id', and pass the index name as part of the path.

<p className="description">
<FormattedMessage
id="keyword-manager-description"
defaultMessage="The Keyword Manager allows you to maintain the keywords used in your intranet. Start by selecting the keyword field you want to manage. You can then sort, filter, rename, merge, or delete individual keywords."
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an add-on that might also be used in sites which are not an intranet.

Suggested change
defaultMessage="The Keyword Manager allows you to maintain the keywords used in your intranet. Start by selecting the keyword field you want to manage. You can then sort, filter, rename, merge, or delete individual keywords."
defaultMessage="The Keyword Manager allows you to maintain the keywords used in your website. Start by selecting the keyword field you want to manage. You can then sort, filter, rename, merge, or delete individual keywords."

selectedKeys !== 'all' && selectedKeys?.size === 0
}
>
<Icon name={replaceSVG} size="20px" />
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a better icon here. I thought this one would reload the listing.

selectedKeys === 'all'
? keywords.items?.map((kw) => kw.name) ?? []
: [...(selectedKeys as Set<string>)],
);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This didn't work when I tested today. The whole page reloaded. You may need to add type="button" or add event.preventDefault() (to avoid accidentally triggering form submission) or add event.stopPropagation() to prevent the event from bubbling up to container elements.

@davisagli
Copy link
Copy Markdown
Member

@jnptk Let me know if you'd like me to take a look at the failing tests.

"""
query = {indexName: keywords}
if context:
query["depth"] = 0
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davisagli I added this so when we have a context we only delete on the context itself and not on children within that context with the same keyword. But we loose exactly that functionality (to be able to do bulk changes within a context) what do you think?

TODO: make this behavior consistent throughout the tools functions

@jnptk
Copy link
Copy Markdown
Member Author

jnptk commented Jun 1, 2026

@davisagli what do you think about my loading indicator solution (see 18641e1) any improvement suggestions or maybe even a whole different idea on how to handle this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants