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

[Edit] Switch other edit actions to mct-control #1204

Merged
merged 2 commits into from Oct 5, 2016
Merged

[Edit] Switch other edit actions to mct-control #1204

merged 2 commits into from Oct 5, 2016

Conversation

ghost
Copy link

@ghost ghost commented Sep 24, 2016

Went back to the edit menu cause it felt like I left the prev issue unfinished. Fixes #1198

There's a bit of a logic change. This here:

ng-class="{ major: $index === 0 && saveActions.length === 0 }"

Was not kept. Used to be major: $index === 0 before the save button dropdown changes, but back then there was no separation between save actions and other actions, so I'm almost certain that it was just so that the save button shows up as major.

Now that the save buttons show up as major anyway and are first in the menu, this doesn't seem to be useful anymore. It can only be useful if we have an edit context where we don't allow the user to save changes (no save actions available), which is something that doesn't make much sense (unless we add something like auto-saved objects?).

It can be brought back pretty easily if needed, via cssclass: currentAction.getMetadata().cssclass + ($index === 0 && saveActions.length === 0 ? ' major' : '') but if it's a condition that will/should never pass in practice, I'd rather we just removed it entirely.

Thoughts?

Author Checklist

Changes address original issue? - Y
Unit tests included and/or updated with changes? - N/A, it's a markup change
Command line build passes? - Y
Changes have been smoke-tested? - Y

@VWoeltjen VWoeltjen added this to the Rajaniemi milestone Sep 26, 2016
@VWoeltjen VWoeltjen self-assigned this Sep 26, 2016
<mct-control key="'button'"
structure="{
text: currentAction.getMetadata().name,
click: currentAction.perform,
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd do this as currentAction.perform.bind(currentAction) so that the action being invoked has an appropriate this. I would expect this to work currently because LoggingActionDecorator reassigns perform on actions at the instance level, but if that is ever refactored/removed it could cause problems here.

Copy link
Author

@ghost ghost Sep 27, 2016

Choose a reason for hiding this comment

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

Good catch, also updated the original mct-button. I had to go with a bit of indirection to do it because Angular seems to dislike seeing calls to bind, apply & co. in expressions.

@VWoeltjen
Copy link
Contributor

Reviewer Checklist

  1. Changes appear to address issue? Y
  2. Appropriate unit tests included? N/A (change is markup only)
  3. Code style and in-line documentation are appropriate? Y
  4. Commit messages meet standards? Y

Thanks!

@VWoeltjen VWoeltjen merged commit 8a00181 into nasa:master Oct 5, 2016
@ghost ghost deleted the mct1198 branch October 5, 2016 05:12
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.

1 participant