Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page edit: Add editing of tags #2078

Merged
merged 3 commits into from
Sep 22, 2023
Merged

Conversation

Davek145
Copy link
Contributor

@Davek145 Davek145 commented Sep 19, 2023

Closes #2077.

This PR adds ability to add / change / remove Tags to Pages via MainUI.
It is using existing tag-input.vue component similar as UI for Items and Rules.

Signed-off-by: David Kesl <[email protected]>

Signed-off-by: Davek145 <[email protected]>
@Davek145 Davek145 requested a review from a team as a code owner September 19, 2023 21:56
Copy link
Contributor

@florian-h05 florian-h05 left a comment

Choose a reason for hiding this comment

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

Funny how small the world is 😂

I’ve just read your community post about your fork of my multiuser proxy (I will have a to take a closer look at it, I’m curious) — BTW I am really happy to have it forked by someone — and started to read the README and read something about a PR.

After abandoning this project (mostly because I did not really need it) I slowly started contributing to openHAB, and so I’m here now as a UI maintainer and I can review your PR:

For consistency I would prefer to have the tag input separate from the name, label etc. — the same as for rules etc.
Implementation:

<f7-col v-if="(isEditable || rule.tags.length > 0) && (!createMode || !hasTemplate)">
<f7-block-title>Tags</f7-block-title>
<semantics-picker v-if="isEditable" :item="rule" />
<tag-input :item="rule" :disabled="!isEditable" />
</f7-col>

Next, the tags should be shown on the https://github.com/openhab/openhab-webui/blob/cf3b21857187fb288b2db521652d5d7b778bbfd7/bundles/org.openhab.ui/web/src/pages/settings/pages/pages-list.vue, for implementation see:

<div slot="footer">
<f7-chip v-for="tag in rule.tags.filter((t) => t !== 'Script' && t !== 'Scene')" :key="tag" :text="tag" media-bg-color="blue" style="margin-right: 6px">
<f7-icon slot="media" ios="f7:tag_fill" md="material:label" aurora="f7:tag_fill" />
</f7-chip>
</div>

@Davek145
Copy link
Contributor Author

Davek145 commented Sep 20, 2023

Hi Florian. Yes, I have noticed you being now UI maintainer. And you are right, this PR is there because I realized the need when adjusting the multi-user proxy.

For consistency I would prefer to have the tag input separate from the name, label etc. — the same as for rules etc.

Yes, I understand. This is what I have started with. But it did not look good in the Page designer given the dynamic part below this template. That is why in the end I have choosen the accordion. But no problem to make ti separate again. I will just welcome your help in adjusting the vue template, so it works and looks good.
I will make separate branch with my prior version that had the tag edit separated from name / label and ask you to take a look.

Next, the tags should be shown on the https://github.com/openhab/openhab-webui/blob/cf3b21857187fb288b2db521652d5d7b778bbfd7/bundles/org.openhab.ui/web/src/pages/settings/pages/pages-list.vue

This is actually already there. All tags are showing in Pages list already now. Including those added by API or via my PR.

@florian-h05
Copy link
Contributor

I will make separate branch with my prior version that had the tag edit separated from name / label and ask you to take a look.

Well, let’s see what looks better then.
I will be back home this evening, so I should be able to have a look today or tomorrow

This is actually already there. All tags are showing in Pages list already now. Including those added by API or via my PR.

Yeah, I did not expect that, but I’ve checked the code and it is indeed there.

@Davek145
Copy link
Contributor Author

Thanks
Here is second version with separated tag edit from the name / label. Take a look at which you like more and I will change it in the PR.
https://github.com/openhab/openhab-webui/compare/main...Davek145:openhab-webui:added-pages-tag-edit-v2?diff=unified

Signed-off-by: Florian Hotze <[email protected]>
Copy link
Contributor

@florian-h05 florian-h05 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!
The accordion tag input looks way better than the separate one.

I think we can omit the "Non-Semantic", I have removed this.

@florian-h05 florian-h05 changed the title Add editing of Tags for MainUI Pages Page edit: Add editing of tags Sep 22, 2023
@florian-h05 florian-h05 added enhancement New feature or request main ui Main UI labels Sep 22, 2023
@florian-h05 florian-h05 added this to the 4.1 milestone Sep 22, 2023
@florian-h05
Copy link
Contributor

florian-h05 commented Sep 22, 2023

@Davek145 I just wanted to merge this, however I have noted that you made your commits using a GitHub no-reply mail address. This is no problem in general, however does DCO require a mail address under which you are actually reachable.

Can you please comment a sign-off line that is valid according to https://www.openhab.org/docs/developer/contributing.html#sign-your-work?

@Davek145
Copy link
Contributor Author

@Davek145 I just wanted to merge this, however I have noted that you made your commits using a GitHub no-reply mail address. This is no problem in general, however does DCO require a mail address under which you are actually reachable.

