@posiwise/user-module 0.0.184 → 0.0.185
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -31,7 +31,7 @@ import { Loader } from "@googlemaps/js-api-loader";
|
|
|
31
31
|
import { NgbDatepickerModule, NgbInputDatepicker, NgbModal, NgbModalModule } from "@ng-bootstrap/ng-bootstrap";
|
|
32
32
|
import { __decorate } from "tslib";
|
|
33
33
|
import { AppBaseComponent } from "@posiwise/app-base-component";
|
|
34
|
-
import { AuthService, CommonService, CustomToastService, FormHelperService, GeoService, PermissionService, ProductService, ProfileService, QualificationService, ScriptLoaderService, SubscriptionService, TagService, UserService, ValidationService, hasKnowledgeAlpha } from "@posiwise/common-services";
|
|
34
|
+
import { AuthService, CommonService, CustomToastService, FormHelperService, GeoService, PermissionService, ProductService, ProfileService, QualificationService, ScriptLoaderService, SubscriptionService, TagService, UserService, ValidationService, hasKnowledgeAlpha, isInMobileWebView } from "@posiwise/common-services";
|
|
35
35
|
import { AppUser, POLL_TIMEOUT, PRODUCT_CATEGORY, Project, TAG_ENTITY, TAG_TYPE } from "@posiwise/common-utilities";
|
|
36
36
|
import { HelperService } from "@posiwise/helper-service";
|
|
37
37
|
import { ProfileImageCropperComponent, ValidateForm, appendQueryParam, clearQueryParams } from "@posiwise/utils";
|
|
@@ -241,9 +241,9 @@ var AccountDetailsComponent = class AccountDetailsComponent extends AppBaseCompo
|
|
|
241
241
|
this.validatePasswordBusyButton = true;
|
|
242
242
|
const password = this.passwordRef.nativeElement.value;
|
|
243
243
|
if (password) this.userService.checkPassword({ password }).subscribe((data) => {
|
|
244
|
-
if (data?.status === StatusCodes.OK) this.passwordVerified = true;
|
|
244
|
+
if (data?.result?.status === StatusCodes.OK) this.passwordVerified = true;
|
|
245
245
|
else {
|
|
246
|
-
this.toast.error(data
|
|
246
|
+
this.toast.error(data["error"].message);
|
|
247
247
|
this.passwordRef.nativeElement.value = "";
|
|
248
248
|
}
|
|
249
249
|
this.cdr.markForCheck();
|
|
@@ -271,7 +271,7 @@ var AccountDetailsComponent = class AccountDetailsComponent extends AppBaseCompo
|
|
|
271
271
|
if (response.status_code === 200) {
|
|
272
272
|
this.toast.success(response.message, "", { positionClass: "toast-top-center" });
|
|
273
273
|
this.onTogglePassword();
|
|
274
|
-
} else this.toast.error(response
|
|
274
|
+
} else this.toast.error(response["error"].message);
|
|
275
275
|
this.passwordForm.reset();
|
|
276
276
|
this.cdr.markForCheck();
|
|
277
277
|
}).add(() => {
|
|
@@ -315,7 +315,7 @@ var AccountDetailsComponent = class AccountDetailsComponent extends AppBaseCompo
|
|
|
315
315
|
this.slugBusyButton = true;
|
|
316
316
|
this.userService.updateSlug(this.slug).subscribe((response) => {
|
|
317
317
|
this.toggleNickName = false;
|
|
318
|
-
if (response?.status === StatusCodes.OK) this.getUserProfile();
|
|
318
|
+
if (response?.result?.status === StatusCodes.OK) this.getUserProfile();
|
|
319
319
|
else this.toast.error("User.Account.UserNameError");
|
|
320
320
|
this.cdr.markForCheck();
|
|
321
321
|
}).add(() => {
|
|
@@ -328,7 +328,7 @@ var AccountDetailsComponent = class AccountDetailsComponent extends AppBaseCompo
|
|
|
328
328
|
const filename = `${`${this.slug.toLocaleLowerCase()}_${Date.parse((/* @__PURE__ */ new Date()).toString())}`}.png`;
|
|
329
329
|
const file = new File([blob], filename);
|
|
330
330
|
this.userService.addAvatar(file).subscribe((res) => {
|
|
331
|
-
this.image = res?.user_avatar[2]?.url;
|
|
331
|
+
this.image = res?.result?.user_avatar[2]?.url;
|
|
332
332
|
this.modalService.dismissAll();
|
|
333
333
|
this.cdr.markForCheck();
|
|
334
334
|
});
|
|
@@ -351,7 +351,7 @@ var AccountDetailsComponent = class AccountDetailsComponent extends AppBaseCompo
|
|
|
351
351
|
loadConnections() {
|
|
352
352
|
this.loadingConnections = true;
|
|
353
353
|
this.userService.getMcpConnections().subscribe({ next: (response) => {
|
|
354
|
-
this.connections = response?.
|
|
354
|
+
this.connections = response?.result ?? [];
|
|
355
355
|
this.cdr.markForCheck();
|
|
356
356
|
} }).add(() => {
|
|
357
357
|
this.loadingConnections = false;
|
|
@@ -435,7 +435,7 @@ var AccountDetailsComponent = class AccountDetailsComponent extends AppBaseCompo
|
|
|
435
435
|
}
|
|
436
436
|
performTokenRefresh() {
|
|
437
437
|
this.refreshingTokens = true;
|
|
438
|
-
this.userService.refreshUserApiTokens().subscribe({ next: (response) => {
|
|
438
|
+
this.userService.refreshUserApiTokens().subscribe({ next: ({ result: response }) => {
|
|
439
439
|
if (response && response.api_keys) {
|
|
440
440
|
if (!this.user.api_keys) this.user.api_keys = {};
|
|
441
441
|
if (response.api_keys.api_user_token) this.user.api_keys.api_user_token = response.api_keys.api_user_token;
|
|
@@ -913,7 +913,7 @@ var AddSubscriptionComponent = class AddSubscriptionComponent extends AppBaseCom
|
|
|
913
913
|
}
|
|
914
914
|
getProducts() {
|
|
915
915
|
this.productService.getProductList({}, this.subscriptionId, { only_relevant: true }).subscribe((response) => {
|
|
916
|
-
this.products = response.
|
|
916
|
+
this.products = response.result || [];
|
|
917
917
|
if (this.products?.length) this.products = this.products.filter((x) => x.active);
|
|
918
918
|
this.isLoaded = true;
|
|
919
919
|
this.userStore().subscribe((user) => {
|
|
@@ -1346,11 +1346,11 @@ var SubscriptionCredentialActionsService = class SubscriptionCredentialActionsSe
|
|
|
1346
1346
|
load(subscriptionId) {
|
|
1347
1347
|
return forkJoin({
|
|
1348
1348
|
stored: this.storedCredentials(subscriptionId),
|
|
1349
|
-
types: this.subscriptionService.getAllCredentials().pipe(map$1((r) => r.
|
|
1349
|
+
types: this.subscriptionService.getAllCredentials().pipe(map$1((r) => r.result))
|
|
1350
1350
|
});
|
|
1351
1351
|
}
|
|
1352
1352
|
storedCredentials(subscriptionId) {
|
|
1353
|
-
return this.subscriptionService.getAllSubscriptionCredentials(subscriptionId).pipe(map$1((r) => r.
|
|
1353
|
+
return this.subscriptionService.getAllSubscriptionCredentials(subscriptionId).pipe(map$1((r) => r.result));
|
|
1354
1354
|
}
|
|
1355
1355
|
saveChanged(rows, subscriptionId) {
|
|
1356
1356
|
const requests = changedCredentials(rows).map((row) => {
|
|
@@ -2168,17 +2168,20 @@ var SecondaryPaymentMethodComponent = class SecondaryPaymentMethodComponent {
|
|
|
2168
2168
|
async mountForm(host) {
|
|
2169
2169
|
if (this.provider === "braintree") {
|
|
2170
2170
|
const response = await firstValueFrom(this.subscriptionService.getBraintreeClientToken(this.subscriptionId));
|
|
2171
|
-
await this.braintree.mount(host, response?.data?.client_token);
|
|
2171
|
+
await this.braintree.mount(host, response?.result?.data?.client_token);
|
|
2172
2172
|
return;
|
|
2173
2173
|
}
|
|
2174
2174
|
const response = await firstValueFrom(this.subscriptionService.getAirwallexIntent(this.subscriptionId));
|
|
2175
|
-
await this.airwallex.mount(host, response?.
|
|
2175
|
+
await this.airwallex.mount(host, response?.result);
|
|
2176
2176
|
}
|
|
2177
2177
|
collectCard() {
|
|
2178
2178
|
return this.provider === "braintree" ? this.braintree.requestNonce() : this.airwallex.confirm();
|
|
2179
2179
|
}
|
|
2180
2180
|
register(reference) {
|
|
2181
|
-
return this.provider === "braintree" ? this.subscriptionService.registerBraintreePaymentMethod(this.subscriptionId, reference) : this.subscriptionService.registerAirwallexPaymentMethod(this.subscriptionId, reference)
|
|
2181
|
+
return this.provider === "braintree" ? this.subscriptionService.registerBraintreePaymentMethod(this.subscriptionId, reference).pipe(map(({ result }) => result)) : this.subscriptionService.registerAirwallexPaymentMethod(this.subscriptionId, reference).pipe(map(({ result, message }) => ({
|
|
2182
|
+
data: result,
|
|
2183
|
+
message
|
|
2184
|
+
})));
|
|
2182
2185
|
}
|
|
2183
2186
|
teardown() {
|
|
2184
2187
|
this.braintree.teardown();
|
|
@@ -2359,12 +2362,12 @@ var UpdatePaymentDetailsComponent = class UpdatePaymentDetailsComponent extends
|
|
|
2359
2362
|
paymentMethods: this.subscriptionService.getPaymentMethods(this.subscriptionId),
|
|
2360
2363
|
product: this.productService.getProductById(this.productId)
|
|
2361
2364
|
}).subscribe((response) => {
|
|
2362
|
-
this.stripePublishKey = response.product.stripe_publishable_key;
|
|
2363
|
-
if (response.paymentMethods.status === StatusCodes.OK) {
|
|
2364
|
-
const data = response.paymentMethods.data
|
|
2365
|
-
this.cardDetails = data
|
|
2366
|
-
this.secondaryCard = data
|
|
2367
|
-
this.secondaryProvider = data
|
|
2365
|
+
this.stripePublishKey = response.product.result.stripe_publishable_key;
|
|
2366
|
+
if (response.paymentMethods.result.status === StatusCodes.OK) {
|
|
2367
|
+
const data = response.paymentMethods.result.data;
|
|
2368
|
+
this.cardDetails = data?.primary || null;
|
|
2369
|
+
this.secondaryCard = data?.secondary || null;
|
|
2370
|
+
this.secondaryProvider = data?.secondary_provider || "braintree";
|
|
2368
2371
|
}
|
|
2369
2372
|
this.cdr.markForCheck();
|
|
2370
2373
|
}).add(() => {
|
|
@@ -2394,7 +2397,7 @@ var UpdatePaymentDetailsComponent = class UpdatePaymentDetailsComponent extends
|
|
|
2394
2397
|
this.cdr.markForCheck();
|
|
2395
2398
|
return;
|
|
2396
2399
|
}
|
|
2397
|
-
this.subscriptionService.updateCardDetails(this.form.value, this.subscriptionId).subscribe({ next: (response) => {
|
|
2400
|
+
this.subscriptionService.updateCardDetails(this.form.value, this.subscriptionId).subscribe({ next: ({ result: response }) => {
|
|
2398
2401
|
if (response.error) this.toast.error(response.error.errors[0].message);
|
|
2399
2402
|
else if (response.status === StatusCodes.CREATED) this.toast.success(response.message);
|
|
2400
2403
|
this.form.markAsPristine();
|
|
@@ -2695,7 +2698,7 @@ var UpgradeSubscriptionComponent = class UpgradeSubscriptionComponent extends Ap
|
|
|
2695
2698
|
});
|
|
2696
2699
|
}
|
|
2697
2700
|
getSubscriptionDetails() {
|
|
2698
|
-
this.subscriptionService.getById(this.subscriptionId).subscribe((response) => {
|
|
2701
|
+
this.subscriptionService.getById(this.subscriptionId).subscribe(({ result: response }) => {
|
|
2699
2702
|
this.subscription = response;
|
|
2700
2703
|
const product = this.subscription.products.find((x) => x.id === this.productId);
|
|
2701
2704
|
this.form.patchValue({ units: product?.purchased_units });
|
|
@@ -2706,7 +2709,7 @@ var UpgradeSubscriptionComponent = class UpgradeSubscriptionComponent extends Ap
|
|
|
2706
2709
|
});
|
|
2707
2710
|
}
|
|
2708
2711
|
getProductDetails() {
|
|
2709
|
-
this.productService.getProductById(this.productId).subscribe((response) => {
|
|
2712
|
+
this.productService.getProductById(this.productId).subscribe(({ result: response }) => {
|
|
2710
2713
|
this.product = response;
|
|
2711
2714
|
this.stripePublishKey = response?.stripe_publishable_key;
|
|
2712
2715
|
if (response?.stripe_publishable_key) Stripe.setPublishableKey(response.stripe_publishable_key);
|
|
@@ -2801,7 +2804,7 @@ var UpgradeSubscriptionComponent = class UpgradeSubscriptionComponent extends Ap
|
|
|
2801
2804
|
subscription_id: this.subscriptionId
|
|
2802
2805
|
};
|
|
2803
2806
|
this.subscriptionService.postSubscription(data).subscribe({
|
|
2804
|
-
next: (response) => {
|
|
2807
|
+
next: ({ result: response }) => {
|
|
2805
2808
|
this.store.dispatch(new GetUser());
|
|
2806
2809
|
if (response.id) {
|
|
2807
2810
|
this.form.markAsPristine();
|
|
@@ -2833,7 +2836,7 @@ var UpgradeSubscriptionComponent = class UpgradeSubscriptionComponent extends Ap
|
|
|
2833
2836
|
}
|
|
2834
2837
|
getCardDetails(subscriptionId) {
|
|
2835
2838
|
this.subscriptionService.getCardDetails(subscriptionId).subscribe((data) => {
|
|
2836
|
-
this.cardDetails = data.data || null;
|
|
2839
|
+
this.cardDetails = data.result.data || null;
|
|
2837
2840
|
this.form.patchValue({
|
|
2838
2841
|
units: this.units,
|
|
2839
2842
|
card_number: this.cardDetails?.card_number,
|
|
@@ -2859,7 +2862,7 @@ var UpgradeSubscriptionComponent = class UpgradeSubscriptionComponent extends Ap
|
|
|
2859
2862
|
Stripe.card.createToken(cardDetails, (status, res) => {
|
|
2860
2863
|
if (status !== 200) this.toast.error(res.error.message);
|
|
2861
2864
|
else this.subscriptionService.updateCardDetails(this.form.value, this.subscriptionId).subscribe({
|
|
2862
|
-
next: (response) => {
|
|
2865
|
+
next: ({ result: response }) => {
|
|
2863
2866
|
if (response.error) {
|
|
2864
2867
|
const err = response.error.errors[0].message;
|
|
2865
2868
|
this.toast.error(err);
|
|
@@ -3216,7 +3219,7 @@ var UserSubscriptionDetailsComponent = class UserSubscriptionDetailsComponent ex
|
|
|
3216
3219
|
});
|
|
3217
3220
|
}
|
|
3218
3221
|
fetchData() {
|
|
3219
|
-
this.subscriptionService.getById(this.subscriptionId).subscribe((response) => {
|
|
3222
|
+
this.subscriptionService.getById(this.subscriptionId).subscribe(({ result: response }) => {
|
|
3220
3223
|
this.subscription = response;
|
|
3221
3224
|
this.fullLogo = this.subscription?.full_logo.url;
|
|
3222
3225
|
this.squaredLogo = this.subscription?.squared_logo?.url;
|
|
@@ -3279,7 +3282,7 @@ var UserSubscriptionDetailsComponent = class UserSubscriptionDetailsComponent ex
|
|
|
3279
3282
|
const file = new File([blob], filename);
|
|
3280
3283
|
this.subscriptionService.addFullLogo(this.subscriptionId, file).subscribe((res) => {
|
|
3281
3284
|
this.modalService.dismissAll();
|
|
3282
|
-
this.fullLogo = res?.full_logo?.url;
|
|
3285
|
+
this.fullLogo = res?.result?.full_logo?.url;
|
|
3283
3286
|
this.fullLogoBroken = false;
|
|
3284
3287
|
this.cdr.markForCheck();
|
|
3285
3288
|
});
|
|
@@ -3290,7 +3293,7 @@ var UserSubscriptionDetailsComponent = class UserSubscriptionDetailsComponent ex
|
|
|
3290
3293
|
const file = new File([blob], filename);
|
|
3291
3294
|
this.subscriptionService.addSquaredLogo(this.subscriptionId, file).subscribe((res) => {
|
|
3292
3295
|
this.modalService.dismissAll();
|
|
3293
|
-
this.squaredLogo = res?.squared_logo?.url;
|
|
3296
|
+
this.squaredLogo = res?.result?.squared_logo?.url;
|
|
3294
3297
|
this.squaredLogoBroken = false;
|
|
3295
3298
|
this.cdr.markForCheck();
|
|
3296
3299
|
});
|
|
@@ -3323,7 +3326,7 @@ var UserSubscriptionDetailsComponent = class UserSubscriptionDetailsComponent ex
|
|
|
3323
3326
|
});
|
|
3324
3327
|
}
|
|
3325
3328
|
onPasswordValidation(_event) {
|
|
3326
|
-
this.subscriptionService.updateSubscriptionUnit(this.subscription.id, this.units).subscribe((response) => {
|
|
3329
|
+
this.subscriptionService.updateSubscriptionUnit(this.subscription.id, this.units).subscribe(({ result: response }) => {
|
|
3327
3330
|
if (response.status === StatusCodes.OK) this.toast.success(this.translation.translate("User.Subscriptions.Details.UnitsUpdatedMessage"));
|
|
3328
3331
|
else this.toast.error(this.translation.translate("GenericMessage.WentWrong"));
|
|
3329
3332
|
this.cdr.markForCheck();
|
|
@@ -3362,7 +3365,7 @@ var UserSubscriptionDetailsComponent = class UserSubscriptionDetailsComponent ex
|
|
|
3362
3365
|
}
|
|
3363
3366
|
performTokenRefresh() {
|
|
3364
3367
|
this.refreshingTokens = true;
|
|
3365
|
-
this.subscriptionService.refreshApiTokens(this.subscriptionId).subscribe({ next: (response) => {
|
|
3368
|
+
this.subscriptionService.refreshApiTokens(this.subscriptionId).subscribe({ next: ({ result: response }) => {
|
|
3366
3369
|
if (response && response.api_access_token) this.subscription.api_access_token = response.api_access_token;
|
|
3367
3370
|
if (response && response.api_client_id) this.subscription.api_client_id = response.api_client_id;
|
|
3368
3371
|
this.showApiToken = false;
|
|
@@ -3814,6 +3817,7 @@ var UserSubscriptionListComponent = class UserSubscriptionListComponent extends
|
|
|
3814
3817
|
this.clipboard = inject(Clipboard);
|
|
3815
3818
|
this.cdr = inject(ChangeDetectorRef);
|
|
3816
3819
|
this.confirmDialog = inject(ConfirmDialogService);
|
|
3820
|
+
this.inMobileApp = isInMobileWebView();
|
|
3817
3821
|
this.showApiKey = true;
|
|
3818
3822
|
this.subscribedSubscriptions = [];
|
|
3819
3823
|
this.isLoaded = false;
|
|
@@ -3867,8 +3871,8 @@ var UserSubscriptionListComponent = class UserSubscriptionListComponent extends
|
|
|
3867
3871
|
this.userStore().subscribe((user) => {
|
|
3868
3872
|
this.user = user;
|
|
3869
3873
|
if (user) this.userService.getUserSubscriptions(user.id).subscribe((response) => {
|
|
3870
|
-
this.subscribedSubscriptions = sortBy(response.subscriptions, "deleted");
|
|
3871
|
-
response?.expired_subscriptions.forEach((subscription) => {
|
|
3874
|
+
this.subscribedSubscriptions = sortBy(response.result.subscriptions, "deleted");
|
|
3875
|
+
response?.result?.expired_subscriptions.forEach((subscription) => {
|
|
3872
3876
|
this.subscribedSubscriptions.push(subscription);
|
|
3873
3877
|
});
|
|
3874
3878
|
this.subscribedSubscriptions.forEach((subscription) => {
|
|
@@ -3884,7 +3888,7 @@ var UserSubscriptionListComponent = class UserSubscriptionListComponent extends
|
|
|
3884
3888
|
}
|
|
3885
3889
|
updateApiKey(subscription, product) {
|
|
3886
3890
|
this.subscriptionService.updateSubscriptionAPIKey(subscription.id, product.id).subscribe((response) => {
|
|
3887
|
-
product.api_access_token = response;
|
|
3891
|
+
product.api_access_token = response.result;
|
|
3888
3892
|
this.toast.success(this.translation.translate("User.Subscriptions.UpdatedKey"));
|
|
3889
3893
|
this.getSubscribedProduct();
|
|
3890
3894
|
this.cdr.markForCheck();
|
|
@@ -4011,7 +4015,7 @@ var UserSubscriptionListComponent = class UserSubscriptionListComponent extends
|
|
|
4011
4015
|
],
|
|
4012
4016
|
usesInheritance: true,
|
|
4013
4017
|
ngImport: i0,
|
|
4014
|
-
template: "@if (!showTos) {\n <!-- Subscriptions Tab Content -->\n @if (!editing && !isAddNew) {\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Subscriptions.List.Title' | transloco }}</h2>\n <p>{{ 'User.Subscriptions.List.Description' | transloco }}</p>\n </div>\n </div>\n }\n <!-- Subscribed Product Cards -->\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n }\n @if (\n !editing && !isAddNew && !isUpdatePayment && isLoaded && subscribedSubscriptions.length\n ) {\n <div class=\"row\"\n >\n @for (subscription of subscribedSubscriptions; track trackBySubscription($index, subscription)) {\n <div class=\"col-12 col-md-6 my-3\"\n >\n <div class=\"subscription-details mb-4\">\n <div class=\"subscription-summary d-flex flex-wrap justify-content-between align-items-start gap-2 mb-3\">\n <div class=\"subscription-summary__info\">\n <div>\n <strong>{{ 'User.Subscriptions.List.Organisation' | transloco }}</strong>\n {{ subscription.organisation ? subscription.organisation : subscription.contact_name }}\n </div>\n <div>\n <strong>{{ 'User.Subscriptions.TotalPriceExclTax' | transloco }}:</strong>\n @if (subscription.calculated_price) {\n {{ subscription.products[0]?.currency }} {{ subscription.calculated_price / 100 | number:'1.2-2' }}\n {{ subscription.products[0].trial_subscription ? ('User.Subscriptions.List.AfterTrial' | transloco) : '' }}\n } @else {\n {{ 'User.Subscriptions.Free' | transloco }}\n }\n </div>\n <div>\n <strong>{{ 'User.Subscriptions.SeatsInUse' | transloco }}:</strong>\n {{ subscription.units_in_use || 1 }} / {{ subscription.purchased_units }}\n @if (subscription.purchased_units) {\n <span class=\"seats-usage\"\n [style.--seats-pct]=\"(subscription.units_in_use || 1) / subscription.purchased_units\"></span>\n }\n </div>\n </div>\n <!-- Subscription-level actions (a subscription may hold multiple products) -->\n @if (\n (subscription.is_subscription_owner || subscription.is_subscription_admin) &&\n subscription.products?.length &&\n !subscription.products[0].deleted &&\n !subscription.products[0].dependency_products?.length\n ) {\n <div class=\"subscription-summary__actions d-flex flex-wrap align-items-center gap-2\">\n <a class=\"btn btn-outline-primary btn-sm\"\n [attr.aria-label]=\"'Button.Edit' | transloco\"\n [routerLink]=\"['../subscriptions', subscription.id]\">\n {{ 'Button.Edit' | transloco }}\n </a>\n @if (!subscription.products[0].expired && !subscription.products[0].trial_subscription) {\n <button [routerLink]=\"['../subscriptions', subscription.id, 'credential']\"\n class=\"btn btn-outline-secondary btn-sm\">\n {{ 'User.Subscriptions.Credentials' | transloco }}\n </button>\n }\n @if (!isUpdatePayment && subscription.stripe_customer_id) {\n <a class=\"btn btn-sm btn-outline-primary\"\n [routerLink]=\"['../subscriptions', subscription.id, 'product', subscription.products[0].id, 'update-payment']\">\n <i class=\"fa fa-edit me-1\" aria-hidden=\"true\"></i>{{ 'User.Subscriptions.UpdateCardDetails' | transloco }}</a>\n }\n <button class=\"btn btn-sm btn-outline-primary\"\n [routerLink]=\"'/account/subscriptions/add-new'\"\n [queryParams]=\"{ subscription_id: subscription.id }\"\n [pTooltip]=\"'User.Subscriptions.Tooltip.ManageAllProducts' | transloco\"\n tooltipPosition=\"bottom\"\n appendTo=\"body\">\n <i class=\"fa fa-plus me-1\"></i>{{ 'User.Subscriptions.SeeAllProducts' | transloco }}\n </button>\n @if (!subscription.has_child_subscriptions) {\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-danger\"\n (click)=\"deleteSubscription(subscription)\"\n [pTooltip]=\"'User.Subscriptions.Tooltip.DeleteSubscription' | transloco\"\n tooltipPosition=\"bottom\"\n appendTo=\"body\">\n {{ 'User.Subscriptions.DeleteSubscription' | transloco }}\n </button>\n }\n </div>\n }\n </div>\n <!-- Products list -->\n @for (\n product of subscription.products; track trackByProduct($index,\n product); let first = $first) {\n <div class=\"mb-3\">\n <div class=\"card subscription-products-cards\">\n <div class=\"card-content\">\n <div class=\"card-header\">\n <div>\n <h4 class=\"mb-3 text-bold-500 primary\">{{ product?.name }}</h4>\n <!-- Frequency -->\n <div>\n <div>\n <strong class=\"d-inline-block w-50\">{{\n 'User.Subscriptions.Frequency' | transloco\n }}:</strong>\n {{ product?.billing_frequency | uppercase }}\n </div>\n </div>\n <!-- Expiration -->\n <div [ngClass]=\"{ 'text-danger': product.expired }\">\n <strong class=\"d-inline-block w-50\">{{\n (product.expired ? 'User.Subscriptions.List.Expired' : 'User.Subscriptions.List.ExpiryDate') | transloco\n }}:</strong>\n {{ product.expires_at | dateFormat }}\n </div>\n <!-- Estimated Price -->\n <div [ngClass]=\"{ 'text-danger': product.expired }\">\n <strong class=\"d-inline-block w-50\">{{\n 'User.Subscriptions.PriceExclTax' | transloco\n }}:</strong>\n {{ product.currency }}\n {{ (product.calculated_price / 100) | number:'1.2-2' }}\n </div>\n <!-- Product API Key (Alpha-only) -->\n <ng-container *rbacAllow=\"'Pages.Alpha'\">\n @if (\n (product.stripe_plan_id && product.max_hits > 0) ||\n product.max_hits_trial > 0\n ) {\n <div class=\"d-flex align-items-center\">\n <strong class=\"d-inline-block w-50\">\n {{ 'User.Subscriptions.ApiKey' | transloco }}:\n <i class=\"far fa-info-circle ms-1 text-muted\"\n aria-hidden=\"true\"\n [pTooltip]=\"'User.Subscriptions.ApiKey.NotUsedHint' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"></i>\n </strong>\n <code class=\"text-truncate me-2\">{{ product.masked }}</code>\n <span class=\"ms-auto d-flex align-items-center flex-shrink-0\">\n <!-- Show Access Key -->\n <button class=\"btn\"\n [pTooltip]=\"'User.Subscriptions.List.ShowKey' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n (click)=\"showKey(product)\">\n <i class=\"fas fa-eye\" aria-hidden=\"true\"></i>\n </button>\n <!-- Copy To Clipboard -->\n <button class=\"btn\"\n [pTooltip]=\"'User.Subscriptions.List.CopyKey' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <i class=\"fal fa-copy\"\n aria-hidden=\"true\"\n (click)=\"onClipboardCopy(product.api_access_token)\"\n (keydown.enter)=\"onClipboardCopy(product.api_access_token)\"></i>\n </button>\n <!-- Update API Key -->\n @if (!product.expired && !product.deleted) {\n <button class=\"btn\"\n [pTooltip]=\"'User.Subscriptions.List.ChangeKey' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n (click)=\"updateApiKey(subscription, product)\">\n <i class=\"fal fa-sync-alt\" aria-hidden=\"true\"></i>\n </button>\n }\n </span>\n </div>\n }\n </ng-container>\n </div>\n </div>\n <div class=\"card-footer px-3 d-flex flex-column gap-2\">\n <div class=\"footer-status d-flex flex-wrap align-items-center gap-2\">\n @if (product.deleted && !product.expired) {\n <span class=\"footer-note\">\n <i class=\"far fa-info-circle me-2\" aria-hidden=\"true\"></i>{{ 'User.Subscriptions.OutdatedMessage' | transloco }}\n </span>\n }\n @if (product.deleted) {\n <span class=\"badge bg-danger\">{{ 'User.Subscriptions.List.Deleted' | transloco }}</span>\n }\n @if (\n product.trial_subscription &&\n product.calculated_price\n ) {\n <span class=\"badge bg-warning\">{{ 'User.Subscriptions.Trial' | transloco }}</span>\n }\n @if (product?.pause_collection && objectKeys(product?.pause_collection)?.length) {\n <span class=\"badge bg-grey\"\n [pTooltip]=\"'User.Subscriptions.Tooltip.PausedCollection'|transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n {{ 'User.Subscriptions.List.PausedCollection' | transloco }}\n </span>\n }\n @if (!product.calculated_price) {\n <span class=\"badge bg-success\">{{ 'User.Subscriptions.Free' | transloco }}</span>\n }\n @if (!product?.deleted && !subscription.is_subscription_owner) {\n <span class=\"footer-note\">\n <i class=\"far fa-info-circle me-2\" aria-hidden=\"true\"></i>{{ 'User.Subscriptions.List.Invited' | transloco }}\n @if (subscription.is_subscription_admin) {\n <span class=\"badge bg-role-admin ms-1\">{{ 'User.Subscriptions.List.AsAdmin' | transloco }}</span>\n }\n </span>\n }\n </div>\n @if (\n subscription.is_subscription_owner ||\n subscription.is_subscription_admin\n ) {\n <div class=\"footer-actions d-flex flex-wrap align-items-center justify-content-end gap-2\">\n <!-- Secondary products only: the primary goes with the whole subscription -->\n @if (\n subscription.products.length > 1 &&\n !product.is_primary_product &&\n !product?.deleted\n ) {\n <span [pTooltip]=\"product.required_by_product_ids?.length ? ('User.Subscriptions.Tooltip.ProductRequired' | transloco) : ''\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <button type=\"button\"\n class=\"btn btn-outline-danger btn-sm\"\n [disabled]=\"product.required_by_product_ids?.length\"\n (click)=\"deleteProduct(subscription, product)\">\n {{ 'User.Subscriptions.DeleteProduct' | transloco }}\n </button>\n </span>\n }\n @if (product.stripe_plan_id && product.active) {\n <!-- Upgrade (single primary CTA) -->\n @if (product.trial_subscription && !product.deleted) {\n <button class=\"btn btn-primary btn-sm\"\n (click)=\"attemptUpgrade(subscription, product)\">\n {{ 'Button.Upgrade' | transloco }}\n </button>\n }\n <!-- Subscribe -->\n @if (subscription.expired && product.stripe_plan_id) {\n <button class=\"btn btn-primary btn-sm\"\n [routerLink]=\"'/account/subscriptions/add-new'\">\n {{ 'User.Subscriptions.Subscribe' | transloco }}\n </button>\n }\n }\n <!-- Privacy & Terms of Service (quiet link, not a button) -->\n @if (product?.product_privacy_service_id) {\n <button class=\"btn btn-link btn-sm p-0 footer-tos-link\"\n (click)=\"showPrivacyAndTos(product)\">\n {{\n 'User.Subscriptions.PrivacyAndTermsOfService'\n | transloco\n }}\n </button>\n }\n </div>\n }\n </div>\n </div>\n </div>\n @if (subscription.products.length === 0) {\n <div>\n <div class=\"card\">\n <div class=\"card-content\">\n <div class=\"card-header\">\n <p class=\"text-center\">\n {{ 'User.Subscriptions.List.NoProducts' | transloco }}\n </p>\n </div>\n </div>\n </div>\n </div>\n }\n </div>\n }\n @if (!editing && !isAddNew && !isUpdatePayment) {\n <div class=\"col-12\"\n >\n @if (subscribedSubscriptions.length === 0) {\n <pw-no-data [withImage]=\"true\" message=\"You don't have any subscription.\"\n >\n </pw-no-data>\n }\n </div>\n }\n </div>\n </div>\n }\n </div>\n }\n <!-- Danger zone (demoted account deletion) -->\n @if (!editing && !isAddNew && !isUpdatePayment && isLoaded) {\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"danger-zone mt-4\">\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-danger danger-zone__action\"\n (click)=\"showModalForAccountDeletion()\"\n [pTooltip]=\"'User.Account.Tooltip.DeleteAccount' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n {{ 'User.Account.DeleteAccount' | transloco }}\n </button>\n </div>\n </div>\n </div>\n }\n <!--\n Add New Subscription\n -->\n <!-- <ng-template [ngIf]=\"isAddNew && !isUpdatePayment\">\n <pw-subscription-details></pw-subscription-details>\n</ng-template> -->\n<!--\nValidate Password For Account Delete\n-->\n<pw-password-validation #passwordValidationModalForAccountDelete\n [destructive]=\"true\"\n (successEvent)=\"deleteUser($event)\">\n</pw-password-validation>\n<!--\nValidate Password For Display Key\n-->\n<pw-password-validation #passwordValidationModalForKey\n (successEvent)=\"displayApiKey()\">\n</pw-password-validation>\n<pw-subscription-removal [user]=\"user\" (removed)=\"onRemoved()\"></pw-subscription-removal>\n}\n\n@if (showTos) {\n <pw-privacy-and-tos [productId]=\"productId\"></pw-privacy-and-tos>\n}\n\n<router-outlet></router-outlet>\n",
|
|
4018
|
+
template: "@if (!showTos) {\n <!-- Subscriptions Tab Content -->\n @if (!editing && !isAddNew) {\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Subscriptions.List.Title' | transloco }}</h2>\n <p>{{ 'User.Subscriptions.List.Description' | transloco }}</p>\n </div>\n </div>\n }\n <!-- Subscribed Product Cards -->\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n }\n @if (\n !editing && !isAddNew && !isUpdatePayment && isLoaded && subscribedSubscriptions.length\n ) {\n <div class=\"row\"\n >\n @for (subscription of subscribedSubscriptions; track trackBySubscription($index, subscription)) {\n <div class=\"col-12 col-md-6 my-3\"\n >\n <div class=\"subscription-details mb-4\">\n <div class=\"subscription-summary d-flex flex-wrap justify-content-between align-items-start gap-2 mb-3\">\n <div class=\"subscription-summary__info\">\n <div>\n <strong>{{ 'User.Subscriptions.List.Organisation' | transloco }}</strong>\n {{ subscription.organisation ? subscription.organisation : subscription.contact_name }}\n </div>\n <div>\n <strong>{{ 'User.Subscriptions.TotalPriceExclTax' | transloco }}:</strong>\n @if (subscription.calculated_price) {\n {{ subscription.products[0]?.currency }} {{ subscription.calculated_price / 100 | number:'1.2-2' }}\n {{ subscription.products[0].trial_subscription ? ('User.Subscriptions.List.AfterTrial' | transloco) : '' }}\n } @else {\n {{ 'User.Subscriptions.Free' | transloco }}\n }\n </div>\n <div>\n <strong>{{ 'User.Subscriptions.SeatsInUse' | transloco }}:</strong>\n {{ subscription.units_in_use || 1 }} / {{ subscription.purchased_units }}\n @if (subscription.purchased_units) {\n <span class=\"seats-usage\"\n [style.--seats-pct]=\"(subscription.units_in_use || 1) / subscription.purchased_units\"></span>\n }\n </div>\n </div>\n <!-- Subscription-level actions (a subscription may hold multiple products) -->\n @if (\n (subscription.is_subscription_owner || subscription.is_subscription_admin) &&\n subscription.products?.length &&\n !subscription.products[0].deleted &&\n !subscription.products[0].dependency_products?.length\n ) {\n <div class=\"subscription-summary__actions d-flex flex-wrap align-items-center gap-2\">\n <a class=\"btn btn-outline-primary btn-sm\"\n [attr.aria-label]=\"'Button.Edit' | transloco\"\n [routerLink]=\"['../subscriptions', subscription.id]\">\n {{ 'Button.Edit' | transloco }}\n </a>\n @if (!subscription.products[0].expired && !subscription.products[0].trial_subscription) {\n <button [routerLink]=\"['../subscriptions', subscription.id, 'credential']\"\n class=\"btn btn-outline-secondary btn-sm\">\n {{ 'User.Subscriptions.Credentials' | transloco }}\n </button>\n }\n @if (!inMobileApp && !isUpdatePayment && subscription.stripe_customer_id) {\n <a class=\"btn btn-sm btn-outline-primary\"\n [routerLink]=\"['../subscriptions', subscription.id, 'product', subscription.products[0].id, 'update-payment']\">\n <i class=\"fa fa-edit me-1\" aria-hidden=\"true\"></i>{{ 'User.Subscriptions.UpdateCardDetails' | transloco }}</a>\n }\n @if (!inMobileApp) {\n <button class=\"btn btn-sm btn-outline-primary\"\n [routerLink]=\"'/account/subscriptions/add-new'\"\n [queryParams]=\"{ subscription_id: subscription.id }\"\n [pTooltip]=\"'User.Subscriptions.Tooltip.ManageAllProducts' | transloco\"\n tooltipPosition=\"bottom\"\n appendTo=\"body\">\n <i class=\"fa fa-plus me-1\"></i>{{ 'User.Subscriptions.SeeAllProducts' | transloco }}\n </button>\n }\n @if (!subscription.has_child_subscriptions) {\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-danger\"\n (click)=\"deleteSubscription(subscription)\"\n [pTooltip]=\"'User.Subscriptions.Tooltip.DeleteSubscription' | transloco\"\n tooltipPosition=\"bottom\"\n appendTo=\"body\">\n {{ 'User.Subscriptions.DeleteSubscription' | transloco }}\n </button>\n }\n </div>\n }\n </div>\n <!-- Products list -->\n @for (\n product of subscription.products; track trackByProduct($index,\n product); let first = $first) {\n <div class=\"mb-3\">\n <div class=\"card subscription-products-cards\">\n <div class=\"card-content\">\n <div class=\"card-header\">\n <div>\n <h4 class=\"mb-3 text-bold-500 primary\">{{ product?.name }}</h4>\n <!-- Frequency -->\n <div>\n <div>\n <strong class=\"d-inline-block w-50\">{{\n 'User.Subscriptions.Frequency' | transloco\n }}:</strong>\n {{ product?.billing_frequency | uppercase }}\n </div>\n </div>\n <!-- Expiration -->\n <div [ngClass]=\"{ 'text-danger': product.expired }\">\n <strong class=\"d-inline-block w-50\">{{\n (product.expired ? 'User.Subscriptions.List.Expired' : 'User.Subscriptions.List.ExpiryDate') | transloco\n }}:</strong>\n {{ product.expires_at | dateFormat }}\n </div>\n <!-- Estimated Price -->\n <div [ngClass]=\"{ 'text-danger': product.expired }\">\n <strong class=\"d-inline-block w-50\">{{\n 'User.Subscriptions.PriceExclTax' | transloco\n }}:</strong>\n {{ product.currency }}\n {{ (product.calculated_price / 100) | number:'1.2-2' }}\n </div>\n <!-- Product API Key (Alpha-only) -->\n <ng-container *rbacAllow=\"'Pages.Alpha'\">\n @if (\n (product.stripe_plan_id && product.max_hits > 0) ||\n product.max_hits_trial > 0\n ) {\n <div class=\"d-flex align-items-center\">\n <strong class=\"d-inline-block w-50\">\n {{ 'User.Subscriptions.ApiKey' | transloco }}:\n <i class=\"far fa-info-circle ms-1 text-muted\"\n aria-hidden=\"true\"\n [pTooltip]=\"'User.Subscriptions.ApiKey.NotUsedHint' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"></i>\n </strong>\n <code class=\"text-truncate me-2\">{{ product.masked }}</code>\n <span class=\"ms-auto d-flex align-items-center flex-shrink-0\">\n <!-- Show Access Key -->\n <button class=\"btn\"\n [pTooltip]=\"'User.Subscriptions.List.ShowKey' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n (click)=\"showKey(product)\">\n <i class=\"fas fa-eye\" aria-hidden=\"true\"></i>\n </button>\n <!-- Copy To Clipboard -->\n <button class=\"btn\"\n [pTooltip]=\"'User.Subscriptions.List.CopyKey' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <i class=\"fal fa-copy\"\n aria-hidden=\"true\"\n (click)=\"onClipboardCopy(product.api_access_token)\"\n (keydown.enter)=\"onClipboardCopy(product.api_access_token)\"></i>\n </button>\n <!-- Update API Key -->\n @if (!product.expired && !product.deleted) {\n <button class=\"btn\"\n [pTooltip]=\"'User.Subscriptions.List.ChangeKey' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n (click)=\"updateApiKey(subscription, product)\">\n <i class=\"fal fa-sync-alt\" aria-hidden=\"true\"></i>\n </button>\n }\n </span>\n </div>\n }\n </ng-container>\n </div>\n </div>\n <div class=\"card-footer px-3 d-flex flex-column gap-2\">\n <div class=\"footer-status d-flex flex-wrap align-items-center gap-2\">\n @if (product.deleted && !product.expired) {\n <span class=\"footer-note\">\n <i class=\"far fa-info-circle me-2\" aria-hidden=\"true\"></i>{{ 'User.Subscriptions.OutdatedMessage' | transloco }}\n </span>\n }\n @if (product.deleted) {\n <span class=\"badge bg-danger\">{{ 'User.Subscriptions.List.Deleted' | transloco }}</span>\n }\n @if (\n product.trial_subscription &&\n product.calculated_price\n ) {\n <span class=\"badge bg-warning\">{{ 'User.Subscriptions.Trial' | transloco }}</span>\n }\n @if (product?.pause_collection && objectKeys(product?.pause_collection)?.length) {\n <span class=\"badge bg-grey\"\n [pTooltip]=\"'User.Subscriptions.Tooltip.PausedCollection'|transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n {{ 'User.Subscriptions.List.PausedCollection' | transloco }}\n </span>\n }\n @if (!product.calculated_price) {\n <span class=\"badge bg-success\">{{ 'User.Subscriptions.Free' | transloco }}</span>\n }\n @if (!product?.deleted && !subscription.is_subscription_owner) {\n <span class=\"footer-note\">\n <i class=\"far fa-info-circle me-2\" aria-hidden=\"true\"></i>{{ 'User.Subscriptions.List.Invited' | transloco }}\n @if (subscription.is_subscription_admin) {\n <span class=\"badge bg-role-admin ms-1\">{{ 'User.Subscriptions.List.AsAdmin' | transloco }}</span>\n }\n </span>\n }\n </div>\n @if (\n subscription.is_subscription_owner ||\n subscription.is_subscription_admin\n ) {\n <div class=\"footer-actions d-flex flex-wrap align-items-center justify-content-end gap-2\">\n <!-- Secondary products only: the primary goes with the whole subscription -->\n @if (\n subscription.products.length > 1 &&\n !product.is_primary_product &&\n !product?.deleted\n ) {\n <span [pTooltip]=\"product.required_by_product_ids?.length ? ('User.Subscriptions.Tooltip.ProductRequired' | transloco) : ''\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <button type=\"button\"\n class=\"btn btn-outline-danger btn-sm\"\n [disabled]=\"product.required_by_product_ids?.length\"\n (click)=\"deleteProduct(subscription, product)\">\n {{ 'User.Subscriptions.DeleteProduct' | transloco }}\n </button>\n </span>\n }\n @if (!inMobileApp && product.stripe_plan_id && product.active) {\n <!-- Upgrade (single primary CTA) -->\n @if (product.trial_subscription && !product.deleted) {\n <button class=\"btn btn-primary btn-sm\"\n (click)=\"attemptUpgrade(subscription, product)\">\n {{ 'Button.Upgrade' | transloco }}\n </button>\n }\n <!-- Subscribe -->\n @if (subscription.expired && product.stripe_plan_id) {\n <button class=\"btn btn-primary btn-sm\"\n [routerLink]=\"'/account/subscriptions/add-new'\">\n {{ 'User.Subscriptions.Subscribe' | transloco }}\n </button>\n }\n }\n <!-- Privacy & Terms of Service (quiet link, not a button) -->\n @if (product?.product_privacy_service_id) {\n <button class=\"btn btn-link btn-sm p-0 footer-tos-link\"\n (click)=\"showPrivacyAndTos(product)\">\n {{\n 'User.Subscriptions.PrivacyAndTermsOfService'\n | transloco\n }}\n </button>\n }\n </div>\n }\n </div>\n </div>\n </div>\n @if (subscription.products.length === 0) {\n <div>\n <div class=\"card\">\n <div class=\"card-content\">\n <div class=\"card-header\">\n <p class=\"text-center\">\n {{ 'User.Subscriptions.List.NoProducts' | transloco }}\n </p>\n </div>\n </div>\n </div>\n </div>\n }\n </div>\n }\n @if (!editing && !isAddNew && !isUpdatePayment) {\n <div class=\"col-12\"\n >\n @if (subscribedSubscriptions.length === 0) {\n <pw-no-data [withImage]=\"true\" message=\"You don't have any subscription.\"\n >\n </pw-no-data>\n }\n </div>\n }\n </div>\n </div>\n }\n </div>\n }\n <!-- Danger zone (demoted account deletion) -->\n @if (!editing && !isAddNew && !isUpdatePayment && isLoaded) {\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"danger-zone mt-4\">\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-danger danger-zone__action\"\n (click)=\"showModalForAccountDeletion()\"\n [pTooltip]=\"'User.Account.Tooltip.DeleteAccount' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n {{ 'User.Account.DeleteAccount' | transloco }}\n </button>\n </div>\n </div>\n </div>\n }\n <!--\n Add New Subscription\n -->\n <!-- <ng-template [ngIf]=\"isAddNew && !isUpdatePayment\">\n <pw-subscription-details></pw-subscription-details>\n</ng-template> -->\n<!--\nValidate Password For Account Delete\n-->\n<pw-password-validation #passwordValidationModalForAccountDelete\n [destructive]=\"true\"\n (successEvent)=\"deleteUser($event)\">\n</pw-password-validation>\n<!--\nValidate Password For Display Key\n-->\n<pw-password-validation #passwordValidationModalForKey\n (successEvent)=\"displayApiKey()\">\n</pw-password-validation>\n<pw-subscription-removal [user]=\"user\" (removed)=\"onRemoved()\"></pw-subscription-removal>\n}\n\n@if (showTos) {\n <pw-privacy-and-tos [productId]=\"productId\"></pw-privacy-and-tos>\n}\n\n<router-outlet></router-outlet>\n",
|
|
4015
4019
|
styles: [".btn-list{bottom:24px;left:0;padding:0 38px;right:0}.shadow-md{padding-bottom:70px!important}.bg-dark{border:0}.subscription-details{background:#fff;border:1px solid #e2e5ea;border-radius:12px;padding:16px 16px 6px;font-size:14px;font-variant-numeric:tabular-nums}.subscription-summary{border-bottom:1px solid #eef0f3;padding-bottom:12px}.seats-usage{display:inline-block;width:120px;height:6px;margin-left:8px;border-radius:999px;vertical-align:middle;overflow:hidden;background:linear-gradient(#5a6473,#5a6473) left/calc(var(--seats-pct, 0) * 100%) 100% no-repeat,#e2e5ea}.subscription-products-cards{padding-bottom:0!important}.subscription-products-cards .card-footer{position:static!important}.subscription-products-cards.card{background:#f7f8fa;border:1px solid #eef0f3;border-radius:8px;box-shadow:none!important;font-size:14px}.card-footer{background:transparent;border-top:1px solid #eef0f3}.card-footer .footer-note{color:#5a6473;font-size:.875rem}.card-footer .footer-tos-link{color:#5a6473;font-weight:500;text-decoration:underline}.card-footer .footer-tos-link:hover{color:var(--first)}.badge{font-weight:600;border-radius:4px}.badge.bg-success{background-color:#e6f4ec!important;color:#0f6b3a!important}.badge.bg-danger{background-color:#fbeae8!important;color:#c0392b!important}.badge.bg-warning{background-color:#fbf1e3!important;color:#8a5a00!important}.badge.bg-grey,.badge.bg-role-admin{background-color:#eef0f3!important;color:#5a6473!important}code{color:var(--text);min-width:0}.danger-zone{border-top:1px solid #e2e5ea;padding-top:16px;text-align:right}\n"],
|
|
4016
4020
|
dependencies: [
|
|
4017
4021
|
{
|
|
@@ -4180,7 +4184,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
4180
4184
|
TranslocoPipe,
|
|
4181
4185
|
DateFormatPipe
|
|
4182
4186
|
],
|
|
4183
|
-
template: "@if (!showTos) {\n <!-- Subscriptions Tab Content -->\n @if (!editing && !isAddNew) {\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Subscriptions.List.Title' | transloco }}</h2>\n <p>{{ 'User.Subscriptions.List.Description' | transloco }}</p>\n </div>\n </div>\n }\n <!-- Subscribed Product Cards -->\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n }\n @if (\n !editing && !isAddNew && !isUpdatePayment && isLoaded && subscribedSubscriptions.length\n ) {\n <div class=\"row\"\n >\n @for (subscription of subscribedSubscriptions; track trackBySubscription($index, subscription)) {\n <div class=\"col-12 col-md-6 my-3\"\n >\n <div class=\"subscription-details mb-4\">\n <div class=\"subscription-summary d-flex flex-wrap justify-content-between align-items-start gap-2 mb-3\">\n <div class=\"subscription-summary__info\">\n <div>\n <strong>{{ 'User.Subscriptions.List.Organisation' | transloco }}</strong>\n {{ subscription.organisation ? subscription.organisation : subscription.contact_name }}\n </div>\n <div>\n <strong>{{ 'User.Subscriptions.TotalPriceExclTax' | transloco }}:</strong>\n @if (subscription.calculated_price) {\n {{ subscription.products[0]?.currency }} {{ subscription.calculated_price / 100 | number:'1.2-2' }}\n {{ subscription.products[0].trial_subscription ? ('User.Subscriptions.List.AfterTrial' | transloco) : '' }}\n } @else {\n {{ 'User.Subscriptions.Free' | transloco }}\n }\n </div>\n <div>\n <strong>{{ 'User.Subscriptions.SeatsInUse' | transloco }}:</strong>\n {{ subscription.units_in_use || 1 }} / {{ subscription.purchased_units }}\n @if (subscription.purchased_units) {\n <span class=\"seats-usage\"\n [style.--seats-pct]=\"(subscription.units_in_use || 1) / subscription.purchased_units\"></span>\n }\n </div>\n </div>\n <!-- Subscription-level actions (a subscription may hold multiple products) -->\n @if (\n (subscription.is_subscription_owner || subscription.is_subscription_admin) &&\n subscription.products?.length &&\n !subscription.products[0].deleted &&\n !subscription.products[0].dependency_products?.length\n ) {\n <div class=\"subscription-summary__actions d-flex flex-wrap align-items-center gap-2\">\n <a class=\"btn btn-outline-primary btn-sm\"\n [attr.aria-label]=\"'Button.Edit' | transloco\"\n [routerLink]=\"['../subscriptions', subscription.id]\">\n {{ 'Button.Edit' | transloco }}\n </a>\n @if (!subscription.products[0].expired && !subscription.products[0].trial_subscription) {\n <button [routerLink]=\"['../subscriptions', subscription.id, 'credential']\"\n class=\"btn btn-outline-secondary btn-sm\">\n {{ 'User.Subscriptions.Credentials' | transloco }}\n </button>\n }\n @if (!isUpdatePayment && subscription.stripe_customer_id) {\n <a class=\"btn btn-sm btn-outline-primary\"\n [routerLink]=\"['../subscriptions', subscription.id, 'product', subscription.products[0].id, 'update-payment']\">\n <i class=\"fa fa-edit me-1\" aria-hidden=\"true\"></i>{{ 'User.Subscriptions.UpdateCardDetails' | transloco }}</a>\n }\n <button class=\"btn btn-sm btn-outline-primary\"\n [routerLink]=\"'/account/subscriptions/add-new'\"\n [queryParams]=\"{ subscription_id: subscription.id }\"\n [pTooltip]=\"'User.Subscriptions.Tooltip.ManageAllProducts' | transloco\"\n tooltipPosition=\"bottom\"\n appendTo=\"body\">\n <i class=\"fa fa-plus me-1\"></i>{{ 'User.Subscriptions.SeeAllProducts' | transloco }}\n </button>\n @if (!subscription.has_child_subscriptions) {\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-danger\"\n (click)=\"deleteSubscription(subscription)\"\n [pTooltip]=\"'User.Subscriptions.Tooltip.DeleteSubscription' | transloco\"\n tooltipPosition=\"bottom\"\n appendTo=\"body\">\n {{ 'User.Subscriptions.DeleteSubscription' | transloco }}\n </button>\n }\n </div>\n }\n </div>\n <!-- Products list -->\n @for (\n product of subscription.products; track trackByProduct($index,\n product); let first = $first) {\n <div class=\"mb-3\">\n <div class=\"card subscription-products-cards\">\n <div class=\"card-content\">\n <div class=\"card-header\">\n <div>\n <h4 class=\"mb-3 text-bold-500 primary\">{{ product?.name }}</h4>\n <!-- Frequency -->\n <div>\n <div>\n <strong class=\"d-inline-block w-50\">{{\n 'User.Subscriptions.Frequency' | transloco\n }}:</strong>\n {{ product?.billing_frequency | uppercase }}\n </div>\n </div>\n <!-- Expiration -->\n <div [ngClass]=\"{ 'text-danger': product.expired }\">\n <strong class=\"d-inline-block w-50\">{{\n (product.expired ? 'User.Subscriptions.List.Expired' : 'User.Subscriptions.List.ExpiryDate') | transloco\n }}:</strong>\n {{ product.expires_at | dateFormat }}\n </div>\n <!-- Estimated Price -->\n <div [ngClass]=\"{ 'text-danger': product.expired }\">\n <strong class=\"d-inline-block w-50\">{{\n 'User.Subscriptions.PriceExclTax' | transloco\n }}:</strong>\n {{ product.currency }}\n {{ (product.calculated_price / 100) | number:'1.2-2' }}\n </div>\n <!-- Product API Key (Alpha-only) -->\n <ng-container *rbacAllow=\"'Pages.Alpha'\">\n @if (\n (product.stripe_plan_id && product.max_hits > 0) ||\n product.max_hits_trial > 0\n ) {\n <div class=\"d-flex align-items-center\">\n <strong class=\"d-inline-block w-50\">\n {{ 'User.Subscriptions.ApiKey' | transloco }}:\n <i class=\"far fa-info-circle ms-1 text-muted\"\n aria-hidden=\"true\"\n [pTooltip]=\"'User.Subscriptions.ApiKey.NotUsedHint' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"></i>\n </strong>\n <code class=\"text-truncate me-2\">{{ product.masked }}</code>\n <span class=\"ms-auto d-flex align-items-center flex-shrink-0\">\n <!-- Show Access Key -->\n <button class=\"btn\"\n [pTooltip]=\"'User.Subscriptions.List.ShowKey' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n (click)=\"showKey(product)\">\n <i class=\"fas fa-eye\" aria-hidden=\"true\"></i>\n </button>\n <!-- Copy To Clipboard -->\n <button class=\"btn\"\n [pTooltip]=\"'User.Subscriptions.List.CopyKey' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <i class=\"fal fa-copy\"\n aria-hidden=\"true\"\n (click)=\"onClipboardCopy(product.api_access_token)\"\n (keydown.enter)=\"onClipboardCopy(product.api_access_token)\"></i>\n </button>\n <!-- Update API Key -->\n @if (!product.expired && !product.deleted) {\n <button class=\"btn\"\n [pTooltip]=\"'User.Subscriptions.List.ChangeKey' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n (click)=\"updateApiKey(subscription, product)\">\n <i class=\"fal fa-sync-alt\" aria-hidden=\"true\"></i>\n </button>\n }\n </span>\n </div>\n }\n </ng-container>\n </div>\n </div>\n <div class=\"card-footer px-3 d-flex flex-column gap-2\">\n <div class=\"footer-status d-flex flex-wrap align-items-center gap-2\">\n @if (product.deleted && !product.expired) {\n <span class=\"footer-note\">\n <i class=\"far fa-info-circle me-2\" aria-hidden=\"true\"></i>{{ 'User.Subscriptions.OutdatedMessage' | transloco }}\n </span>\n }\n @if (product.deleted) {\n <span class=\"badge bg-danger\">{{ 'User.Subscriptions.List.Deleted' | transloco }}</span>\n }\n @if (\n product.trial_subscription &&\n product.calculated_price\n ) {\n <span class=\"badge bg-warning\">{{ 'User.Subscriptions.Trial' | transloco }}</span>\n }\n @if (product?.pause_collection && objectKeys(product?.pause_collection)?.length) {\n <span class=\"badge bg-grey\"\n [pTooltip]=\"'User.Subscriptions.Tooltip.PausedCollection'|transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n {{ 'User.Subscriptions.List.PausedCollection' | transloco }}\n </span>\n }\n @if (!product.calculated_price) {\n <span class=\"badge bg-success\">{{ 'User.Subscriptions.Free' | transloco }}</span>\n }\n @if (!product?.deleted && !subscription.is_subscription_owner) {\n <span class=\"footer-note\">\n <i class=\"far fa-info-circle me-2\" aria-hidden=\"true\"></i>{{ 'User.Subscriptions.List.Invited' | transloco }}\n @if (subscription.is_subscription_admin) {\n <span class=\"badge bg-role-admin ms-1\">{{ 'User.Subscriptions.List.AsAdmin' | transloco }}</span>\n }\n </span>\n }\n </div>\n @if (\n subscription.is_subscription_owner ||\n subscription.is_subscription_admin\n ) {\n <div class=\"footer-actions d-flex flex-wrap align-items-center justify-content-end gap-2\">\n <!-- Secondary products only: the primary goes with the whole subscription -->\n @if (\n subscription.products.length > 1 &&\n !product.is_primary_product &&\n !product?.deleted\n ) {\n <span [pTooltip]=\"product.required_by_product_ids?.length ? ('User.Subscriptions.Tooltip.ProductRequired' | transloco) : ''\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <button type=\"button\"\n class=\"btn btn-outline-danger btn-sm\"\n [disabled]=\"product.required_by_product_ids?.length\"\n (click)=\"deleteProduct(subscription, product)\">\n {{ 'User.Subscriptions.DeleteProduct' | transloco }}\n </button>\n </span>\n }\n @if (product.stripe_plan_id && product.active) {\n <!-- Upgrade (single primary CTA) -->\n @if (product.trial_subscription && !product.deleted) {\n <button class=\"btn btn-primary btn-sm\"\n (click)=\"attemptUpgrade(subscription, product)\">\n {{ 'Button.Upgrade' | transloco }}\n </button>\n }\n <!-- Subscribe -->\n @if (subscription.expired && product.stripe_plan_id) {\n <button class=\"btn btn-primary btn-sm\"\n [routerLink]=\"'/account/subscriptions/add-new'\">\n {{ 'User.Subscriptions.Subscribe' | transloco }}\n </button>\n }\n }\n <!-- Privacy & Terms of Service (quiet link, not a button) -->\n @if (product?.product_privacy_service_id) {\n <button class=\"btn btn-link btn-sm p-0 footer-tos-link\"\n (click)=\"showPrivacyAndTos(product)\">\n {{\n 'User.Subscriptions.PrivacyAndTermsOfService'\n | transloco\n }}\n </button>\n }\n </div>\n }\n </div>\n </div>\n </div>\n @if (subscription.products.length === 0) {\n <div>\n <div class=\"card\">\n <div class=\"card-content\">\n <div class=\"card-header\">\n <p class=\"text-center\">\n {{ 'User.Subscriptions.List.NoProducts' | transloco }}\n </p>\n </div>\n </div>\n </div>\n </div>\n }\n </div>\n }\n @if (!editing && !isAddNew && !isUpdatePayment) {\n <div class=\"col-12\"\n >\n @if (subscribedSubscriptions.length === 0) {\n <pw-no-data [withImage]=\"true\" message=\"You don't have any subscription.\"\n >\n </pw-no-data>\n }\n </div>\n }\n </div>\n </div>\n }\n </div>\n }\n <!-- Danger zone (demoted account deletion) -->\n @if (!editing && !isAddNew && !isUpdatePayment && isLoaded) {\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"danger-zone mt-4\">\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-danger danger-zone__action\"\n (click)=\"showModalForAccountDeletion()\"\n [pTooltip]=\"'User.Account.Tooltip.DeleteAccount' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n {{ 'User.Account.DeleteAccount' | transloco }}\n </button>\n </div>\n </div>\n </div>\n }\n <!--\n Add New Subscription\n -->\n <!-- <ng-template [ngIf]=\"isAddNew && !isUpdatePayment\">\n <pw-subscription-details></pw-subscription-details>\n</ng-template> -->\n<!--\nValidate Password For Account Delete\n-->\n<pw-password-validation #passwordValidationModalForAccountDelete\n [destructive]=\"true\"\n (successEvent)=\"deleteUser($event)\">\n</pw-password-validation>\n<!--\nValidate Password For Display Key\n-->\n<pw-password-validation #passwordValidationModalForKey\n (successEvent)=\"displayApiKey()\">\n</pw-password-validation>\n<pw-subscription-removal [user]=\"user\" (removed)=\"onRemoved()\"></pw-subscription-removal>\n}\n\n@if (showTos) {\n <pw-privacy-and-tos [productId]=\"productId\"></pw-privacy-and-tos>\n}\n\n<router-outlet></router-outlet>\n",
|
|
4187
|
+
template: "@if (!showTos) {\n <!-- Subscriptions Tab Content -->\n @if (!editing && !isAddNew) {\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Subscriptions.List.Title' | transloco }}</h2>\n <p>{{ 'User.Subscriptions.List.Description' | transloco }}</p>\n </div>\n </div>\n }\n <!-- Subscribed Product Cards -->\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n }\n @if (\n !editing && !isAddNew && !isUpdatePayment && isLoaded && subscribedSubscriptions.length\n ) {\n <div class=\"row\"\n >\n @for (subscription of subscribedSubscriptions; track trackBySubscription($index, subscription)) {\n <div class=\"col-12 col-md-6 my-3\"\n >\n <div class=\"subscription-details mb-4\">\n <div class=\"subscription-summary d-flex flex-wrap justify-content-between align-items-start gap-2 mb-3\">\n <div class=\"subscription-summary__info\">\n <div>\n <strong>{{ 'User.Subscriptions.List.Organisation' | transloco }}</strong>\n {{ subscription.organisation ? subscription.organisation : subscription.contact_name }}\n </div>\n <div>\n <strong>{{ 'User.Subscriptions.TotalPriceExclTax' | transloco }}:</strong>\n @if (subscription.calculated_price) {\n {{ subscription.products[0]?.currency }} {{ subscription.calculated_price / 100 | number:'1.2-2' }}\n {{ subscription.products[0].trial_subscription ? ('User.Subscriptions.List.AfterTrial' | transloco) : '' }}\n } @else {\n {{ 'User.Subscriptions.Free' | transloco }}\n }\n </div>\n <div>\n <strong>{{ 'User.Subscriptions.SeatsInUse' | transloco }}:</strong>\n {{ subscription.units_in_use || 1 }} / {{ subscription.purchased_units }}\n @if (subscription.purchased_units) {\n <span class=\"seats-usage\"\n [style.--seats-pct]=\"(subscription.units_in_use || 1) / subscription.purchased_units\"></span>\n }\n </div>\n </div>\n <!-- Subscription-level actions (a subscription may hold multiple products) -->\n @if (\n (subscription.is_subscription_owner || subscription.is_subscription_admin) &&\n subscription.products?.length &&\n !subscription.products[0].deleted &&\n !subscription.products[0].dependency_products?.length\n ) {\n <div class=\"subscription-summary__actions d-flex flex-wrap align-items-center gap-2\">\n <a class=\"btn btn-outline-primary btn-sm\"\n [attr.aria-label]=\"'Button.Edit' | transloco\"\n [routerLink]=\"['../subscriptions', subscription.id]\">\n {{ 'Button.Edit' | transloco }}\n </a>\n @if (!subscription.products[0].expired && !subscription.products[0].trial_subscription) {\n <button [routerLink]=\"['../subscriptions', subscription.id, 'credential']\"\n class=\"btn btn-outline-secondary btn-sm\">\n {{ 'User.Subscriptions.Credentials' | transloco }}\n </button>\n }\n @if (!inMobileApp && !isUpdatePayment && subscription.stripe_customer_id) {\n <a class=\"btn btn-sm btn-outline-primary\"\n [routerLink]=\"['../subscriptions', subscription.id, 'product', subscription.products[0].id, 'update-payment']\">\n <i class=\"fa fa-edit me-1\" aria-hidden=\"true\"></i>{{ 'User.Subscriptions.UpdateCardDetails' | transloco }}</a>\n }\n @if (!inMobileApp) {\n <button class=\"btn btn-sm btn-outline-primary\"\n [routerLink]=\"'/account/subscriptions/add-new'\"\n [queryParams]=\"{ subscription_id: subscription.id }\"\n [pTooltip]=\"'User.Subscriptions.Tooltip.ManageAllProducts' | transloco\"\n tooltipPosition=\"bottom\"\n appendTo=\"body\">\n <i class=\"fa fa-plus me-1\"></i>{{ 'User.Subscriptions.SeeAllProducts' | transloco }}\n </button>\n }\n @if (!subscription.has_child_subscriptions) {\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-danger\"\n (click)=\"deleteSubscription(subscription)\"\n [pTooltip]=\"'User.Subscriptions.Tooltip.DeleteSubscription' | transloco\"\n tooltipPosition=\"bottom\"\n appendTo=\"body\">\n {{ 'User.Subscriptions.DeleteSubscription' | transloco }}\n </button>\n }\n </div>\n }\n </div>\n <!-- Products list -->\n @for (\n product of subscription.products; track trackByProduct($index,\n product); let first = $first) {\n <div class=\"mb-3\">\n <div class=\"card subscription-products-cards\">\n <div class=\"card-content\">\n <div class=\"card-header\">\n <div>\n <h4 class=\"mb-3 text-bold-500 primary\">{{ product?.name }}</h4>\n <!-- Frequency -->\n <div>\n <div>\n <strong class=\"d-inline-block w-50\">{{\n 'User.Subscriptions.Frequency' | transloco\n }}:</strong>\n {{ product?.billing_frequency | uppercase }}\n </div>\n </div>\n <!-- Expiration -->\n <div [ngClass]=\"{ 'text-danger': product.expired }\">\n <strong class=\"d-inline-block w-50\">{{\n (product.expired ? 'User.Subscriptions.List.Expired' : 'User.Subscriptions.List.ExpiryDate') | transloco\n }}:</strong>\n {{ product.expires_at | dateFormat }}\n </div>\n <!-- Estimated Price -->\n <div [ngClass]=\"{ 'text-danger': product.expired }\">\n <strong class=\"d-inline-block w-50\">{{\n 'User.Subscriptions.PriceExclTax' | transloco\n }}:</strong>\n {{ product.currency }}\n {{ (product.calculated_price / 100) | number:'1.2-2' }}\n </div>\n <!-- Product API Key (Alpha-only) -->\n <ng-container *rbacAllow=\"'Pages.Alpha'\">\n @if (\n (product.stripe_plan_id && product.max_hits > 0) ||\n product.max_hits_trial > 0\n ) {\n <div class=\"d-flex align-items-center\">\n <strong class=\"d-inline-block w-50\">\n {{ 'User.Subscriptions.ApiKey' | transloco }}:\n <i class=\"far fa-info-circle ms-1 text-muted\"\n aria-hidden=\"true\"\n [pTooltip]=\"'User.Subscriptions.ApiKey.NotUsedHint' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"></i>\n </strong>\n <code class=\"text-truncate me-2\">{{ product.masked }}</code>\n <span class=\"ms-auto d-flex align-items-center flex-shrink-0\">\n <!-- Show Access Key -->\n <button class=\"btn\"\n [pTooltip]=\"'User.Subscriptions.List.ShowKey' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n (click)=\"showKey(product)\">\n <i class=\"fas fa-eye\" aria-hidden=\"true\"></i>\n </button>\n <!-- Copy To Clipboard -->\n <button class=\"btn\"\n [pTooltip]=\"'User.Subscriptions.List.CopyKey' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <i class=\"fal fa-copy\"\n aria-hidden=\"true\"\n (click)=\"onClipboardCopy(product.api_access_token)\"\n (keydown.enter)=\"onClipboardCopy(product.api_access_token)\"></i>\n </button>\n <!-- Update API Key -->\n @if (!product.expired && !product.deleted) {\n <button class=\"btn\"\n [pTooltip]=\"'User.Subscriptions.List.ChangeKey' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n (click)=\"updateApiKey(subscription, product)\">\n <i class=\"fal fa-sync-alt\" aria-hidden=\"true\"></i>\n </button>\n }\n </span>\n </div>\n }\n </ng-container>\n </div>\n </div>\n <div class=\"card-footer px-3 d-flex flex-column gap-2\">\n <div class=\"footer-status d-flex flex-wrap align-items-center gap-2\">\n @if (product.deleted && !product.expired) {\n <span class=\"footer-note\">\n <i class=\"far fa-info-circle me-2\" aria-hidden=\"true\"></i>{{ 'User.Subscriptions.OutdatedMessage' | transloco }}\n </span>\n }\n @if (product.deleted) {\n <span class=\"badge bg-danger\">{{ 'User.Subscriptions.List.Deleted' | transloco }}</span>\n }\n @if (\n product.trial_subscription &&\n product.calculated_price\n ) {\n <span class=\"badge bg-warning\">{{ 'User.Subscriptions.Trial' | transloco }}</span>\n }\n @if (product?.pause_collection && objectKeys(product?.pause_collection)?.length) {\n <span class=\"badge bg-grey\"\n [pTooltip]=\"'User.Subscriptions.Tooltip.PausedCollection'|transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n {{ 'User.Subscriptions.List.PausedCollection' | transloco }}\n </span>\n }\n @if (!product.calculated_price) {\n <span class=\"badge bg-success\">{{ 'User.Subscriptions.Free' | transloco }}</span>\n }\n @if (!product?.deleted && !subscription.is_subscription_owner) {\n <span class=\"footer-note\">\n <i class=\"far fa-info-circle me-2\" aria-hidden=\"true\"></i>{{ 'User.Subscriptions.List.Invited' | transloco }}\n @if (subscription.is_subscription_admin) {\n <span class=\"badge bg-role-admin ms-1\">{{ 'User.Subscriptions.List.AsAdmin' | transloco }}</span>\n }\n </span>\n }\n </div>\n @if (\n subscription.is_subscription_owner ||\n subscription.is_subscription_admin\n ) {\n <div class=\"footer-actions d-flex flex-wrap align-items-center justify-content-end gap-2\">\n <!-- Secondary products only: the primary goes with the whole subscription -->\n @if (\n subscription.products.length > 1 &&\n !product.is_primary_product &&\n !product?.deleted\n ) {\n <span [pTooltip]=\"product.required_by_product_ids?.length ? ('User.Subscriptions.Tooltip.ProductRequired' | transloco) : ''\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <button type=\"button\"\n class=\"btn btn-outline-danger btn-sm\"\n [disabled]=\"product.required_by_product_ids?.length\"\n (click)=\"deleteProduct(subscription, product)\">\n {{ 'User.Subscriptions.DeleteProduct' | transloco }}\n </button>\n </span>\n }\n @if (!inMobileApp && product.stripe_plan_id && product.active) {\n <!-- Upgrade (single primary CTA) -->\n @if (product.trial_subscription && !product.deleted) {\n <button class=\"btn btn-primary btn-sm\"\n (click)=\"attemptUpgrade(subscription, product)\">\n {{ 'Button.Upgrade' | transloco }}\n </button>\n }\n <!-- Subscribe -->\n @if (subscription.expired && product.stripe_plan_id) {\n <button class=\"btn btn-primary btn-sm\"\n [routerLink]=\"'/account/subscriptions/add-new'\">\n {{ 'User.Subscriptions.Subscribe' | transloco }}\n </button>\n }\n }\n <!-- Privacy & Terms of Service (quiet link, not a button) -->\n @if (product?.product_privacy_service_id) {\n <button class=\"btn btn-link btn-sm p-0 footer-tos-link\"\n (click)=\"showPrivacyAndTos(product)\">\n {{\n 'User.Subscriptions.PrivacyAndTermsOfService'\n | transloco\n }}\n </button>\n }\n </div>\n }\n </div>\n </div>\n </div>\n @if (subscription.products.length === 0) {\n <div>\n <div class=\"card\">\n <div class=\"card-content\">\n <div class=\"card-header\">\n <p class=\"text-center\">\n {{ 'User.Subscriptions.List.NoProducts' | transloco }}\n </p>\n </div>\n </div>\n </div>\n </div>\n }\n </div>\n }\n @if (!editing && !isAddNew && !isUpdatePayment) {\n <div class=\"col-12\"\n >\n @if (subscribedSubscriptions.length === 0) {\n <pw-no-data [withImage]=\"true\" message=\"You don't have any subscription.\"\n >\n </pw-no-data>\n }\n </div>\n }\n </div>\n </div>\n }\n </div>\n }\n <!-- Danger zone (demoted account deletion) -->\n @if (!editing && !isAddNew && !isUpdatePayment && isLoaded) {\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"danger-zone mt-4\">\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-danger danger-zone__action\"\n (click)=\"showModalForAccountDeletion()\"\n [pTooltip]=\"'User.Account.Tooltip.DeleteAccount' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n {{ 'User.Account.DeleteAccount' | transloco }}\n </button>\n </div>\n </div>\n </div>\n }\n <!--\n Add New Subscription\n -->\n <!-- <ng-template [ngIf]=\"isAddNew && !isUpdatePayment\">\n <pw-subscription-details></pw-subscription-details>\n</ng-template> -->\n<!--\nValidate Password For Account Delete\n-->\n<pw-password-validation #passwordValidationModalForAccountDelete\n [destructive]=\"true\"\n (successEvent)=\"deleteUser($event)\">\n</pw-password-validation>\n<!--\nValidate Password For Display Key\n-->\n<pw-password-validation #passwordValidationModalForKey\n (successEvent)=\"displayApiKey()\">\n</pw-password-validation>\n<pw-subscription-removal [user]=\"user\" (removed)=\"onRemoved()\"></pw-subscription-removal>\n}\n\n@if (showTos) {\n <pw-privacy-and-tos [productId]=\"productId\"></pw-privacy-and-tos>\n}\n\n<router-outlet></router-outlet>\n",
|
|
4184
4188
|
styles: [".btn-list{bottom:24px;left:0;padding:0 38px;right:0}.shadow-md{padding-bottom:70px!important}.bg-dark{border:0}.subscription-details{background:#fff;border:1px solid #e2e5ea;border-radius:12px;padding:16px 16px 6px;font-size:14px;font-variant-numeric:tabular-nums}.subscription-summary{border-bottom:1px solid #eef0f3;padding-bottom:12px}.seats-usage{display:inline-block;width:120px;height:6px;margin-left:8px;border-radius:999px;vertical-align:middle;overflow:hidden;background:linear-gradient(#5a6473,#5a6473) left/calc(var(--seats-pct, 0) * 100%) 100% no-repeat,#e2e5ea}.subscription-products-cards{padding-bottom:0!important}.subscription-products-cards .card-footer{position:static!important}.subscription-products-cards.card{background:#f7f8fa;border:1px solid #eef0f3;border-radius:8px;box-shadow:none!important;font-size:14px}.card-footer{background:transparent;border-top:1px solid #eef0f3}.card-footer .footer-note{color:#5a6473;font-size:.875rem}.card-footer .footer-tos-link{color:#5a6473;font-weight:500;text-decoration:underline}.card-footer .footer-tos-link:hover{color:var(--first)}.badge{font-weight:600;border-radius:4px}.badge.bg-success{background-color:#e6f4ec!important;color:#0f6b3a!important}.badge.bg-danger{background-color:#fbeae8!important;color:#c0392b!important}.badge.bg-warning{background-color:#fbf1e3!important;color:#8a5a00!important}.badge.bg-grey,.badge.bg-role-admin{background-color:#eef0f3!important;color:#5a6473!important}code{color:var(--text);min-width:0}.danger-zone{border-top:1px solid #e2e5ea;padding-top:16px;text-align:right}\n"]
|
|
4185
4189
|
}]
|
|
4186
4190
|
}],
|
|
@@ -4241,9 +4245,9 @@ var UserInvoiceComponent = class UserInvoiceComponent extends AppBaseComponent {
|
|
|
4241
4245
|
if (user) {
|
|
4242
4246
|
this.userId = user.id;
|
|
4243
4247
|
this.userService.getUserInvoices(paging, user.id).subscribe((response) => {
|
|
4244
|
-
this.invoices = response.
|
|
4245
|
-
this.totalRecords = response.
|
|
4246
|
-
this.totalRecordsUnFiltered = response.
|
|
4248
|
+
this.invoices = response.result;
|
|
4249
|
+
this.totalRecords = response.page_info.total_count;
|
|
4250
|
+
this.totalRecordsUnFiltered = response.page_info.total_count_unfiltered;
|
|
4247
4251
|
this.pollForInvoices();
|
|
4248
4252
|
this.cdr.markForCheck();
|
|
4249
4253
|
}).add(() => {
|
|
@@ -4256,7 +4260,7 @@ var UserInvoiceComponent = class UserInvoiceComponent extends AppBaseComponent {
|
|
|
4256
4260
|
}
|
|
4257
4261
|
pollForInvoices() {
|
|
4258
4262
|
this.subscription = this.intervalTimer.pipe(mergeMap(() => this.userService.getUserInvoices({}, this.userId))).subscribe((data) => {
|
|
4259
|
-
this.invoices = data.
|
|
4263
|
+
this.invoices = data.result;
|
|
4260
4264
|
this.cdr.markForCheck();
|
|
4261
4265
|
});
|
|
4262
4266
|
}
|
|
@@ -4283,7 +4287,7 @@ var UserInvoiceComponent = class UserInvoiceComponent extends AppBaseComponent {
|
|
|
4283
4287
|
selector: "pw-user-invoice",
|
|
4284
4288
|
usesInheritance: true,
|
|
4285
4289
|
ngImport: i0,
|
|
4286
|
-
template: "<div class=\"row\" [class.custom-disable-wrapper]=\"buttonBusy\">\n <div class=\"col-12 d-flex flex-wrap justify-content-between align-items-center\">\n <h2 class=\"card-title p-0 float-start\">{{ 'User.Invoices.Title' | transloco }}</h2>\n </div>\n</div>\n\n@if (!isLoaded) {\n <div class=\"w-100 mt-3\">\n <pw-skeleton-table [rows]=\"8\" [columns]=\"6\" [showCaption]=\"true\" />\n </div>\n}\n<div class=\"row primeng-datatable-container actions-collapsed mt-0\" [class.d-none]=\"!isLoaded\" [class.custom-disable-wrapper]=\"buttonBusy\" [class.hideTable]=\"totalRecordsUnFiltered === 0\">\n <div class=\"col-12 px-0\">\n <p-table #tt\n [value]=\"invoices\"\n [paginator]=\"totalRecords !== 0\"\n [rows]=\"PAGE_SIZE\"\n [lazy]=\"true\"\n [totalRecords]=\"totalRecords\"\n (onLazyLoad)=\"onLazyLoad($event)\"\n stateKey=\"pw-table.user-invoice\"\n stateStorage=\"session\"\n [resizableColumns]=\"true\"\n columnResizeMode=\"expand\"\n >\n <ng-template #caption>\n <div class=\"search-filter justify-content-end\">\n <div class=\"text-end\">\n <label for=\"user-invoice-search\" class=\"visually-hidden\">{{ 'User.Invoices.Search' | transloco }}</label>\n <p-iconfield iconPosition=\"left\">\n <p-inputicon><i class=\"fa fa-search\" aria-hidden=\"true\"></i></p-inputicon>\n <input id=\"user-invoice-search\"\n name=\"user-invoice-search\"\n [(ngModel)]=\"searchText\"\n (input)=\"tt.filterGlobal($event.target.value, 'contains')\"\n type=\"text\"\n pInputText\n [placeholder]=\"'User.Invoices.SearchPlaceholder' | transloco\"\n data-cy=\"incident-search\"\n [attr.aria-label]=\"'User.Invoices.Search' | transloco\" />\n </p-iconfield>\n </div>\n </div>\n </ng-template>\n\n <ng-template #header>\n <tr>\n <th pResizableColumn scope=\"col\" pSortableColumn=\"date\">{{ 'User.Invoices.Date' | transloco }} <p-sort-icon field=\"date\"></p-sort-icon></th>\n <th pResizableColumn scope=\"col\" pSortableColumn=\"frequency\">{{ 'User.Subscriptions.Frequency' | transloco }} <p-sort-icon field=\"frequency\"></p-sort-icon></th>\n <th pResizableColumn scope=\"col\" pSortableColumn=\"seatsPurchased\">{{ 'User.Invoices.SeatsPurchased' | transloco }} <p-sort-icon field=\"seatsPurchased\"></p-sort-icon></th>\n <th pResizableColumn scope=\"col\" pSortableColumn=\"subtotal\">{{ 'User.Invoices.Subtotal' | transloco }} <p-sort-icon field=\"subtotal\"></p-sort-icon></th>\n <th pResizableColumn scope=\"col\" pSortableColumn=\"total\">{{ 'User.Invoices.TotalInclTax' | transloco }} <p-sort-icon field=\"total\"></p-sort-icon></th>\n <th pResizableColumn scope=\"col\">{{ 'Label.Actions' | transloco }}</th>\n </tr>\n </ng-template>\n\n <ng-template #body let-invoice>\n <tr>\n <td>{{ invoice.date | date:'dd-MMM-yyyy' }}</td>\n <td>\n <span class=\"badge\"\n [appDynamicBadge]=\"{\n itemsArray: invoiceFrequency,\n item: invoice.product.billing_frequency\n }\"\n color=\"blue-grey\">{{ invoice.product.billing_frequency }}</span>\n </td>\n <td>{{ invoice?.subscription_product?.purchased_units }}</td>\n <td>{{ (invoice.subtotal_in_cents / 100) | currency:invoice?.product?.currency }}</td>\n <td class=\"td-total\">{{ (invoice.total_in_cents / 100) | currency:invoice?.product?.currency }}</td>\n <td>\n @if (invoice?.file?.url) {\n <a class=\"btn btn-sm btn-primary\" [attr.href]=\"invoice.file.url\" target=\"_blank\">\n <i class=\"fa fa-download\"> {{ 'User.Invoices.Download' | transloco }}</i>\n </a>\n } @else if (invoice?.stripe_invoice_pdf) {\n <a class=\"btn btn-sm btn-primary\" [attr.href]=\"invoice.stripe_invoice_pdf\" target=\"_blank\">\n <i class=\"fa fa-download\"> {{ 'User.Invoices.Download' | transloco }}</i>\n </a>\n } @else {\n <button type=\"button\" class=\"btn btn-sm btn-primary invoice-download-unavailable\" aria-disabled=\"true\"\n data-cy=\"invoice-download-unavailable\"\n [pTooltip]=\"'User.Invoices.NoFile' | transloco\" tooltipPosition=\"top\" appendTo=\"body\"\n [attr.aria-label]=\"'User.Invoices.NoFile' | transloco\">\n <i class=\"fa fa-download\"> {{ 'User.Invoices.Download' | transloco }}</i>\n </button>\n }\n </td>\n </tr>\n </ng-template>\n </p-table>\n @if (totalRecords === 0 && totalRecordsUnFiltered !== 0) {\n <div>\n <pw-no-data [withImage]=\"true\" [message]=\"'Search.NoDataMessage' | transloco\" [description]=\"'Search.NoDataDescription' | transloco\" >\n </pw-no-data>\n </div>\n }\n\n @if (totalRecords !== 0) {\n <pw-records-summary [showing]=\"tt?.value?.length ?? 0\" [total]=\"totalRecords\" />\n }\n\n </div>\n</div>\n@if (totalRecordsUnFiltered === 0 && isLoaded) {\n <pw-no-data [withImage]=\"true\" message=\"You don't have any invoice yet.\">\n </pw-no-data>\n}\n\n",
|
|
4290
|
+
template: "<div class=\"row\" [class.custom-disable-wrapper]=\"buttonBusy\">\n <div class=\"col-12 d-flex flex-wrap justify-content-between align-items-center\">\n <h2 class=\"card-title p-0 float-start\">{{ 'User.Invoices.Title' | transloco }}</h2>\n </div>\n</div>\n\n@if (!isLoaded) {\n <div class=\"w-100 mt-3\">\n <pw-skeleton-table [rows]=\"8\" [columns]=\"6\" [showCaption]=\"true\" />\n </div>\n}\n<div class=\"row primeng-datatable-container actions-collapsed mt-0\" [class.d-none]=\"!isLoaded\" [class.custom-disable-wrapper]=\"buttonBusy\" [class.hideTable]=\"totalRecordsUnFiltered === 0\">\n <div class=\"col-12 px-0\">\n <p-table #tt\n [value]=\"invoices\"\n [paginator]=\"true\" [alwaysShowPaginator]=\"totalRecords !== 0\"\n [rows]=\"PAGE_SIZE\"\n [lazy]=\"true\"\n [totalRecords]=\"totalRecords\"\n (onLazyLoad)=\"onLazyLoad($event)\"\n stateKey=\"pw-table.user-invoice\"\n stateStorage=\"session\"\n [resizableColumns]=\"true\"\n columnResizeMode=\"expand\"\n >\n <ng-template #caption>\n <div class=\"search-filter justify-content-end\">\n <div class=\"text-end\">\n <label for=\"user-invoice-search\" class=\"visually-hidden\">{{ 'User.Invoices.Search' | transloco }}</label>\n <p-iconfield iconPosition=\"left\">\n <p-inputicon><i class=\"fa fa-search\" aria-hidden=\"true\"></i></p-inputicon>\n <input id=\"user-invoice-search\"\n name=\"user-invoice-search\"\n [(ngModel)]=\"searchText\"\n (input)=\"tt.filterGlobal($event.target.value, 'contains')\"\n type=\"text\"\n pInputText\n [placeholder]=\"'User.Invoices.SearchPlaceholder' | transloco\"\n data-cy=\"incident-search\"\n [attr.aria-label]=\"'User.Invoices.Search' | transloco\" />\n </p-iconfield>\n </div>\n </div>\n </ng-template>\n\n <ng-template #header>\n <tr>\n <th pResizableColumn scope=\"col\" pSortableColumn=\"date\">{{ 'User.Invoices.Date' | transloco }} <p-sort-icon field=\"date\"></p-sort-icon></th>\n <th pResizableColumn scope=\"col\" pSortableColumn=\"frequency\">{{ 'User.Subscriptions.Frequency' | transloco }} <p-sort-icon field=\"frequency\"></p-sort-icon></th>\n <th pResizableColumn scope=\"col\" pSortableColumn=\"seatsPurchased\">{{ 'User.Invoices.SeatsPurchased' | transloco }} <p-sort-icon field=\"seatsPurchased\"></p-sort-icon></th>\n <th pResizableColumn scope=\"col\" pSortableColumn=\"subtotal\">{{ 'User.Invoices.Subtotal' | transloco }} <p-sort-icon field=\"subtotal\"></p-sort-icon></th>\n <th pResizableColumn scope=\"col\" pSortableColumn=\"total\">{{ 'User.Invoices.TotalInclTax' | transloco }} <p-sort-icon field=\"total\"></p-sort-icon></th>\n <th pResizableColumn scope=\"col\">{{ 'Label.Actions' | transloco }}</th>\n </tr>\n </ng-template>\n\n <ng-template #body let-invoice>\n <tr>\n <td>{{ invoice.date | date:'dd-MMM-yyyy' }}</td>\n <td>\n <span class=\"badge\"\n [appDynamicBadge]=\"{\n itemsArray: invoiceFrequency,\n item: invoice.product.billing_frequency\n }\"\n color=\"blue-grey\">{{ invoice.product.billing_frequency }}</span>\n </td>\n <td>{{ invoice?.subscription_product?.purchased_units }}</td>\n <td>{{ (invoice.subtotal_in_cents / 100) | currency:invoice?.product?.currency }}</td>\n <td class=\"td-total\">{{ (invoice.total_in_cents / 100) | currency:invoice?.product?.currency }}</td>\n <td>\n @if (invoice?.file?.url) {\n <a class=\"btn btn-sm btn-primary\" [attr.href]=\"invoice.file.url\" target=\"_blank\">\n <i class=\"fa fa-download\"> {{ 'User.Invoices.Download' | transloco }}</i>\n </a>\n } @else if (invoice?.stripe_invoice_pdf) {\n <a class=\"btn btn-sm btn-primary\" [attr.href]=\"invoice.stripe_invoice_pdf\" target=\"_blank\">\n <i class=\"fa fa-download\"> {{ 'User.Invoices.Download' | transloco }}</i>\n </a>\n } @else {\n <button type=\"button\" class=\"btn btn-sm btn-primary invoice-download-unavailable\" aria-disabled=\"true\"\n data-cy=\"invoice-download-unavailable\"\n [pTooltip]=\"'User.Invoices.NoFile' | transloco\" tooltipPosition=\"top\" appendTo=\"body\"\n [attr.aria-label]=\"'User.Invoices.NoFile' | transloco\">\n <i class=\"fa fa-download\"> {{ 'User.Invoices.Download' | transloco }}</i>\n </button>\n }\n </td>\n </tr>\n </ng-template>\n </p-table>\n @if (totalRecords === 0 && totalRecordsUnFiltered !== 0) {\n <div>\n <pw-no-data [withImage]=\"true\" [message]=\"'Search.NoDataMessage' | transloco\" [description]=\"'Search.NoDataDescription' | transloco\" >\n </pw-no-data>\n </div>\n }\n\n @if (totalRecords !== 0) {\n <pw-records-summary [showing]=\"tt?.value?.length ?? 0\" [total]=\"totalRecords\" />\n }\n\n </div>\n</div>\n@if (totalRecordsUnFiltered === 0 && isLoaded) {\n <pw-no-data [withImage]=\"true\" message=\"You don't have any invoice yet.\">\n </pw-no-data>\n}\n\n",
|
|
4287
4291
|
styles: [".page-heading{background:#fcfcfc;border-bottom:1px solid rgba(0,0,0,.1);position:relative;width:100%}.page-heading:after{clear:both;content:\"\";display:table}.page-heading .page-heading__container{padding:15px 20px;position:relative}.page-heading .page-heading__container .title{color:#242437;font-size:15px;font-weight:500;line-height:20px;margin:3px 0 0;overflow:hidden;padding:0;text-overflow:ellipsis;width:95%}.card .card-container{position:absolute;right:20px;top:25px;z-index:1}.td-total{font-weight:700}.card-inner-container{background:#0000000d;border:1px dashed rgba(0,0,0,.1);border-radius:3px;margin-bottom:20px;padding:20px}.invoice-text{display:flex;font-size:13px;justify-content:space-between;margin:10px 0}.invoice-template{min-height:calc(100vh - 190px)}.btn.btn-primary.invoice-download-unavailable{cursor:not-allowed;opacity:var(--bs-btn-disabled-opacity)}.btn.btn-primary.invoice-download-unavailable:hover,.btn.btn-primary.invoice-download-unavailable:active{background-color:var(--first)!important;border-color:var(--first)!important;color:rgba(var(--bs-light-rgb),1)!important}\n"],
|
|
4288
4292
|
dependencies: [
|
|
4289
4293
|
{
|
|
@@ -4571,7 +4575,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
4571
4575
|
DatePipe,
|
|
4572
4576
|
TranslocoPipe
|
|
4573
4577
|
],
|
|
4574
|
-
template: "<div class=\"row\" [class.custom-disable-wrapper]=\"buttonBusy\">\n <div class=\"col-12 d-flex flex-wrap justify-content-between align-items-center\">\n <h2 class=\"card-title p-0 float-start\">{{ 'User.Invoices.Title' | transloco }}</h2>\n </div>\n</div>\n\n@if (!isLoaded) {\n <div class=\"w-100 mt-3\">\n <pw-skeleton-table [rows]=\"8\" [columns]=\"6\" [showCaption]=\"true\" />\n </div>\n}\n<div class=\"row primeng-datatable-container actions-collapsed mt-0\" [class.d-none]=\"!isLoaded\" [class.custom-disable-wrapper]=\"buttonBusy\" [class.hideTable]=\"totalRecordsUnFiltered === 0\">\n <div class=\"col-12 px-0\">\n <p-table #tt\n [value]=\"invoices\"\n [paginator]=\"totalRecords !== 0\"\n [rows]=\"PAGE_SIZE\"\n [lazy]=\"true\"\n [totalRecords]=\"totalRecords\"\n (onLazyLoad)=\"onLazyLoad($event)\"\n stateKey=\"pw-table.user-invoice\"\n stateStorage=\"session\"\n [resizableColumns]=\"true\"\n columnResizeMode=\"expand\"\n >\n <ng-template #caption>\n <div class=\"search-filter justify-content-end\">\n <div class=\"text-end\">\n <label for=\"user-invoice-search\" class=\"visually-hidden\">{{ 'User.Invoices.Search' | transloco }}</label>\n <p-iconfield iconPosition=\"left\">\n <p-inputicon><i class=\"fa fa-search\" aria-hidden=\"true\"></i></p-inputicon>\n <input id=\"user-invoice-search\"\n name=\"user-invoice-search\"\n [(ngModel)]=\"searchText\"\n (input)=\"tt.filterGlobal($event.target.value, 'contains')\"\n type=\"text\"\n pInputText\n [placeholder]=\"'User.Invoices.SearchPlaceholder' | transloco\"\n data-cy=\"incident-search\"\n [attr.aria-label]=\"'User.Invoices.Search' | transloco\" />\n </p-iconfield>\n </div>\n </div>\n </ng-template>\n\n <ng-template #header>\n <tr>\n <th pResizableColumn scope=\"col\" pSortableColumn=\"date\">{{ 'User.Invoices.Date' | transloco }} <p-sort-icon field=\"date\"></p-sort-icon></th>\n <th pResizableColumn scope=\"col\" pSortableColumn=\"frequency\">{{ 'User.Subscriptions.Frequency' | transloco }} <p-sort-icon field=\"frequency\"></p-sort-icon></th>\n <th pResizableColumn scope=\"col\" pSortableColumn=\"seatsPurchased\">{{ 'User.Invoices.SeatsPurchased' | transloco }} <p-sort-icon field=\"seatsPurchased\"></p-sort-icon></th>\n <th pResizableColumn scope=\"col\" pSortableColumn=\"subtotal\">{{ 'User.Invoices.Subtotal' | transloco }} <p-sort-icon field=\"subtotal\"></p-sort-icon></th>\n <th pResizableColumn scope=\"col\" pSortableColumn=\"total\">{{ 'User.Invoices.TotalInclTax' | transloco }} <p-sort-icon field=\"total\"></p-sort-icon></th>\n <th pResizableColumn scope=\"col\">{{ 'Label.Actions' | transloco }}</th>\n </tr>\n </ng-template>\n\n <ng-template #body let-invoice>\n <tr>\n <td>{{ invoice.date | date:'dd-MMM-yyyy' }}</td>\n <td>\n <span class=\"badge\"\n [appDynamicBadge]=\"{\n itemsArray: invoiceFrequency,\n item: invoice.product.billing_frequency\n }\"\n color=\"blue-grey\">{{ invoice.product.billing_frequency }}</span>\n </td>\n <td>{{ invoice?.subscription_product?.purchased_units }}</td>\n <td>{{ (invoice.subtotal_in_cents / 100) | currency:invoice?.product?.currency }}</td>\n <td class=\"td-total\">{{ (invoice.total_in_cents / 100) | currency:invoice?.product?.currency }}</td>\n <td>\n @if (invoice?.file?.url) {\n <a class=\"btn btn-sm btn-primary\" [attr.href]=\"invoice.file.url\" target=\"_blank\">\n <i class=\"fa fa-download\"> {{ 'User.Invoices.Download' | transloco }}</i>\n </a>\n } @else if (invoice?.stripe_invoice_pdf) {\n <a class=\"btn btn-sm btn-primary\" [attr.href]=\"invoice.stripe_invoice_pdf\" target=\"_blank\">\n <i class=\"fa fa-download\"> {{ 'User.Invoices.Download' | transloco }}</i>\n </a>\n } @else {\n <button type=\"button\" class=\"btn btn-sm btn-primary invoice-download-unavailable\" aria-disabled=\"true\"\n data-cy=\"invoice-download-unavailable\"\n [pTooltip]=\"'User.Invoices.NoFile' | transloco\" tooltipPosition=\"top\" appendTo=\"body\"\n [attr.aria-label]=\"'User.Invoices.NoFile' | transloco\">\n <i class=\"fa fa-download\"> {{ 'User.Invoices.Download' | transloco }}</i>\n </button>\n }\n </td>\n </tr>\n </ng-template>\n </p-table>\n @if (totalRecords === 0 && totalRecordsUnFiltered !== 0) {\n <div>\n <pw-no-data [withImage]=\"true\" [message]=\"'Search.NoDataMessage' | transloco\" [description]=\"'Search.NoDataDescription' | transloco\" >\n </pw-no-data>\n </div>\n }\n\n @if (totalRecords !== 0) {\n <pw-records-summary [showing]=\"tt?.value?.length ?? 0\" [total]=\"totalRecords\" />\n }\n\n </div>\n</div>\n@if (totalRecordsUnFiltered === 0 && isLoaded) {\n <pw-no-data [withImage]=\"true\" message=\"You don't have any invoice yet.\">\n </pw-no-data>\n}\n\n",
|
|
4578
|
+
template: "<div class=\"row\" [class.custom-disable-wrapper]=\"buttonBusy\">\n <div class=\"col-12 d-flex flex-wrap justify-content-between align-items-center\">\n <h2 class=\"card-title p-0 float-start\">{{ 'User.Invoices.Title' | transloco }}</h2>\n </div>\n</div>\n\n@if (!isLoaded) {\n <div class=\"w-100 mt-3\">\n <pw-skeleton-table [rows]=\"8\" [columns]=\"6\" [showCaption]=\"true\" />\n </div>\n}\n<div class=\"row primeng-datatable-container actions-collapsed mt-0\" [class.d-none]=\"!isLoaded\" [class.custom-disable-wrapper]=\"buttonBusy\" [class.hideTable]=\"totalRecordsUnFiltered === 0\">\n <div class=\"col-12 px-0\">\n <p-table #tt\n [value]=\"invoices\"\n [paginator]=\"true\" [alwaysShowPaginator]=\"totalRecords !== 0\"\n [rows]=\"PAGE_SIZE\"\n [lazy]=\"true\"\n [totalRecords]=\"totalRecords\"\n (onLazyLoad)=\"onLazyLoad($event)\"\n stateKey=\"pw-table.user-invoice\"\n stateStorage=\"session\"\n [resizableColumns]=\"true\"\n columnResizeMode=\"expand\"\n >\n <ng-template #caption>\n <div class=\"search-filter justify-content-end\">\n <div class=\"text-end\">\n <label for=\"user-invoice-search\" class=\"visually-hidden\">{{ 'User.Invoices.Search' | transloco }}</label>\n <p-iconfield iconPosition=\"left\">\n <p-inputicon><i class=\"fa fa-search\" aria-hidden=\"true\"></i></p-inputicon>\n <input id=\"user-invoice-search\"\n name=\"user-invoice-search\"\n [(ngModel)]=\"searchText\"\n (input)=\"tt.filterGlobal($event.target.value, 'contains')\"\n type=\"text\"\n pInputText\n [placeholder]=\"'User.Invoices.SearchPlaceholder' | transloco\"\n data-cy=\"incident-search\"\n [attr.aria-label]=\"'User.Invoices.Search' | transloco\" />\n </p-iconfield>\n </div>\n </div>\n </ng-template>\n\n <ng-template #header>\n <tr>\n <th pResizableColumn scope=\"col\" pSortableColumn=\"date\">{{ 'User.Invoices.Date' | transloco }} <p-sort-icon field=\"date\"></p-sort-icon></th>\n <th pResizableColumn scope=\"col\" pSortableColumn=\"frequency\">{{ 'User.Subscriptions.Frequency' | transloco }} <p-sort-icon field=\"frequency\"></p-sort-icon></th>\n <th pResizableColumn scope=\"col\" pSortableColumn=\"seatsPurchased\">{{ 'User.Invoices.SeatsPurchased' | transloco }} <p-sort-icon field=\"seatsPurchased\"></p-sort-icon></th>\n <th pResizableColumn scope=\"col\" pSortableColumn=\"subtotal\">{{ 'User.Invoices.Subtotal' | transloco }} <p-sort-icon field=\"subtotal\"></p-sort-icon></th>\n <th pResizableColumn scope=\"col\" pSortableColumn=\"total\">{{ 'User.Invoices.TotalInclTax' | transloco }} <p-sort-icon field=\"total\"></p-sort-icon></th>\n <th pResizableColumn scope=\"col\">{{ 'Label.Actions' | transloco }}</th>\n </tr>\n </ng-template>\n\n <ng-template #body let-invoice>\n <tr>\n <td>{{ invoice.date | date:'dd-MMM-yyyy' }}</td>\n <td>\n <span class=\"badge\"\n [appDynamicBadge]=\"{\n itemsArray: invoiceFrequency,\n item: invoice.product.billing_frequency\n }\"\n color=\"blue-grey\">{{ invoice.product.billing_frequency }}</span>\n </td>\n <td>{{ invoice?.subscription_product?.purchased_units }}</td>\n <td>{{ (invoice.subtotal_in_cents / 100) | currency:invoice?.product?.currency }}</td>\n <td class=\"td-total\">{{ (invoice.total_in_cents / 100) | currency:invoice?.product?.currency }}</td>\n <td>\n @if (invoice?.file?.url) {\n <a class=\"btn btn-sm btn-primary\" [attr.href]=\"invoice.file.url\" target=\"_blank\">\n <i class=\"fa fa-download\"> {{ 'User.Invoices.Download' | transloco }}</i>\n </a>\n } @else if (invoice?.stripe_invoice_pdf) {\n <a class=\"btn btn-sm btn-primary\" [attr.href]=\"invoice.stripe_invoice_pdf\" target=\"_blank\">\n <i class=\"fa fa-download\"> {{ 'User.Invoices.Download' | transloco }}</i>\n </a>\n } @else {\n <button type=\"button\" class=\"btn btn-sm btn-primary invoice-download-unavailable\" aria-disabled=\"true\"\n data-cy=\"invoice-download-unavailable\"\n [pTooltip]=\"'User.Invoices.NoFile' | transloco\" tooltipPosition=\"top\" appendTo=\"body\"\n [attr.aria-label]=\"'User.Invoices.NoFile' | transloco\">\n <i class=\"fa fa-download\"> {{ 'User.Invoices.Download' | transloco }}</i>\n </button>\n }\n </td>\n </tr>\n </ng-template>\n </p-table>\n @if (totalRecords === 0 && totalRecordsUnFiltered !== 0) {\n <div>\n <pw-no-data [withImage]=\"true\" [message]=\"'Search.NoDataMessage' | transloco\" [description]=\"'Search.NoDataDescription' | transloco\" >\n </pw-no-data>\n </div>\n }\n\n @if (totalRecords !== 0) {\n <pw-records-summary [showing]=\"tt?.value?.length ?? 0\" [total]=\"totalRecords\" />\n }\n\n </div>\n</div>\n@if (totalRecordsUnFiltered === 0 && isLoaded) {\n <pw-no-data [withImage]=\"true\" message=\"You don't have any invoice yet.\">\n </pw-no-data>\n}\n\n",
|
|
4575
4579
|
styles: [".page-heading{background:#fcfcfc;border-bottom:1px solid rgba(0,0,0,.1);position:relative;width:100%}.page-heading:after{clear:both;content:\"\";display:table}.page-heading .page-heading__container{padding:15px 20px;position:relative}.page-heading .page-heading__container .title{color:#242437;font-size:15px;font-weight:500;line-height:20px;margin:3px 0 0;overflow:hidden;padding:0;text-overflow:ellipsis;width:95%}.card .card-container{position:absolute;right:20px;top:25px;z-index:1}.td-total{font-weight:700}.card-inner-container{background:#0000000d;border:1px dashed rgba(0,0,0,.1);border-radius:3px;margin-bottom:20px;padding:20px}.invoice-text{display:flex;font-size:13px;justify-content:space-between;margin:10px 0}.invoice-template{min-height:calc(100vh - 190px)}.btn.btn-primary.invoice-download-unavailable{cursor:not-allowed;opacity:var(--bs-btn-disabled-opacity)}.btn.btn-primary.invoice-download-unavailable:hover,.btn.btn-primary.invoice-download-unavailable:active{background-color:var(--first)!important;border-color:var(--first)!important;color:rgba(var(--bs-light-rgb),1)!important}\n"]
|
|
4576
4580
|
}]
|
|
4577
4581
|
}]
|
|
@@ -4692,8 +4696,8 @@ var CommunicationTabComponent = class CommunicationTabComponent extends AppBaseC
|
|
|
4692
4696
|
this.user = user.currentUser;
|
|
4693
4697
|
this.profileService.getUserObject("user_newsletters", this.user.slug).subscribe((newsletter) => {
|
|
4694
4698
|
this.isLoaded = true;
|
|
4695
|
-
this.userSubscription = newsletter;
|
|
4696
|
-
this.subscriptions = response.
|
|
4699
|
+
this.userSubscription = newsletter.result;
|
|
4700
|
+
this.subscriptions = response.result;
|
|
4697
4701
|
if (this.userSubscription.length > 0 && this.subscriptions.length > 0) this.subscriptions.forEach((element) => {
|
|
4698
4702
|
const item = this.userSubscription?.find((x) => x.newsletter_id === element.id);
|
|
4699
4703
|
element.enabled = item ? item.send_newsletters : false;
|
|
@@ -4853,7 +4857,7 @@ var OthersTabComponent = class OthersTabComponent extends AppBaseComponent {
|
|
|
4853
4857
|
}
|
|
4854
4858
|
getGlobalSubscriptionConfig() {
|
|
4855
4859
|
this.commonService.getAllGlobalSubscriptionConfigs().subscribe((response) => {
|
|
4856
|
-
this.subscriptionConfigs = response.
|
|
4860
|
+
this.subscriptionConfigs = response.result;
|
|
4857
4861
|
this.globalConfigs.forEach((globalConfig) => {
|
|
4858
4862
|
const config = this.subscriptionConfigs?.find((subscriptionConfig) => subscriptionConfig.global_config_id === globalConfig?.id);
|
|
4859
4863
|
globalConfig.value = config?.value;
|
|
@@ -4867,7 +4871,7 @@ var OthersTabComponent = class OthersTabComponent extends AppBaseComponent {
|
|
|
4867
4871
|
}
|
|
4868
4872
|
getGlobalConfigs() {
|
|
4869
4873
|
this.commonService.getAllGlobalConfigs().subscribe((response) => {
|
|
4870
|
-
this.globalConfigs = response.
|
|
4874
|
+
this.globalConfigs = response.result;
|
|
4871
4875
|
this.getGlobalSubscriptionConfig();
|
|
4872
4876
|
this.cdr.markForCheck();
|
|
4873
4877
|
});
|
|
@@ -5018,7 +5022,7 @@ var SecurityTabComponent = class SecurityTabComponent extends AppBaseComponent {
|
|
|
5018
5022
|
const password = this.passwordRef.nativeElement.value;
|
|
5019
5023
|
if (password) this.userService.checkPassword({ password }).subscribe({
|
|
5020
5024
|
next: (data) => {
|
|
5021
|
-
if (data?.status === StatusCodes.OK) {
|
|
5025
|
+
if (data?.result?.status === StatusCodes.OK) {
|
|
5022
5026
|
if (this.user?.enable_two_factor_authenticator === false) {
|
|
5023
5027
|
this.passwordVerified = true;
|
|
5024
5028
|
this.create2FA();
|
|
@@ -5041,7 +5045,7 @@ var SecurityTabComponent = class SecurityTabComponent extends AppBaseComponent {
|
|
|
5041
5045
|
}
|
|
5042
5046
|
create2FA() {
|
|
5043
5047
|
this.userService.createTwoFactorAuthenticator().subscribe((res) => {
|
|
5044
|
-
this.created2faDetails = res;
|
|
5048
|
+
this.created2faDetails = res.result;
|
|
5045
5049
|
this.cdr.markForCheck();
|
|
5046
5050
|
});
|
|
5047
5051
|
}
|
|
@@ -5078,7 +5082,7 @@ var SecurityTabComponent = class SecurityTabComponent extends AppBaseComponent {
|
|
|
5078
5082
|
const password = this.ssoPasswordRef.nativeElement.value;
|
|
5079
5083
|
if (password) this.userService.checkPassword({ password }).subscribe({
|
|
5080
5084
|
next: (data) => {
|
|
5081
|
-
if (data?.status === StatusCodes.OK) this.ssoPasswordVerified = true;
|
|
5085
|
+
if (data?.result?.status === StatusCodes.OK) this.ssoPasswordVerified = true;
|
|
5082
5086
|
this.cdr.markForCheck();
|
|
5083
5087
|
},
|
|
5084
5088
|
error: (err) => {
|
|
@@ -5336,7 +5340,7 @@ var SupportComponent = class SupportComponent extends AppBaseComponent {
|
|
|
5336
5340
|
getAllSupport() {
|
|
5337
5341
|
this.isLoading = true;
|
|
5338
5342
|
this.commonService.getAllCustomerSupport(this.subscriptionId).subscribe((response) => {
|
|
5339
|
-
this.supports = response;
|
|
5343
|
+
this.supports = response.result;
|
|
5340
5344
|
this.cdr.markForCheck();
|
|
5341
5345
|
}).add(() => {
|
|
5342
5346
|
this.isLoading = false;
|
|
@@ -5823,7 +5827,7 @@ var EditPortfoliosComponent = class EditPortfoliosComponent {
|
|
|
5823
5827
|
}
|
|
5824
5828
|
getProjectPictures() {
|
|
5825
5829
|
this.profileService.getProjectPictures(this.slug).subscribe((response) => {
|
|
5826
|
-
if (response.length > 0) this.projectPictures = response.flatMap((x) => x.project_pictures);
|
|
5830
|
+
if (response.result.length > 0) this.projectPictures = response.result.flatMap((x) => x.project_pictures);
|
|
5827
5831
|
this.cdr.markForCheck();
|
|
5828
5832
|
});
|
|
5829
5833
|
}
|
|
@@ -6991,7 +6995,7 @@ var EditSkillsModalComponent = class EditSkillsModalComponent extends AppBaseCom
|
|
|
6991
6995
|
}
|
|
6992
6996
|
getSkills() {
|
|
6993
6997
|
this.tagService.getTagsByType("skills", {}).subscribe((response) => {
|
|
6994
|
-
this.allSkills = response.
|
|
6998
|
+
this.allSkills = response.result;
|
|
6995
6999
|
this.getEntitySkills();
|
|
6996
7000
|
this.cdr.markForCheck();
|
|
6997
7001
|
});
|
|
@@ -7011,7 +7015,7 @@ var EditSkillsModalComponent = class EditSkillsModalComponent extends AppBaseCom
|
|
|
7011
7015
|
getEntitySkills() {
|
|
7012
7016
|
this.tagService.getTagsByEntity(this.slug, this.entityEntity, this.entityType).subscribe((response) => {
|
|
7013
7017
|
this.selectedSkills = this.allSkills.filter((item) => {
|
|
7014
|
-
return response.
|
|
7018
|
+
return response.result.find((x) => x.id === item.id);
|
|
7015
7019
|
});
|
|
7016
7020
|
this.cdr.markForCheck();
|
|
7017
7021
|
});
|
|
@@ -7550,10 +7554,10 @@ var EditUserProfileModalComponent = class EditUserProfileModalComponent extends
|
|
|
7550
7554
|
const data = { ...this.form.value };
|
|
7551
7555
|
data.dob = HelperService.dateFormat(this.form.get("dob").value);
|
|
7552
7556
|
this.profileService.updateUserProfile(data).subscribe((response) => {
|
|
7553
|
-
if (response.id) {
|
|
7557
|
+
if (response.result?.id) {
|
|
7554
7558
|
this.toast.success(this.translation.translate("User.Profile.ProfileUpdated"));
|
|
7555
7559
|
this.modalService.dismissAll();
|
|
7556
|
-
this.saveEvent.emit(response);
|
|
7560
|
+
this.saveEvent.emit(response.result);
|
|
7557
7561
|
}
|
|
7558
7562
|
this.cdr.markForCheck();
|
|
7559
7563
|
}).add(() => {
|
|
@@ -7908,12 +7912,12 @@ var UserAboutComponent = class UserAboutComponent extends AppBaseComponent {
|
|
|
7908
7912
|
user_skills: this.tagService.getGroupedSkills(this.user.slug, TAG_ENTITY.USER, TAG_TYPE.SKILLS)
|
|
7909
7913
|
}).subscribe({
|
|
7910
7914
|
next: (response) => {
|
|
7911
|
-
this.user_profile = response.user_profile;
|
|
7912
|
-
this.user["profile"] =
|
|
7913
|
-
this.qualifications = response.qualifications;
|
|
7914
|
-
this.userLinks = response.user_links || [];
|
|
7915
|
+
this.user_profile = response.user_profile.result;
|
|
7916
|
+
this.user["profile"] = this.user_profile;
|
|
7917
|
+
this.qualifications = response.qualifications.result;
|
|
7918
|
+
this.userLinks = response.user_links.result || [];
|
|
7915
7919
|
this.noUserLinks = Object.values(this.userLinks).some((x) => !!x);
|
|
7916
|
-
this.selectedSkills = response.user_skills;
|
|
7920
|
+
this.selectedSkills = response.user_skills.result;
|
|
7917
7921
|
this.loading = false;
|
|
7918
7922
|
this.cdr.markForCheck();
|
|
7919
7923
|
},
|
|
@@ -7930,7 +7934,7 @@ var UserAboutComponent = class UserAboutComponent extends AppBaseComponent {
|
|
|
7930
7934
|
}
|
|
7931
7935
|
getSkills() {
|
|
7932
7936
|
this.tagService.getTagsByType("skills", {}).subscribe((response) => {
|
|
7933
|
-
this.allSkills = response.
|
|
7937
|
+
this.allSkills = response.result;
|
|
7934
7938
|
this.cdr.markForCheck();
|
|
7935
7939
|
});
|
|
7936
7940
|
}
|
|
@@ -8151,7 +8155,7 @@ var PortfoliosComponent = class PortfoliosComponent {
|
|
|
8151
8155
|
}
|
|
8152
8156
|
getProjectPictures() {
|
|
8153
8157
|
this.service.getProjectPictures(this.user.slug).subscribe((response) => {
|
|
8154
|
-
if (response.length > 0) this.projectPictures = response.flatMap((x) => x.project_pictures);
|
|
8158
|
+
if (response.result.length > 0) this.projectPictures = response.result.flatMap((x) => x.project_pictures);
|
|
8155
8159
|
this.isLoaded = true;
|
|
8156
8160
|
this.cdr.markForCheck();
|
|
8157
8161
|
});
|
|
@@ -8291,7 +8295,7 @@ var UserProjectsComponent = class UserProjectsComponent extends AppBaseComponent
|
|
|
8291
8295
|
getProjects() {
|
|
8292
8296
|
const profileSlug = this.user?.slug || this.slug;
|
|
8293
8297
|
this.service.getProjects(profileSlug).subscribe((response) => {
|
|
8294
|
-
this.projects = response.projects;
|
|
8298
|
+
this.projects = response.result.projects;
|
|
8295
8299
|
this.isLoaded = true;
|
|
8296
8300
|
this.cdr.markForCheck();
|
|
8297
8301
|
});
|
|
@@ -8655,7 +8659,7 @@ var UserProfilePageComponent = class UserProfilePageComponent extends AppBaseCom
|
|
|
8655
8659
|
const file = new File([blob], filename);
|
|
8656
8660
|
this.userService.addAvatar(file).subscribe((res) => {
|
|
8657
8661
|
this.modalService.dismissAll();
|
|
8658
|
-
this.image = res?.user_avatar[2]?.url;
|
|
8662
|
+
this.image = res?.result?.user_avatar[2]?.url;
|
|
8659
8663
|
this.cdr.markForCheck();
|
|
8660
8664
|
});
|
|
8661
8665
|
}
|
|
@@ -8666,9 +8670,9 @@ var UserProfilePageComponent = class UserProfilePageComponent extends AppBaseCom
|
|
|
8666
8670
|
avatar: this.profileService.getUserObject("avatar", this.slug)
|
|
8667
8671
|
}).subscribe({
|
|
8668
8672
|
next: (response) => {
|
|
8669
|
-
this.user = response.user;
|
|
8670
|
-
this.userProfile = response.user_profile;
|
|
8671
|
-
if (response.avatar
|
|
8673
|
+
this.user = response.user.result;
|
|
8674
|
+
this.userProfile = response.user_profile.result;
|
|
8675
|
+
if (response.avatar.result?.length > 0) this.image = response.avatar.result[2]?.url;
|
|
8672
8676
|
this.getCurrentUserDetails();
|
|
8673
8677
|
this.isLoaded = true;
|
|
8674
8678
|
this.cdr.markForCheck();
|
|
@@ -8686,7 +8690,7 @@ var UserProfilePageComponent = class UserProfilePageComponent extends AppBaseCom
|
|
|
8686
8690
|
this.userStore().subscribe((currentUser) => {
|
|
8687
8691
|
if (currentUser) {
|
|
8688
8692
|
this.loggedInUserDetails = currentUser;
|
|
8689
|
-
this.userService.getCurrentUserObject("user_relationships").subscribe((response) => {
|
|
8693
|
+
this.userService.getCurrentUserObject("user_relationships").subscribe(({ result: response }) => {
|
|
8690
8694
|
this.isFollowing = response.length > 0 ? response.some((x) => x.followed_id === this.user.id && currentUser.id === x.follower_id) : false;
|
|
8691
8695
|
this.cdr.markForCheck();
|
|
8692
8696
|
});
|
|
@@ -8698,9 +8702,9 @@ var UserProfilePageComponent = class UserProfilePageComponent extends AppBaseCom
|
|
|
8698
8702
|
this.router.navigate(["/message"], { fragment: this.slug });
|
|
8699
8703
|
}
|
|
8700
8704
|
followUser() {
|
|
8701
|
-
this.userService.followUser(this.user.id).subscribe((
|
|
8705
|
+
this.userService.followUser(this.user.id).subscribe(({ result }) => {
|
|
8702
8706
|
const name = this.user.first_name || this.user.slug;
|
|
8703
|
-
if (
|
|
8707
|
+
if (result?.id) {
|
|
8704
8708
|
this.isFollowing = true;
|
|
8705
8709
|
this.toast.success(`You're now following ${name}`);
|
|
8706
8710
|
} else {
|