-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #546 from crossroads/master
#November2019Release1
- Loading branch information
Showing
101 changed files
with
2,467 additions
and
943 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
### Ticket Link: | ||
|
||
NOTE: Specify ticket link | ||
|
||
### What does this PR do? | ||
|
||
FEATURE: Specify feature name | ||
|
||
BUG: Specify bug | ||
|
||
NOTE: Give a description of what this PR does. If it fixes any bug, specify cause of an issue and approach/solution added to fix that issue. | ||
|
||
|
||
### Impacted Areas | ||
|
||
NOTE: List any impacted areas (e.g. Dashboard > My Active Offers > scheduled ) | ||
|
||
|
||
### Screenshots | ||
|
||
NOTE: Attach screeenshots if PR contains any UI changes | ||
|
||
### Mockup Link | ||
|
||
Note: Specify mockup link | ||
|
||
### Linked PR's: | ||
|
||
NOTE: If these changes are related to some existing PR or fixes any issue from existing PR changes, specify PR links. | ||
|
||
### Linked Slack conversation: | ||
|
||
NOTE: IF there is any conversation happened for current changes in any of the slack channel, mention the slack message link. | ||
|
||
### Any Open question(s) or challenge(s): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import Ember from "ember"; | ||
import _ from "lodash"; | ||
import SearchMixin from "stock/mixins/search_resource"; | ||
|
||
/** | ||
* An overlay that pops up from the bottom of the screen, allowing the user | ||
* to search and select a location. | ||
* | ||
* The popup *does not* do anything to the location apart from returning it | ||
* | ||
* @property {boolean} open whether the popup is visible or not | ||
* @property {function} onSelect callback triggered when an order is selected | ||
*/ | ||
export default Ember.Component.extend(SearchMixin, { | ||
searchProps: {}, | ||
autoLoad: true, | ||
store: Ember.inject.service(), | ||
perPage: 10, | ||
|
||
init() { | ||
this._super(...arguments); | ||
this.set("uuid", _.uniqueId("location_search_overlay_")); | ||
}, | ||
|
||
recentlyUsedLocations: Ember.computed("open", function() { | ||
return this.get("store") | ||
.peekAll("location") | ||
.sortBy("recentlyUsedAt") | ||
.slice(0, 10); | ||
}), | ||
|
||
showRecentlyUsed: Ember.computed.not("searchText"), | ||
|
||
actions: { | ||
cancel() { | ||
this.send("selectLocation", null); | ||
this.set("searchText", ""); | ||
}, | ||
|
||
selectLocation(location) { | ||
this.getWithDefault("onSelect", _.noop)(location); | ||
this.set("open", false); | ||
}, | ||
|
||
loadMoreLocations(pageNo) { | ||
const params = this.trimQuery( | ||
_.merge({}, this.getSearchQuery(), this.getPaginationQuery(pageNo)) | ||
); | ||
|
||
return this.get("store").query("location", params); | ||
} | ||
} | ||
}); |
Oops, something went wrong.