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
Conversation
680fed8
to
127d60b
Compare
# 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 |
There was a problem hiding this comment.
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 👆 👆
a2235cd
to
3cfa657
Compare
@@ -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}. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
08c1863
to
ec99045
Compare
✔️ Public Jenkins job #189 successfully finished |
✔️ Internal Jenkins job #88 successfully finished |
Based on CWM::MultiStatusSelector, recently added in yast2 4.2.72 See - yast/yast-yast2#1029 - https://github.com/yast/yast-yast2/blob/master/library/cwm/src/lib/cwm/multi_status_selector.rb
Based on CWM::MultiStatusSelector, recently added in yast2 4.2.72 See - yast/yast-yast2#1029 - https://github.com/yast/yast-yast2/blob/master/library/cwm/src/lib/cwm/multi_status_selector.rb
Based on CWM::MultiStatusSelector, recently added in yast2 4.2.72 See - yast/yast-yast2#1029 - https://github.com/yast/yast-yast2/blob/master/library/cwm/src/lib/cwm/multi_status_selector.rb
Based on CWM::MultiStatusSelector, recently added in yast2 4.2.72 See - yast/yast-yast2#1029 - https://github.com/yast/yast-yast2/blob/master/library/cwm/src/lib/cwm/multi_status_selector.rb
Based on CWM::MultiStatusSelector, recently added in yast2 4.2.72 See - yast/yast-yast2#1029 - https://github.com/yast/yast-yast2/blob/master/library/cwm/src/lib/cwm/multi_status_selector.rb
Based on CWM::MultiStatusSelector, recently added in yast2 4.2.72 See - yast/yast-yast2#1029 - https://github.com/yast/yast-yast2/blob/master/library/cwm/src/lib/cwm/multi_status_selector.rb
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
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
Introduces a new RichText based widget to mange the multi stats selection,
Related to