ManageIQ / ui-components

Angular UI Components for ManageIQ
Apache License 2.0
16 stars 52 forks source link

[WIP] DialogEditor - angular-ui-bootstrap 2.x compatibility #429

Closed himdel closed 4 years ago

himdel commented 5 years ago

Needed by https://github.com/ManageIQ/manageiq-ui-classic/pull/6449, but can go in standalone.

Since 2.x, angular-ui-bootstrap supports .component in addition to .controller + .template in modals, but that acts very differently (ignores controller and template, and renders the component with a fixed set of args).

The old behaviour still works, but we can't just pass an options object with .component to open. Replacing with an object created with just the relevant options. (So, this is pretty much delete options.component.)

Also changing a "catch any error and ignore it" to at least console.error it, and because of changes in how ng-switch-when interacts with other directives on the same element, transforming the dialog editor template from (simplified):

  .col-sm-5
    %input{ng-switch-when...., ng-model...}
    %select{ng-switch-when..., miq-select...}

to:

  .col-sm-5{ng-switch-when....}
    %input{ng-model...}
  .col-sm-5{ng-switch-when....}
    %select{miq-select...}

And finally fixing the tag control preview to also support multiselect, and the function used to transform values from JSON in the editor to deal with the values already having been transformed (happened when switching a new dropdown to multiselect).

himdel commented 5 years ago

@miq-bot add_label wip

mostly because there is one more dialog editor select issue (entriesChange don't work when the blur goes directly to the select? or maybe just a missing refresh on tab load/switch (seems to help)?), so possibly this should be split differently

(and the description no longer matches the last commit) (moved that change to https://github.com/ManageIQ/ui-components/pull/430)

miq-bot commented 5 years ago

Checked commits https://github.com/himdel/ui-components/compare/c35ee5a813da2f0230a3ca28a335db43873f2406~...b562ac29a9d870c58ffef4f8f03c400a02a30f55 with ruby 2.5.5, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 0 files checked, 0 offenses detected Everything looks fine. :cake:

miq-bot commented 4 years ago

This pull request is not mergeable. Please rebase and repush.

himdel commented 4 years ago

Closing, will be part of ManageIQ/manageiq-ui-classic#6954