@florian-h05, this commit is having Sign-off using valid email address as well. You are right that there is also the no-reply address next to it. I have fixed my github settings, so it will not be adding this no-reply sign-off when I make these small commits from webedit. What exactly do you mean by "Can you please comment a sign-off line"? As you made the change in the code I do not want to edit the original commit. Sorry, I have not used Github for more than a decade, so getting back into using it.

@florian-h05
Copy link
Contributor

Sorry, I have just checked your commit message and the first Sign Off from the first commit is fine. GitHub however selects the last sign off line when proposing a message for the merge, so I did not see that sign off.

Everything is fine, thank you for the hint!

@florian-h05 florian-h05 merged commit 6fd82e3 into openhab:main Sep 22, 2023
4 checks passed
@lolodomo
Copy link
Contributor

lolodomo commented Sep 22, 2023

Just to be clear, does this PR adds the ability to manage custom tags?

@Davek145
Copy link
Contributor Author

Yes, what ever Tags you want to put in. Same as for Rules, Items ...
PR is just adding UI. The functionality is the one available by REST API.

@florian-h05 florian-h05 changed the title Page edit: Add editing of tags Page edit: Add editing of custom tags Sep 22, 2023
@lolodomo
Copy link
Contributor

Cool, I will test that during the weekend.

@lolodomo
Copy link
Contributor

Is it possible to have a screenshot showing how it looks like?

@lolodomo
Copy link
Contributor

I just installed the very last version but I do not find any new page to manage tags.
image

@florian-h05 florian-h05 changed the title Page edit: Add editing of custom tags Page edit: Add editing of tags Sep 23, 2023
@florian-h05
Copy link
Contributor

This PR is not about having a page to edit the semantic model, it adds the ability to add and remove tags for pages.

@Davek145
Copy link
Contributor Author

Sorry @lolodomo, I did not understand your question correctly. As said by @florian-h05, my PR is about non-semantic tags and ability to add / remove them for pages via UI. Similar to what is already possible for Rules and Items.
If you are looking for the ability to change custom semantic tags, than it is possible now with OH4. I like it very much and have already expanded my semantic model given the fact I have quite sizable OH instance. But as of now, my understanding is it is still possible only via /rest/tags .
If nobody is working on UI for this yet, which I understood from forum discussions may be the case, I can take a look at it later. But it will take some time. I'm now finishing some other UI enhancements for non-semantic tags.

JustinGeorgi pushed a commit to JustinGeorgi/openhab-webui that referenced this pull request Sep 24, 2023
Closes openhab#2077.

This PR adds ability to add / change / remove Tags to Pages via MainUI.
It is using existing tag-input.vue component similar as UI for Items and
Rules.

---------

Also-by: Florian Hotze <[email protected]>
Signed-off-by: David Kesl <[email protected]>
Signed-off-by: jgeorgi <[email protected]>
JustinGeorgi pushed a commit to JustinGeorgi/openhab-webui that referenced this pull request Sep 24, 2023
Closes openhab#2077.

This PR adds ability to add / change / remove Tags to Pages via MainUI.
It is using existing tag-input.vue component similar as UI for Items and
Rules.

---------

Also-by: Florian Hotze <[email protected]>
Signed-off-by: David Kesl <[email protected]>
Signed-off-by: jgeorgi <[email protected]>
digitaldan pushed a commit to digitaldan/openhab-webui that referenced this pull request Sep 24, 2023
Closes openhab#2077.

This PR adds ability to add / change / remove Tags to Pages via MainUI.
It is using existing tag-input.vue component similar as UI for Items and
Rules.

---------

Also-by: Florian Hotze <[email protected]>
Signed-off-by: David Kesl <[email protected]>
florian-h05 pushed a commit that referenced this pull request Sep 26, 2023
Closes #2086

- Adds Non-semantic tags to Items list (e.g. /settings/items/)
consistently with similar list of Rules / Scripts / Pages.
- Extends `getItemTypeAndMetaLabel` with relatesTo part of Semantic
classification and moves it to a mixin.
- Fixes incorrect calculation of vue virtual box height on Items list.
- Replaces custom tag input with accordion tag input (inspired by
#2078) and show number of
tags (inspired by #2083).
- Moves the custom tag input to `item-form.vue`, so it is available also
in Model view, when creating Item from Thing etc.

Also-by: Florian Hotze <[email protected]>
Signed-off-by: David Kesl <[email protected]>
florian-h05 added a commit that referenced this pull request Dec 7, 2023
- Refactor rule & scene settings into rule-general-settings Vue
component and use this component on rule-edit, scene-edit pages and
inside script-general-settings component.
- Replace semantic tag picker & custom tag input with accordion tag
input (inspired by #2078) and show number of tags.
- Refactor shared code from rules & scenes into mixin
(`rule-edit-mixin.js`).
- Fix Scene tag is not hidden from tag input.
- Show number of tags on page settings page, follow up for #2078.

---------

Signed-off-by: Florian Hotze <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request main ui Main UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[MainUI] Editing of Tags for MainUI Pages
3 participants