-
Notifications
You must be signed in to change notification settings - Fork 272
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
feat(ui5-view-settings-dialog): introduce filter section #3616
Conversation
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.
Yet to review the VSD.js
@@ -173,7 +173,7 @@ WIZARD_NAV_ARIA_ROLE_DESCRIPTION = Wizard | |||
WIZARD_NAV_STEP_DEFAULT_HEADING=Step | |||
|
|||
#XTIT: View Settings Dialog dialog title for Sort |
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.
Why do we change the title?
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.
Because previously it was with wrong text
</ui5-view-settings-dialog> | ||
|
||
<script> | ||
btnOpenDialog.addEventListener("click", function () { | ||
vsd.show(); | ||
}); | ||
vsd.addEventListener("confirm", function(evt) { | ||
alert("OK button clicked, returned info is: " + JSON.stringify(evt.detail)); | ||
// alert("OK button clicked, returned info is: " + JSON.stringify(evt.detail)); |
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.
Which of these two should we use? We can remove the other one
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.
Done
get _dialogTitle method in ViewSettingsDialog.js file returns "Sort" in all cases, even if we are on Filtering page. |
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.
I also see a lot of nested loops, can we think of a cheaper solution? ( If already checked, It's okay.)
} | ||
} | ||
|
||
filter.additionalText = !selectedCount ? "" : selectedCount; |
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.
IMO: It's more intuitive to be selectedCount ? selectedCount : "". But it's okay in this way too.
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.
It is like this because of the linter
sortOrderSelected = this._sortOrder.getSelectedItems(), | ||
sortBySelected = this._sortBy.getSelectedItems(); | ||
return { | ||
sortOrder: JSON.parse(JSON.stringify(this.initSortOrderItems)), |
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.
Why we go through this? Could we just use this.initSortOrderItems object the way it is?
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.
No, we can't use it because it would be a shallow copy of the object and in this case we need a deep copy as we have nested objects & arrays
@@ -346,28 +595,39 @@ class ViewSettingsDialog extends UI5Element { | |||
* @param {Object} settings | |||
*/ | |||
_restoreSettings(settings) { | |||
const sortOrderSelected = settings.sortOrder && settings.sortOrder.innerText, | |||
sortBySelected = settings.sortBy && settings.sortBy.innerText; | |||
this._currentSettings = JSON.parse(JSON.stringify(settings)); |
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.
Why do we need these conversions?
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.
Already explained
I have no more comments. |
|
||
/** | ||
* Defines the <code>filterItems</code> list. | ||
* @type {sap.ui.webcomponents.fiori.ListItem} |
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.
Here we say use @type {sap.ui.webcomponents.fiori.ListItem}, but it's not entirely right.
The type is different now - FilterItem for filterItems and SortItem for sortItems. Also, I recommend adding a jsdoc to let the users know they need to import the SortItem, FIlterItem, FilterItemOption, because they are not auto-imported. Could be a note in the slots description or in the overview, or both.
Could you also fix the merge conflict |
Fixes #3451
Fixes #3687
BREAKING CHANGE:
ui5-view-settings-dialog
now usesui5-sort-item
instead ofui5-li
.