user activity link to payments

This commit is contained in:
Rimian Perkins 2019-12-13 13:44:25 +11:00
parent 53ed40bfc3
commit 8264930e92
8 changed files with 28 additions and 3 deletions

View File

@ -92,8 +92,13 @@ export default Ember.Controller.extend({
bootbox.alert(result.error.message || result.error);
} else {
this.alert(`${type}.success`);
const success_route = this.planTypeIsSelected
? "user.subscriptions"
: "userActivity.payments";
this.transitionToRoute(
"user.subscriptions",
success_route,
Discourse.User.current().username.toLowerCase()
);
}

View File

@ -0,0 +1,6 @@
export default {
resource: "user.userActivity",
map() {
this.route("payments");
}
};

View File

@ -0,0 +1,7 @@
import Route from "@ember/routing/route";
export default Route.extend({
model() {
console.log(999);
}
});

View File

@ -0,0 +1,3 @@
{{#link-to 'userActivity.payments'}}
{{d-icon "credit-card"}} {{i18n 'discourse_subscriptions.navigation.user_activity.payments'}}
{{/link-to}}

View File

@ -0,0 +1,3 @@
PAYMENTS

View File

@ -21,7 +21,8 @@ en:
navigation:
subscriptions: Subscriptions
subscribe: Subscribe
billing: Billing
user_activity:
payments: Payments
plans:
purchase: Purchase a subscription
select: Select subscription plan

View File

@ -24,5 +24,6 @@ DiscourseSubscriptions::Engine.routes.draw do
resources :products, only: [:index, :show]
resources :subscriptions, only: [:create]
get '/' => 'patrons#index'
get '/:id' => 'patrons#index'
end

View File

@ -1,5 +1,4 @@
import componentTest from "helpers/component-test";
import EmberObject from "@ember/object";
moduleForComponent("payment-options", { integration: true });