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

Three Dot Menu Prototype #3325

Merged
merged 88 commits into from
Nov 19, 2020
Merged

Three Dot Menu Prototype #3325

merged 88 commits into from
Nov 19, 2020

Conversation

charlesh88
Copy link
Contributor

@charlesh88 charlesh88 commented Aug 26, 2020

Overview

  • Replaced placeholder inline styling;
  • Style for menu's c-menu __section-separator and __section-hint refined;
  • Defined default color for c-icon-buttons;
  • Changed many buttons from c-button to c-icon-button;
  • Make button labels hide/show based on frame size in Layout, and hidden when in a Flexible Layout;
  • Changed Snapshot-related buttons and menus to use icon-camera;
  • Normalized padding for c-icon-buttons;
  • Added a CSS class c-so-view--<domainObject.type> to allow sub-layouts with hidden frames to completely hide their headers and buttons - this is needed to avoid overlap collisions with further sub-objects;
  • Changed button styling in main view to be more in line with 'iconic' approach used elsewhere, enabled button labels where applicable;
  • Better, more consistent hover approach for c-button and c-icon-button controls;
  • Changed Snow theme constant hover filter value for better color matching;
  • Fixed c-object-label type-icon opacity;
  • Changed Snow theme constant for object name to fix inline editing of object name being too dark;

Todos

  • @charlesh88 Make all frames within a Flexible Layout hide frame control labels by default. File issue for enhancement to make this a dynamic evaluation on resize.
  • Menu actions should be edit and browse-specific. Example: "Remove" for an object being edited.

Screen Shot 2020-08-25 at 7 09 26 PM

- [ ] Some menu actions, while properly disabled in the menu, shouldn't be disabled as buttons. Example: "Unmark All Rows"

Screen Shot 2020-08-25 at 7 10 43 PM

deeptailor and others added 24 commits June 10, 2020 16:06
- Replace inline styling;
- Style for c-menu `__section-separator` and `__section-hint` refined;
- Add new `icon-3-dots` glyph;
- Add icomoon config JSON file;
- Add new `icon-3-dots` glyph;
- Add icomoon config JSON file;
- Grid on, grid off and camera;
- Merge in `add-glyphs-082020`;
- Initial styling and hover behavior for Layout frame controls;
- Defined default color for c-icon-buttons;
- Changed buttons from `c-button` to `c-icon-button`;
- Make button labels hide/show based on frame size in Layout;
- Changed Snapshot-related buttons and menus to use `icon-camera`;
- Normalized padding for c-icon-buttons;
- Added a CSS class `c-so-view--<domainObject.type>` to allow
sub-layouts with hidden frames to completely hide their headers and
buttons - this is needed to avoid overlap collisions with further
sub-objects;
- Changed button styling in main view to be more in line with 'iconic'
approach used elsewhere, enabled button labels where applicable;
- Better, more consistent hover approach for `c-button` and
`c-icon-button` controls;
- Changed Snow theme constant hover `filter` value for
better color matching;
- Fixed `c-object-label` type-icon opacity;
- Changed Snow theme constant for object name to fix inline editing of
object name being too dark;
@charlesh88 charlesh88 requested review from deeptailor and removed request for deeptailor August 26, 2020 02:15
- Fixed button title;
Copy link
Contributor

@akhenry akhenry left a comment

Choose a reason for hiding this comment

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

This is looking super cool. This is going to make the user experience SO much nicer, awesome work both of you.

@deeptailor I have some ideas on ways we might be able to simplify the API a little from the developer's perspective. Interested to hear your thoughts.

  1. It would be great if there was just one way of registering an action, irrespective of whether it's an object action or a view action (because it could be both):
openmct.actions.register(actionDefinition);

The appliesTo method would then have the object path and view context passed to it:

appliesTo(objectPath, viewContext) {
}
  1. We should try to find a way of ensuring that views themselves do not have any responsibility for the lifecycle of actions. It will lead to memory leaks.
    One way to do this is to have actions registered once, by the plugin, rather than the view. The view would just hide/show enable/disable the actions as needed.

eg.

// Returns an `ActionCollection` that is scoped to this view instance
let actionsForView = openmct.actions.get(objectPath, viewContext);
actionsForView.disable(['export-marked-rows']);
actionsForView.enable(['unmark-all-rows']);
actionsForView.hide(['expand-columns']);
actionsForView.show(['autosize-columns']);

The object frame could then use the same .get() function to get an ActionCollection:

let actionCollectionForView = openmct.actions.get(objectPath, viewContext);
let listOfActions = actionCollectionForView.list();
let statusBarActions = listOfActions.filter(action => action.showInStatusBar);

The disable, enable, hide, show functions could then trigger an event on the actionCollection
eg.

actionCollection.view.on('change', (updatedListOfActions) => { ... });

The object frame would need to clean up this listener, but that's in platform code (ObjectFrame.vue), view developers would not have to deal with cleaning it up.

- Merge latest master, fix conflicts;
deeptailor and others added 18 commits November 3, 2020 13:48
* wip

* simplifying class applications

* add status to tabs view

* add tests for status API

* fix lint errors

* fix style application in telemetry vue

* CSS and markup refactoring to support addition of 'suspect' telemetry (#3499)

* CSS and markup refactoring to support addition of 'suspect' telemetry

- Significant refactoring of CSS classing: `is-missing` is now
`is-status--missing` and `is-missing__indicator` is now simply
`is-status__indicator`, allowing the wrapping `is-missing--*` class to
control what is displayed;
- New SCSS mixin @isStatus, and changes to mixin @isMissing to support
new `is-status--suspect` class;
- Changed titling for missing objects from 'This item is missing' to
'This item is missing or suspect'. **IMPORTANT NOTE** This is temporary
and should be replaced with a more robust approach to titling that
allows title strings to be defined in configuration and dynamically
applied;
- Refactored computed property `statusClass` across multiple components
to return an empty string when status is undefined - this was
previously erroneously returning `is-undefined` in that circumstance;
- Removed commented code;

* CSS and markup refactoring to support addition of 'suspect' telemetry

- Refinements to broaden capability of `is-status*` mixin;

* fix lint issues

Co-authored-by: Charles Hacskaylo <[email protected]>
- Fix styling for Folder List view;
- 'Dim back' look is now specific to `--missing` and `--suspect`;
- Wired up styling for `is-status--notebook-default`;
@akhenry
Copy link
Contributor

akhenry commented Nov 19, 2020

@deeptailor If you can resolve the conflicts I'll merge this today

@deeptailor
Copy link
Contributor

Closes #3298

@deeptailor
Copy link
Contributor

Author Checklist

Changes address original issue? Yes
Unit tests included and/or updated with changes? Yes
Command line build passes? Yes
Changes have been smoke-tested? Yes
Testing instructions included? Yes, in Issue

@akhenry
Copy link
Contributor

akhenry commented Nov 19, 2020

Reviewer Checklist

  1. Changes appear to address issue? Y
  2. Appropriate unit tests included? N/A - followup
  3. Code style and in-line documentation are appropriate?
  4. Commit messages meet standards? Three dot menu needs unit tests #3525
  5. Has associated issue been labelled unverified? (only applicable if this PR closes the issue)

@akhenry akhenry merged commit 6375ecd into master Nov 19, 2020
@akhenry akhenry deleted the three-dot-menu-proto branch November 19, 2020 17:53
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.

4 participants