Skip to content

feat(ui5-dialog): introduce resizable property #2301

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

Merged
merged 5 commits into from
Oct 10, 2020
Merged

feat(ui5-dialog): introduce resizable property #2301

merged 5 commits into from
Oct 10, 2020

Conversation

georgimkv
Copy link
Contributor

Part of #2082

@georgimkv georgimkv closed this Oct 6, 2020
@georgimkv georgimkv reopened this Oct 6, 2020
Copy link
Contributor

@fifoosid fifoosid left a comment

Choose a reason for hiding this comment

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

I have added a couple of comments. Overall looks good to me. One more thing should be added anyway. It is the min-height for the content of the dialog. As much as I can see from the spec it should be as follows:

  • min-height: 2.75rem for Cozy
  • min-height: 2.5rem for Compact

onBeforeRendering() {
this.onPhone = isPhone();
this.onDesktop = isDesktop();
}

onEnterDOM() {
this._isRTL = this.effectiveDir === "rtl";
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure that this is the best place to set the RTL, because the direction can be changed multiple times after the component has entered the DOM. A better solution might be to put it in the onBeforeRendering method for example.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved it to occur in onBeforeRendering. In the future, it might be better to do this check centrally (once) before all the ui5-webcomponents are rendered. I see a few web components are already doing this very same check, so it's fair to attempt to remove the duplication.


this._initialX = event.clientX;
this._initialY = event.clientY;
this._initialWidth = Number.parseFloat(width);
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use the global function parseFloat as it is natively supported by IE. This way babel would not have to transform it when it comes to the es5 build

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added a seperate pull request to add support for Number.parseFloat #2302

@@ -80,6 +80,36 @@ describe("Dialog general interaction", () => {

browser.keys("esc");
});

it.only("resizable", () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

it("resizable", () => {

Currently this is the only test that is being run from the whole page. After removing the keyword only, all the tests would be run. As much as I can see, the resizable dialog is initially opened. This might be a problem for the other tests. The best solution would be if all the dialogs are initially closed and in the test you open the needed dialog.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I forgot to remove this it.only. I also removed the setTimeout on Dialog.html to restore the other tests as well.

@ilhan007 ilhan007 dismissed fifoosid’s stale review October 10, 2020 12:11

outdated - comments have been resolved

@ilhan007 ilhan007 merged commit 8be4048 into SAP:master Oct 10, 2020
ilhan007 pushed a commit that referenced this pull request Oct 17, 2020
ilhan007 pushed a commit that referenced this pull request Nov 11, 2020
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.

3 participants