-
Notifications
You must be signed in to change notification settings - Fork 383
Expand file tree
/
Copy pathsettings.js
More file actions
56 lines (44 loc) · 1.5 KB
/
settings.js
File metadata and controls
56 lines (44 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import Ember from "ember";
import actionEvented from "../mixins/action-evented";
var actionsMixin = actionEvented('openDeleteModal');
var MarketplaceSettingsController = Ember.ObjectController.extend(actionsMixin, {
needs: ["marketplace"],
can_edit: Ember.computed.alias('production'),
ownerCustomer: Ember.computed.oneWay("marketplace.owner_customer"),
accountsResultsLoader: function() {
if (this.get("owner_customer")) {
return this.get("owner_customer").getAccountsLoader({
limit: 10
});
} else {
return this.get("container").lookup("results-loader:base");
}
}.property("owner_customer"),
fundingInstrumentsResultsLoader: function() {
if (this.get("owner_customer")) {
return this.get("owner_customer").getFundingInstrumentsLoader({
limit: 10
});
} else {
return this.get("container").lookup("results-loader:base");
}
}.property("owner_customer"),
userMarketplace: function() {
var user = this.get('user');
var currentUserMarketplace = user.user_marketplace_for_id(this.get('id'));
return currentUserMarketplace;
}.property('user', 'id'),
marketplaceSecret: Ember.computed.reads("userMarketplace.secret"),
actions: {
changePaymentMethodFilter: function(method) {
this.set("fundingInstrumentsResultsLoader.type", method);
},
reloadApiKeys: function() {
this.get("userMarketplace.marketplaceApiKeys").reload();
},
reloadUsers: function() {
this.get("userMarketplace").reloadMarketplaceUsers();
},
}
});
export default MarketplaceSettingsController;