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

[CWM] Add new widget to manage multi status selection lists #1029

Merged
merged 5 commits into from Mar 12, 2020

Conversation

dgdavid
Copy link
Member

@dgdavid dgdavid commented Mar 11, 2020

Introduces a new RichText based widget to mange the multi stats selection,

Providing following features:

  • Allow to select more than one item.
  • Able to represent multiple statuses: no selected, selected, auto selected.
  • Able to represent disabled items.
  • Emit different events to distinguish the interaction through check box input or its label.
  • Automatic text wrapping.
  • Keep the vertical scroll.

Related to

@coveralls
Copy link

coveralls commented Mar 11, 2020

Coverage Status

Coverage increased (+0.2%) to 31.028% when pulling ec99045 on cwm/multi_state_selector into c9d8c2b on master.

Comment on lines +440 to +469
# Returns style rules for the text
#
# @return [String] the status text representation
def text_style
"text-decoration: none; color: #{color}"
end

# Determines the color for the text
#
# @return [String] "grey" for a disabled item;
# "white" when enabled and running in installation mode;
# "black" otherwise
def color
return "grey" unless enabled?
return "white" if installation?

"black"
end

# Determines whether running in installation mode
#
# We do not use Stage.initial because of firstboot, which runs in 'installation' mode
# but in 'firstboot' stage.
#
# @return [Boolean] Boolean if running in installation or update mode
def installation?
Yast::Mode.installation || Yast::Mode.update
end
end
Copy link
Member Author

Choose a reason for hiding this comment

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

Question: could we simply use a class attribute for those links and properly style them via .qss? Or is not possible because they are inside a RichText?

@lslezak, @shundhammer 👆 👆

@dgdavid dgdavid force-pushed the cwm/multi_state_selector branch 4 times, most recently from a2235cd to 3cfa657 Compare March 11, 2020 14:59
@@ -34,6 +34,10 @@ module CWM
#
# If you want to see it in action, have a look at yast2-registration or yast2-packager modules.
#
# TODO: make possible to use it more than once in the same dialog, maybe by using the parent
# widget_id as a prefix for the event_id. See {CWM::MultiStatusSelector#handle} and
# {CWM::MultiStatusSelector::Item.event_id}.
Copy link
Member

Choose a reason for hiding this comment

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

yep, widget id as prefix for item sounds reasonable for me.

Copy link
Member Author

Choose a reason for hiding this comment

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

Perfect!

Let's keep the TODO there for the next iteration 🙄

Providing following features:

  - Allow to select more than one item.
  - Able to represent multiple statuses: no selected, selected, auto selected.
  - Able to represent disabled items.
  - Emit different events to distinguish the interaction through check box input or its label.
  - Automatic text wrapping.
  - Keep the vertical scroll.
@dgdavid dgdavid merged commit 3fde5fc into master Mar 12, 2020
@dgdavid dgdavid deleted the cwm/multi_state_selector branch March 12, 2020 09:56
@yast-bot
Copy link
Contributor

✔️ Public Jenkins job #189 successfully finished
✔️ Created OBS submit request #784242

@yast-bot
Copy link
Contributor

✔️ Internal Jenkins job #88 successfully finished
✔️ Created IBS submit request #213786

dgdavid added a commit to yast/yast-registration that referenced this pull request Mar 12, 2020
dgdavid added a commit to yast/yast-registration that referenced this pull request Mar 12, 2020
dgdavid added a commit to yast/yast-registration that referenced this pull request Mar 12, 2020
dgdavid added a commit to yast/yast-packager that referenced this pull request Mar 12, 2020
dgdavid added a commit to yast/yast-packager that referenced this pull request Mar 12, 2020
dgdavid added a commit to yast/yast-packager that referenced this pull request Mar 13, 2020
dgdavid added a commit to yast/yast-packager that referenced this pull request Mar 26, 2020
This reverts changes introduced in 4.2.59, which were an attempt to
revamp the addons selection by using a RichText based selector widget.
Finally, it does not play as well as expected since it seems to "trade
one problem to another".

To read more, see:

* yast/yast-yast2#1029
* #515
* https://bugzilla.suse.com/show_bug.cgi?id=1167523#c10
dgdavid added a commit that referenced this pull request Mar 26, 2020
This removes no longer needed RichText based selector widget, which was
introduced in version 4.2.72 and polished in later in subsequent
versions.

To read more, see

* #1029 (4.2.72)
* #1031 (4.2.73)
* #1032 (4.2.74)
* #1035 (4.2.77)

and

* https://bugzilla.suse.com/show_bug.cgi?id=1167523#c10
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.

None yet

4 participants