Skip to content
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.

feat(spinner) Added spinner on refresh and select2 #1779

Merged
merged 17 commits into from
Oct 19, 2016

Conversation

Jefiozie
Copy link
Contributor

This PR is based on #248 and #1029, needed it for my own and saw that these PR's where still open.
If approved 248 can be closed and maybe 1029 also but there are some other commits there.

@user378230
Copy link
Contributor

I thought the main purpose of the icon would be for async refresh calls so it should check if refreshAttr returns a promise and waits if so, see #1029.

Note: there's no tests either 🙁.

It would be nice to support selectize too if we can, as otherwise this would just mean a new issue gets raised claiming yet another bug in ui-select.

@Jefiozie
Copy link
Contributor Author

Jefiozie commented Aug 23, 2016

You are probably right. Will refacto it and add some tests.

@user378230
Copy link
Contributor

For reference #919 will also be closed.

@Jefiozie
Copy link
Contributor Author

Jefiozie commented Sep 6, 2016

@aaronroberson or @user378230 can you have a look at this? 😄

@Jefiozie
Copy link
Contributor Author

@user378230 did you had have some time to review this?

@ghost
Copy link

ghost commented Oct 16, 2016

@Jefiozie
Copy link
Contributor Author

@danivarga , thank you missed that one.

katemihalikova and others added 4 commits October 19, 2016 07:36
fix 0.17.0 version in changelog
This is a fix for a severe error found using the Google Accessibility Developer Tool audit:
ARIA attributes which refer to other elements by ID should refer to elements which exist in the DOM.
This is a fix for a severe error found using the Google Accessibility Developer Tool audit:
Elements with ARIA roles must ensure required owned elements are present
This is a fix for a severe error found using the Google Accessibility Developer Tool audit:
Elements with ARIA roles must ensure required owned elements are present
@aaronroberson
Copy link
Contributor

@Jefiozie Can you resolve the merge conflicts and I'll get this merged in right away?

CMircea and others added 6 commits October 19, 2016 07:50
Setting clickTriggeredSelect to true for "touchend" events fixes an issue I've encoutered when using this property in a search box (using ui-select-match and ui-select-choices), where we couldn't distinguish typing from clicking on an autocomplete result on mobile devices.
@Jefiozie
Copy link
Contributor Author

@aaronroberson , Everything is fine.. but for some reason I added the other commits. Any thoughts on how to fix it? Don't know what happend exactly.

@aaronroberson aaronroberson merged commit 10a60fa into angular-ui:master Oct 19, 2016
@aaronroberson
Copy link
Contributor

@Jefiozie The conflicts appear to be resolved now and I've gone ahead and merged.

@Jefiozie Jefiozie deleted the spinner branch October 20, 2016 07:54
@Jefiozie
Copy link
Contributor Author

@aaronroberson can you close #1029, #919, #248?

var refreshPromise = $scope.$eval(refreshAttr);
if (refreshPromise && angular.isFunction(refreshPromise.then) && !ctrl.refreshing) {
ctrl.refreshing = true;
refreshPromise.then(function() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't you take into account the rejection case?
I think the best fit it will be something like

refreshPromise.finally(function() {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bogdanalexe90 made a new PR with the adjustments.

@shyamal890
Copy link

shyamal890 commented Oct 26, 2016

I think instead of adding spinner it would be great if only a div is made visible when refreshAttr = true. Developers can then add whatever they want inside that div. Will make the library much more extensible.

@Jefiozie
Copy link
Contributor Author

@bogdanalexe90 , you are probably right will have a look at it Thanks for the feedback!.

@shyamal890 , interesting and people can then change the div in html with the style they like?

@shyamal890
Copy link

shyamal890 commented Oct 26, 2016

@Jefiozie Exactly! people can then change content inside the div and its style in whatever way they want.

Something like:

<ui-select-choices refresh="paCtrl.SearchList($select.search)" 
                              refresh-delay="800" 
                              refreshing="paCtrl.searching"
                              repeat="t as t in paCtrl.filterSearchList($select.search) track by t.Id">
              <div ng-bind-html="t.Name | highlight: $select.search"></div>
              <small>
                     <span ng-bind-html="t.Something | highlight: $select.search"></span>
              </small>
              <div ui-select-refresh>
                        //Where user can put in whatever they want
              </div>
</ui-select-choices>

@Jefiozie
Copy link
Contributor Author

@shyamal890 I can change it as describe above but shouldn't there be a out of the box working solution? If I change it to the above behavior everybody needs to make adjustments instead of just using it as is? And if people want to make adjustments isn't it better that they use a custom theme?

@shyamal890
Copy link

shyamal890 commented Oct 28, 2016

@Jefiozie Hmm, I guess it should be something like this:

Expect for refreshAttr there should be a customRefreshAttr. When customRefreshAttr = true then and then only the code below will take effect otherwise a default loading div is shown

              <div ui-select-refresh>
                        //Where user can put in whatever they want
              </div>

What do you think?

@Jefiozie
Copy link
Contributor Author

Jefiozie commented Nov 4, 2016

I still believe the implementation as it is now is a good solution. People van use custom theme for custom behaviour/style

@user378230
Copy link
Contributor

I still believe the implementation as it is now is a good solution. People van use custom theme for custom behaviour/style

Agreed.

kboga pushed a commit to kboga/ui-select that referenced this pull request Nov 29, 2016
* Added the select2 spinner on updating

* Added bootstrap refreshicon

* changed func. and added tests

* docs(README): fix angular-sanitize typo

"i" was missing in the name of "Angular-Sanitze"

* feat(selectize): add support for multiple selection 

Closes angular-ui#295, closes angular-ui#1787

* Fix: Quotation mark error

* Update CHANGELOG.md (angular-ui#1816)

fix 0.17.0 version in changelog

* fix: ensure aria-activedescendant is correct

This is a fix for a severe error found using the Google Accessibility Developer Tool audit:
ARIA attributes which refer to other elements by ID should refer to elements which exist in the DOM.

* fix: only apply listbox role when open

This is a fix for a severe error found using the Google Accessibility Developer Tool audit:
Elements with ARIA roles must ensure required owned elements are present

* fix(bootstrap): add search role

This is a fix for a severe error found using the Google Accessibility Developer Tool audit:
Elements with ARIA roles must ensure required owned elements are present

* feature(touch): set clickTriggeredSelect to true for touchend events

Setting clickTriggeredSelect to true for "touchend" events fixes an issue I've encoutered when using this property in a search box (using ui-select-match and ui-select-choices), where we couldn't distinguish typing from clicking on an autocomplete result on mobile devices.

* Added the select2 spinner on updating

* Added bootstrap refreshicon

* changed func. and added tests

* Fix: Quotation mark error
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.