@haus-tech/badge-plugin 4.0.1 → 4.0.3-rc.1

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.
@@ -53,6 +53,7 @@ let BadgeAdminResolver = class BadgeAdminResolver {
53
53
  return this.config;
54
54
  }
55
55
  };
56
+ exports.BadgeAdminResolver = BadgeAdminResolver;
56
57
  __decorate([
57
58
  (0, graphql_1.Query)(),
58
59
  __param(0, (0, core_1.Ctx)()),
@@ -91,9 +92,8 @@ __decorate([
91
92
  __metadata("design:paramtypes", []),
92
93
  __metadata("design:returntype", void 0)
93
94
  ], BadgeAdminResolver.prototype, "getBadgePluginConfig", null);
94
- BadgeAdminResolver = __decorate([
95
+ exports.BadgeAdminResolver = BadgeAdminResolver = __decorate([
95
96
  (0, graphql_1.Resolver)(),
96
97
  __param(0, (0, common_1.Inject)(constants_1.PLUGIN_INIT_OPTIONS)),
97
98
  __metadata("design:paramtypes", [Object, badge_service_1.BadgeService])
98
99
  ], BadgeAdminResolver);
99
- exports.BadgeAdminResolver = BadgeAdminResolver;
@@ -29,6 +29,7 @@ let ProductEntityResolver = class ProductEntityResolver {
29
29
  return this.badgeService.findBadgesForProduct(ctx, product);
30
30
  }
31
31
  };
32
+ exports.ProductEntityResolver = ProductEntityResolver;
32
33
  __decorate([
33
34
  (0, graphql_1.ResolveField)(),
34
35
  __param(0, (0, core_1.Ctx)()),
@@ -37,12 +38,11 @@ __decorate([
37
38
  __metadata("design:paramtypes", [core_1.RequestContext, core_1.Product]),
38
39
  __metadata("design:returntype", Promise)
39
40
  ], ProductEntityResolver.prototype, "badges", null);
40
- ProductEntityResolver = __decorate([
41
+ exports.ProductEntityResolver = ProductEntityResolver = __decorate([
41
42
  (0, graphql_1.Resolver)('Product'),
42
43
  __param(0, (0, common_1.Inject)(constants_1.PLUGIN_INIT_OPTIONS)),
43
44
  __metadata("design:paramtypes", [Object, badge_service_1.BadgeService])
44
45
  ], ProductEntityResolver);
45
- exports.ProductEntityResolver = ProductEntityResolver;
46
46
  let SearchResultEntityResolver = class SearchResultEntityResolver {
47
47
  config;
48
48
  badgeService;
@@ -54,6 +54,7 @@ let SearchResultEntityResolver = class SearchResultEntityResolver {
54
54
  return this.badgeService.findBadgesForSearchResult(ctx, searchResult);
55
55
  }
56
56
  };
57
+ exports.SearchResultEntityResolver = SearchResultEntityResolver;
57
58
  __decorate([
58
59
  (0, graphql_1.ResolveField)(),
59
60
  __param(0, (0, core_1.Ctx)()),
@@ -62,12 +63,11 @@ __decorate([
62
63
  __metadata("design:paramtypes", [core_1.RequestContext, Object]),
63
64
  __metadata("design:returntype", Promise)
64
65
  ], SearchResultEntityResolver.prototype, "badges", null);
65
- SearchResultEntityResolver = __decorate([
66
+ exports.SearchResultEntityResolver = SearchResultEntityResolver = __decorate([
66
67
  (0, graphql_1.Resolver)('SearchResult'),
67
68
  __param(0, (0, common_1.Inject)(constants_1.PLUGIN_INIT_OPTIONS)),
68
69
  __metadata("design:paramtypes", [Object, badge_service_1.BadgeService])
69
70
  ], SearchResultEntityResolver);
70
- exports.SearchResultEntityResolver = SearchResultEntityResolver;
71
71
  let ProductVariantEntityResolver = class ProductVariantEntityResolver {
72
72
  config;
73
73
  badgeService;
@@ -80,6 +80,7 @@ let ProductVariantEntityResolver = class ProductVariantEntityResolver {
80
80
  return this.badgeService.findByCollectionIds(ctx, collectionIds);
81
81
  }
82
82
  };
83
+ exports.ProductVariantEntityResolver = ProductVariantEntityResolver;
83
84
  __decorate([
84
85
  (0, graphql_1.ResolveField)(),
85
86
  __param(0, (0, core_1.Ctx)()),
@@ -88,12 +89,11 @@ __decorate([
88
89
  __metadata("design:paramtypes", [core_1.RequestContext, core_1.ProductVariant]),
89
90
  __metadata("design:returntype", Promise)
90
91
  ], ProductVariantEntityResolver.prototype, "badges", null);
91
- ProductVariantEntityResolver = __decorate([
92
+ exports.ProductVariantEntityResolver = ProductVariantEntityResolver = __decorate([
92
93
  (0, graphql_1.Resolver)('ProductVariant'),
93
94
  __param(0, (0, common_1.Inject)(constants_1.PLUGIN_INIT_OPTIONS)),
94
95
  __metadata("design:paramtypes", [Object, badge_service_1.BadgeService])
95
96
  ], ProductVariantEntityResolver);
96
- exports.ProductVariantEntityResolver = ProductVariantEntityResolver;
97
97
  let BadgeShopResolver = class BadgeShopResolver {
98
98
  config;
99
99
  badgeService;
@@ -111,6 +111,7 @@ let BadgeShopResolver = class BadgeShopResolver {
111
111
  return this.badgeService.findByCollectionIds(ctx, args.collectionIds);
112
112
  }
113
113
  };
114
+ exports.BadgeShopResolver = BadgeShopResolver;
114
115
  __decorate([
115
116
  (0, graphql_1.Query)(),
116
117
  __param(0, (0, core_1.Ctx)()),
@@ -135,9 +136,8 @@ __decorate([
135
136
  __metadata("design:paramtypes", [core_1.RequestContext, Object]),
136
137
  __metadata("design:returntype", Promise)
137
138
  ], BadgeShopResolver.prototype, "getBadgesFromCollections", null);
138
- BadgeShopResolver = __decorate([
139
+ exports.BadgeShopResolver = BadgeShopResolver = __decorate([
139
140
  (0, graphql_1.Resolver)(),
140
141
  __param(0, (0, common_1.Inject)(constants_1.PLUGIN_INIT_OPTIONS)),
141
142
  __metadata("design:paramtypes", [Object, badge_service_1.BadgeService])
142
143
  ], BadgeShopResolver);
143
- exports.BadgeShopResolver = BadgeShopResolver;
@@ -19,7 +19,8 @@ const badge_entity_1 = require("./entity/badge.entity");
19
19
  const path_1 = __importDefault(require("path"));
20
20
  const badge_service_1 = require("./service/badge.service");
21
21
  const shop_resolver_1 = require("./api/shop.resolver");
22
- let BadgePlugin = BadgePlugin_1 = class BadgePlugin {
22
+ let BadgePlugin = class BadgePlugin {
23
+ static { BadgePlugin_1 = this; }
23
24
  static options = {
24
25
  availablePositions: ['top-left', 'top-right', 'bottom-left', 'bottom-right'],
25
26
  };
@@ -50,13 +51,14 @@ let BadgePlugin = BadgePlugin_1 = class BadgePlugin {
50
51
  ],
51
52
  };
52
53
  };
53
- BadgePlugin = BadgePlugin_1 = __decorate([
54
+ exports.BadgePlugin = BadgePlugin;
55
+ exports.BadgePlugin = BadgePlugin = BadgePlugin_1 = __decorate([
54
56
  (0, core_1.VendurePlugin)({
55
57
  imports: [core_1.PluginCommonModule],
56
58
  providers: [
57
59
  {
58
60
  provide: constants_1.PLUGIN_INIT_OPTIONS,
59
- useFactory: () => BadgePlugin_1.options,
61
+ useFactory: () => BadgePlugin.options,
60
62
  },
61
63
  badge_service_1.BadgeService,
62
64
  ],
@@ -77,4 +79,3 @@ BadgePlugin = BadgePlugin_1 = __decorate([
77
79
  compatibility: '^3.0.0',
78
80
  })
79
81
  ], BadgePlugin);
80
- exports.BadgePlugin = BadgePlugin;
@@ -29,6 +29,7 @@ let Badge = class Badge extends core_1.VendureEntity {
29
29
  collection;
30
30
  collectionId;
31
31
  };
32
+ exports.Badge = Badge;
32
33
  __decorate([
33
34
  (0, typeorm_1.ManyToMany)((type) => core_1.Channel),
34
35
  (0, typeorm_1.JoinTable)(),
@@ -73,8 +74,7 @@ __decorate([
73
74
  (0, core_1.EntityId)({ nullable: true }),
74
75
  __metadata("design:type", Object)
75
76
  ], Badge.prototype, "collectionId", void 0);
76
- Badge = __decorate([
77
+ exports.Badge = Badge = __decorate([
77
78
  (0, typeorm_1.Entity)(),
78
79
  __metadata("design:paramtypes", [Object])
79
80
  ], Badge);
80
- exports.Badge = Badge;
@@ -6,13 +6,13 @@ var AdjustmentType;
6
6
  AdjustmentType["DISTRIBUTED_ORDER_PROMOTION"] = "DISTRIBUTED_ORDER_PROMOTION";
7
7
  AdjustmentType["OTHER"] = "OTHER";
8
8
  AdjustmentType["PROMOTION"] = "PROMOTION";
9
- })(AdjustmentType = exports.AdjustmentType || (exports.AdjustmentType = {}));
9
+ })(AdjustmentType || (exports.AdjustmentType = AdjustmentType = {}));
10
10
  var AssetType;
11
11
  (function (AssetType) {
12
12
  AssetType["BINARY"] = "BINARY";
13
13
  AssetType["IMAGE"] = "IMAGE";
14
14
  AssetType["VIDEO"] = "VIDEO";
15
- })(AssetType = exports.AssetType || (exports.AssetType = {}));
15
+ })(AssetType || (exports.AssetType = AssetType = {}));
16
16
  /**
17
17
  * @description
18
18
  * ISO 4217 currency code
@@ -335,14 +335,14 @@ var CurrencyCode;
335
335
  CurrencyCode["ZMW"] = "ZMW";
336
336
  /** Zimbabwean dollar */
337
337
  CurrencyCode["ZWL"] = "ZWL";
338
- })(CurrencyCode = exports.CurrencyCode || (exports.CurrencyCode = {}));
338
+ })(CurrencyCode || (exports.CurrencyCode = CurrencyCode = {}));
339
339
  var DeletionResult;
340
340
  (function (DeletionResult) {
341
341
  /** The entity was successfully deleted */
342
342
  DeletionResult["DELETED"] = "DELETED";
343
343
  /** Deletion did not take place, reason given in message */
344
344
  DeletionResult["NOT_DELETED"] = "NOT_DELETED";
345
- })(DeletionResult = exports.DeletionResult || (exports.DeletionResult = {}));
345
+ })(DeletionResult || (exports.DeletionResult = DeletionResult = {}));
346
346
  var ErrorCode;
347
347
  (function (ErrorCode) {
348
348
  ErrorCode["ALREADY_REFUNDED_ERROR"] = "ALREADY_REFUNDED_ERROR";
@@ -388,13 +388,13 @@ var ErrorCode;
388
388
  ErrorCode["REFUND_STATE_TRANSITION_ERROR"] = "REFUND_STATE_TRANSITION_ERROR";
389
389
  ErrorCode["SETTLE_PAYMENT_ERROR"] = "SETTLE_PAYMENT_ERROR";
390
390
  ErrorCode["UNKNOWN_ERROR"] = "UNKNOWN_ERROR";
391
- })(ErrorCode = exports.ErrorCode || (exports.ErrorCode = {}));
391
+ })(ErrorCode || (exports.ErrorCode = ErrorCode = {}));
392
392
  var GlobalFlag;
393
393
  (function (GlobalFlag) {
394
394
  GlobalFlag["FALSE"] = "FALSE";
395
395
  GlobalFlag["INHERIT"] = "INHERIT";
396
396
  GlobalFlag["TRUE"] = "TRUE";
397
- })(GlobalFlag = exports.GlobalFlag || (exports.GlobalFlag = {}));
397
+ })(GlobalFlag || (exports.GlobalFlag = GlobalFlag = {}));
398
398
  var HistoryEntryType;
399
399
  (function (HistoryEntryType) {
400
400
  HistoryEntryType["CUSTOMER_ADDED_TO_GROUP"] = "CUSTOMER_ADDED_TO_GROUP";
@@ -421,7 +421,7 @@ var HistoryEntryType;
421
421
  HistoryEntryType["ORDER_PAYMENT_TRANSITION"] = "ORDER_PAYMENT_TRANSITION";
422
422
  HistoryEntryType["ORDER_REFUND_TRANSITION"] = "ORDER_REFUND_TRANSITION";
423
423
  HistoryEntryType["ORDER_STATE_TRANSITION"] = "ORDER_STATE_TRANSITION";
424
- })(HistoryEntryType = exports.HistoryEntryType || (exports.HistoryEntryType = {}));
424
+ })(HistoryEntryType || (exports.HistoryEntryType = HistoryEntryType = {}));
425
425
  /**
426
426
  * @description
427
427
  * The state of a Job in the JobQueue
@@ -436,7 +436,7 @@ var JobState;
436
436
  JobState["PENDING"] = "PENDING";
437
437
  JobState["RETRYING"] = "RETRYING";
438
438
  JobState["RUNNING"] = "RUNNING";
439
- })(JobState = exports.JobState || (exports.JobState = {}));
439
+ })(JobState || (exports.JobState = JobState = {}));
440
440
  /**
441
441
  * @description
442
442
  * Languages in the form of a ISO 639-1 language code with optional
@@ -762,28 +762,28 @@ var LanguageCode;
762
762
  LanguageCode["zh_Hant"] = "zh_Hant";
763
763
  /** Zulu */
764
764
  LanguageCode["zu"] = "zu";
765
- })(LanguageCode = exports.LanguageCode || (exports.LanguageCode = {}));
765
+ })(LanguageCode || (exports.LanguageCode = LanguageCode = {}));
766
766
  var LogicalOperator;
767
767
  (function (LogicalOperator) {
768
768
  LogicalOperator["AND"] = "AND";
769
769
  LogicalOperator["OR"] = "OR";
770
- })(LogicalOperator = exports.LogicalOperator || (exports.LogicalOperator = {}));
770
+ })(LogicalOperator || (exports.LogicalOperator = LogicalOperator = {}));
771
771
  var MetricInterval;
772
772
  (function (MetricInterval) {
773
773
  MetricInterval["Daily"] = "Daily";
774
- })(MetricInterval = exports.MetricInterval || (exports.MetricInterval = {}));
774
+ })(MetricInterval || (exports.MetricInterval = MetricInterval = {}));
775
775
  var MetricType;
776
776
  (function (MetricType) {
777
777
  MetricType["AverageOrderValue"] = "AverageOrderValue";
778
778
  MetricType["OrderCount"] = "OrderCount";
779
779
  MetricType["OrderTotal"] = "OrderTotal";
780
- })(MetricType = exports.MetricType || (exports.MetricType = {}));
780
+ })(MetricType || (exports.MetricType = MetricType = {}));
781
781
  var OrderType;
782
782
  (function (OrderType) {
783
783
  OrderType["Aggregate"] = "Aggregate";
784
784
  OrderType["Regular"] = "Regular";
785
785
  OrderType["Seller"] = "Seller";
786
- })(OrderType = exports.OrderType || (exports.OrderType = {}));
786
+ })(OrderType || (exports.OrderType = OrderType = {}));
787
787
  /**
788
788
  * @description
789
789
  * Permissions for administrators and customers. Used to control access to
@@ -1006,12 +1006,12 @@ var Permission;
1006
1006
  Permission["UpdateTaxRate"] = "UpdateTaxRate";
1007
1007
  /** Grants permission to update Zone */
1008
1008
  Permission["UpdateZone"] = "UpdateZone";
1009
- })(Permission = exports.Permission || (exports.Permission = {}));
1009
+ })(Permission || (exports.Permission = Permission = {}));
1010
1010
  var SortOrder;
1011
1011
  (function (SortOrder) {
1012
1012
  SortOrder["ASC"] = "ASC";
1013
1013
  SortOrder["DESC"] = "DESC";
1014
- })(SortOrder = exports.SortOrder || (exports.SortOrder = {}));
1014
+ })(SortOrder || (exports.SortOrder = SortOrder = {}));
1015
1015
  var StockMovementType;
1016
1016
  (function (StockMovementType) {
1017
1017
  StockMovementType["ADJUSTMENT"] = "ADJUSTMENT";
@@ -1020,4 +1020,4 @@ var StockMovementType;
1020
1020
  StockMovementType["RELEASE"] = "RELEASE";
1021
1021
  StockMovementType["RETURN"] = "RETURN";
1022
1022
  StockMovementType["SALE"] = "SALE";
1023
- })(StockMovementType = exports.StockMovementType || (exports.StockMovementType = {}));
1023
+ })(StockMovementType || (exports.StockMovementType = StockMovementType = {}));
@@ -131,7 +131,8 @@ let BadgeService = class BadgeService {
131
131
  return this.connection.findByIdsInChannel(ctx, badge_entity_1.Badge, badges.map((b) => b.id), ctx.channelId, {});
132
132
  }
133
133
  };
134
- BadgeService = __decorate([
134
+ exports.BadgeService = BadgeService;
135
+ exports.BadgeService = BadgeService = __decorate([
135
136
  (0, common_1.Injectable)(),
136
137
  __metadata("design:paramtypes", [core_1.ListQueryBuilder,
137
138
  core_1.TransactionalConnection,
@@ -140,4 +141,3 @@ BadgeService = __decorate([
140
141
  core_1.CollectionService,
141
142
  core_1.ChannelService])
142
143
  ], BadgeService);
143
- exports.BadgeService = BadgeService;
@@ -1,10 +1,9 @@
1
- /// <reference types="node" />
2
1
  import { TypedBaseListComponent, NotificationService, ModalService, SelectionManager } from '@vendure/admin-ui/core';
3
2
  import { OnInit, OnChanges, SimpleChanges } from '@angular/core';
4
3
  import { Badge } from './gql/graphql';
5
4
  import { Asset } from '@vendure/core';
6
5
  declare const getBadgeListDocument: import("apollo-angular").TypedDocumentNode<import("./gql/graphql").GetBadgesQuery, import("./gql/graphql").Exact<{
7
- options?: import("./gql/graphql").InputMaybe<import("./gql/graphql").BadgeListOptions> | undefined;
6
+ options?: import("./gql/graphql").InputMaybe<import("./gql/graphql").BadgeListOptions>;
8
7
  }>>;
9
8
  export interface BadgePluginOptions {
10
9
  availablePositions: string[];
@@ -17,6 +17,9 @@ const graphql_1 = require("./gql/graphql");
17
17
  const ngx_translate_extract_marker_1 = require("@biesbjerg/ngx-translate-extract-marker");
18
18
  const rxjs_1 = require("rxjs");
19
19
  const operators_1 = require("rxjs/operators");
20
+ const common_1 = require("@angular/common");
21
+ const update_badge_component_1 = require("./update-badge.component");
22
+ const core_3 = require("@ngx-translate/core");
20
23
  const getBadgeListDocument = (0, gql_1.graphql)(`
21
24
  query GetBadges($options: BadgeListOptions) {
22
25
  badges(options: $options) {
@@ -89,12 +92,7 @@ let BadgeListComponent = class BadgeListComponent extends core_1.TypedBaseListCo
89
92
  this.badges = data.badges.items;
90
93
  return data.badges;
91
94
  },
92
- setVariables: () => ({
93
- options: {
94
- skip: 0,
95
- take: 999,
96
- },
97
- }),
95
+ setVariables: () => ({ options: { skip: 0, take: 999 } }),
98
96
  refreshListOnChanges: [],
99
97
  });
100
98
  this.dataService
@@ -171,10 +169,7 @@ let BadgeListComponent = class BadgeListComponent extends core_1.TypedBaseListCo
171
169
  for (const asset of assets) {
172
170
  await this.dataService
173
171
  .mutate(createBadgeDocument, {
174
- input: {
175
- assetId: asset.id,
176
- position: this.config.availablePositions[0],
177
- },
172
+ input: { assetId: asset.id, position: this.config.availablePositions[0] },
178
173
  })
179
174
  .toPromise();
180
175
  }
@@ -191,15 +186,11 @@ let BadgeListComponent = class BadgeListComponent extends core_1.TypedBaseListCo
191
186
  }
192
187
  }))
193
188
  .subscribe(() => {
194
- this.notificationService.success((0, ngx_translate_extract_marker_1.marker)('common.notify-delete-success'), {
195
- entity: 'Badges',
196
- });
189
+ this.notificationService.success((0, ngx_translate_extract_marker_1.marker)('common.notify-delete-success'), { entity: 'Badges' });
197
190
  this.refresh();
198
191
  this.selectionManager.clearSelection();
199
192
  }, () => {
200
- this.notificationService.error((0, ngx_translate_extract_marker_1.marker)('common.notify-delete-error'), {
201
- entity: 'Badges',
202
- });
193
+ this.notificationService.error((0, ngx_translate_extract_marker_1.marker)('common.notify-delete-error'), { entity: 'Badges' });
203
194
  });
204
195
  }
205
196
  onBadgeUpdated() {
@@ -209,31 +200,38 @@ let BadgeListComponent = class BadgeListComponent extends core_1.TypedBaseListCo
209
200
  return this.modalService
210
201
  .dialog({
211
202
  title: (0, ngx_translate_extract_marker_1.marker)('badge-plugin.confirm-delete-badges'),
212
- translationVars: {
213
- count: badgeIds.length,
214
- },
203
+ translationVars: { count: badgeIds.length },
215
204
  body: message,
216
205
  buttons: [
217
206
  { type: 'secondary', label: (0, ngx_translate_extract_marker_1.marker)('common.cancel') },
218
207
  { type: 'danger', label: (0, ngx_translate_extract_marker_1.marker)('common.delete'), returnValue: true },
219
208
  ],
220
209
  })
221
- .pipe((0, operators_1.switchMap)((res) => res
222
- ? this.dataService.mutate(deleteBadgeDocument, {
223
- ids: badgeIds,
224
- })
225
- : rxjs_1.EMPTY), (0, operators_1.map)((res) => res.deleteBadge));
210
+ .pipe((0, operators_1.switchMap)((res) => res ? this.dataService.mutate(deleteBadgeDocument, { ids: badgeIds }) : rxjs_1.EMPTY), (0, operators_1.map)((res) => res.deleteBadge));
226
211
  }
227
212
  };
228
- BadgeListComponent = __decorate([
213
+ exports.BadgeListComponent = BadgeListComponent;
214
+ exports.BadgeListComponent = BadgeListComponent = __decorate([
229
215
  (0, core_2.Component)({
230
216
  selector: 'badge-list',
231
217
  templateUrl: './badge-list.component.html',
232
218
  styleUrls: ['./badge-list.component.scss'],
233
219
  changeDetection: core_2.ChangeDetectionStrategy.OnPush,
220
+ standalone: true,
221
+ imports: [
222
+ common_1.CommonModule,
223
+ update_badge_component_1.UpdateBadgeComponent,
224
+ core_1.PageBlockComponent,
225
+ core_1.ActionBarComponent,
226
+ core_1.ActionBarLeftComponent,
227
+ core_1.ActionBarRightComponent,
228
+ core_1.AssetFileInputComponent,
229
+ core_1.SelectToggleComponent,
230
+ core_1.ChipComponent,
231
+ core_3.TranslateModule,
232
+ ],
234
233
  }),
235
234
  (0, core_2.Injectable)(),
236
235
  __metadata("design:paramtypes", [core_1.NotificationService,
237
236
  core_1.ModalService])
238
237
  ], BadgeListComponent);
239
- exports.BadgeListComponent = BadgeListComponent;
@@ -3,6 +3,13 @@ import {
3
3
  NotificationService,
4
4
  ModalService,
5
5
  SelectionManager,
6
+ PageBlockComponent,
7
+ ActionBarComponent,
8
+ ActionBarLeftComponent,
9
+ ActionBarRightComponent,
10
+ AssetFileInputComponent,
11
+ SelectToggleComponent,
12
+ ChipComponent,
6
13
  } from '@vendure/admin-ui/core'
7
14
  import {
8
15
  Component,
@@ -18,6 +25,9 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'
18
25
  import { EMPTY } from 'rxjs'
19
26
  import { finalize, map, switchMap } from 'rxjs/operators'
20
27
  import { Asset } from '@vendure/core'
28
+ import { CommonModule } from '@angular/common'
29
+ import { UpdateBadgeComponent } from './update-badge.component'
30
+ import { TranslateModule } from '@ngx-translate/core'
21
31
 
22
32
  const getBadgeListDocument = graphql(`
23
33
  query GetBadges($options: BadgeListOptions) {
@@ -82,6 +92,19 @@ export interface BadgePluginOptions {
82
92
  templateUrl: './badge-list.component.html',
83
93
  styleUrls: ['./badge-list.component.scss'],
84
94
  changeDetection: ChangeDetectionStrategy.OnPush,
95
+ standalone: true,
96
+ imports: [
97
+ CommonModule,
98
+ UpdateBadgeComponent,
99
+ PageBlockComponent,
100
+ ActionBarComponent,
101
+ ActionBarLeftComponent,
102
+ ActionBarRightComponent,
103
+ AssetFileInputComponent,
104
+ SelectToggleComponent,
105
+ ChipComponent,
106
+ TranslateModule,
107
+ ],
85
108
  })
86
109
  @Injectable()
87
110
  export class BadgeListComponent
@@ -110,12 +133,7 @@ export class BadgeListComponent
110
133
  this.badges = data.badges.items as Badge[]
111
134
  return data.badges
112
135
  },
113
- setVariables: () => ({
114
- options: {
115
- skip: 0,
116
- take: 999,
117
- },
118
- }),
136
+ setVariables: () => ({ options: { skip: 0, take: 999 } }),
119
137
  refreshListOnChanges: [],
120
138
  })
121
139
 
@@ -203,10 +221,7 @@ export class BadgeListComponent
203
221
  for (const asset of assets) {
204
222
  await this.dataService
205
223
  .mutate(createBadgeDocument, {
206
- input: {
207
- assetId: asset.id as string,
208
- position: this.config.availablePositions[0],
209
- },
224
+ input: { assetId: asset.id as string, position: this.config.availablePositions[0] },
210
225
  })
211
226
  .toPromise()
212
227
  }
@@ -229,16 +244,12 @@ export class BadgeListComponent
229
244
  )
230
245
  .subscribe(
231
246
  () => {
232
- this.notificationService.success(_('common.notify-delete-success'), {
233
- entity: 'Badges',
234
- })
247
+ this.notificationService.success(_('common.notify-delete-success'), { entity: 'Badges' })
235
248
  this.refresh()
236
249
  this.selectionManager.clearSelection()
237
250
  },
238
251
  () => {
239
- this.notificationService.error(_('common.notify-delete-error'), {
240
- entity: 'Badges',
241
- })
252
+ this.notificationService.error(_('common.notify-delete-error'), { entity: 'Badges' })
242
253
  },
243
254
  )
244
255
  }
@@ -251,9 +262,7 @@ export class BadgeListComponent
251
262
  return this.modalService
252
263
  .dialog({
253
264
  title: _('badge-plugin.confirm-delete-badges'),
254
- translationVars: {
255
- count: badgeIds.length,
256
- },
265
+ translationVars: { count: badgeIds.length },
257
266
  body: message,
258
267
  buttons: [
259
268
  { type: 'secondary', label: _('common.cancel') },
@@ -262,11 +271,7 @@ export class BadgeListComponent
262
271
  })
263
272
  .pipe(
264
273
  switchMap((res) =>
265
- res
266
- ? this.dataService.mutate(deleteBadgeDocument, {
267
- ids: badgeIds,
268
- })
269
- : EMPTY,
274
+ res ? this.dataService.mutate(deleteBadgeDocument, { ids: badgeIds }) : EMPTY,
270
275
  ),
271
276
  map((res) => res.deleteBadge),
272
277
  )
@@ -11,7 +11,8 @@ const core_1 = require("@angular/core");
11
11
  const core_2 = require("@vendure/admin-ui/core");
12
12
  let BadgesNavModule = class BadgesNavModule {
13
13
  };
14
- BadgesNavModule = __decorate([
14
+ exports.BadgesNavModule = BadgesNavModule;
15
+ exports.BadgesNavModule = BadgesNavModule = __decorate([
15
16
  (0, core_1.NgModule)({
16
17
  imports: [core_2.SharedModule],
17
18
  providers: [
@@ -24,4 +25,3 @@ BadgesNavModule = __decorate([
24
25
  ],
25
26
  })
26
27
  ], BadgesNavModule);
27
- exports.BadgesNavModule = BadgesNavModule;
@@ -14,10 +14,13 @@ const badge_list_component_1 = require("./badge-list.component");
14
14
  const update_badge_component_1 = require("./update-badge.component");
15
15
  let BadgeModule = class BadgeModule {
16
16
  };
17
- BadgeModule = __decorate([
17
+ exports.BadgeModule = BadgeModule;
18
+ exports.BadgeModule = BadgeModule = __decorate([
18
19
  (0, core_1.NgModule)({
19
20
  imports: [
20
21
  core_2.SharedModule,
22
+ badge_list_component_1.BadgeListComponent,
23
+ update_badge_component_1.UpdateBadgeComponent,
21
24
  router_1.RouterModule.forChild([
22
25
  {
23
26
  path: '',
@@ -28,7 +31,5 @@ BadgeModule = __decorate([
28
31
  ]),
29
32
  ],
30
33
  providers: [],
31
- declarations: [badge_list_component_1.BadgeListComponent, update_badge_component_1.UpdateBadgeComponent],
32
34
  })
33
35
  ], BadgeModule);
34
- exports.BadgeModule = BadgeModule;
@@ -7,6 +7,8 @@ import { UpdateBadgeComponent } from './update-badge.component'
7
7
  @NgModule({
8
8
  imports: [
9
9
  SharedModule,
10
+ BadgeListComponent,
11
+ UpdateBadgeComponent,
10
12
  RouterModule.forChild([
11
13
  {
12
14
  path: '',
@@ -17,6 +19,5 @@ import { UpdateBadgeComponent } from './update-badge.component'
17
19
  ]),
18
20
  ],
19
21
  providers: [],
20
- declarations: [BadgeListComponent, UpdateBadgeComponent],
21
22
  })
22
23
  export class BadgeModule {}
@@ -12,13 +12,13 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/
12
12
  */
13
13
  declare const documents: {
14
14
  "\n query GetBadges($options: BadgeListOptions) {\n badges(options: $options) {\n items {\n id\n createdAt\n updatedAt\n collection {\n id\n }\n collectionId\n position\n asset {\n id\n name\n type\n mimeType\n width\n height\n fileSize\n source\n preview\n }\n }\n totalItems\n }\n }\n": DocumentNode<types.GetBadgesQuery, types.Exact<{
15
- options?: types.InputMaybe<types.BadgeListOptions> | undefined;
15
+ options?: types.InputMaybe<types.BadgeListOptions>;
16
16
  }>>;
17
17
  "\n mutation CreateBadge($input: CreateBadgeInput!) {\n createBadge(input: $input) {\n id\n }\n }\n": DocumentNode<types.CreateBadgeMutation, types.Exact<{
18
18
  input: types.CreateBadgeInput;
19
19
  }>>;
20
20
  "\n mutation DeleteBadge($ids: [ID!]!) {\n deleteBadge(ids: $ids) {\n result\n message\n }\n }\n": DocumentNode<types.DeleteBadgeMutation, types.Exact<{
21
- ids: string | string[];
21
+ ids: Array<types.Scalars["ID"]["input"]> | types.Scalars["ID"]["input"];
22
22
  }>>;
23
23
  "\n query GetBadgePluginConfig {\n getBadgePluginConfig {\n availablePositions\n }\n }\n": DocumentNode<types.GetBadgePluginConfigQuery, types.Exact<{
24
24
  [key: string]: never;
@@ -15,15 +15,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.graphql = void 0;
36
+ exports.graphql = graphql;
27
37
  /* eslint-disable */
28
38
  const types = __importStar(require("./graphql"));
29
39
  /**
@@ -46,4 +56,3 @@ const documents = {
46
56
  function graphql(source) {
47
57
  return documents[source] ?? {};
48
58
  }
49
- exports.graphql = graphql;
@@ -5987,18 +5987,8 @@ export type UpdateBadgeMutation = {
5987
5987
  id: string;
5988
5988
  };
5989
5989
  };
5990
- export declare const GetBadgesDocument: DocumentNode<GetBadgesQuery, Exact<{
5991
- options?: InputMaybe<BadgeListOptions> | undefined;
5992
- }>>;
5993
- export declare const CreateBadgeDocument: DocumentNode<CreateBadgeMutation, Exact<{
5994
- input: CreateBadgeInput;
5995
- }>>;
5996
- export declare const DeleteBadgeDocument: DocumentNode<DeleteBadgeMutation, Exact<{
5997
- ids: Array<Scalars['ID']['input']> | Scalars['ID']['input'];
5998
- }>>;
5999
- export declare const GetBadgePluginConfigDocument: DocumentNode<GetBadgePluginConfigQuery, Exact<{
6000
- [key: string]: never;
6001
- }>>;
6002
- export declare const UpdateBadgeDocument: DocumentNode<UpdateBadgeMutation, Exact<{
6003
- input: UpdateBadgeInput;
6004
- }>>;
5990
+ export declare const GetBadgesDocument: DocumentNode<GetBadgesQuery, GetBadgesQueryVariables>;
5991
+ export declare const CreateBadgeDocument: DocumentNode<CreateBadgeMutation, CreateBadgeMutationVariables>;
5992
+ export declare const DeleteBadgeDocument: DocumentNode<DeleteBadgeMutation, DeleteBadgeMutationVariables>;
5993
+ export declare const GetBadgePluginConfigDocument: DocumentNode<GetBadgePluginConfigQuery, GetBadgePluginConfigQueryVariables>;
5994
+ export declare const UpdateBadgeDocument: DocumentNode<UpdateBadgeMutation, UpdateBadgeMutationVariables>;
@@ -6,13 +6,13 @@ var AdjustmentType;
6
6
  AdjustmentType["DISTRIBUTED_ORDER_PROMOTION"] = "DISTRIBUTED_ORDER_PROMOTION";
7
7
  AdjustmentType["OTHER"] = "OTHER";
8
8
  AdjustmentType["PROMOTION"] = "PROMOTION";
9
- })(AdjustmentType = exports.AdjustmentType || (exports.AdjustmentType = {}));
9
+ })(AdjustmentType || (exports.AdjustmentType = AdjustmentType = {}));
10
10
  var AssetType;
11
11
  (function (AssetType) {
12
12
  AssetType["BINARY"] = "BINARY";
13
13
  AssetType["IMAGE"] = "IMAGE";
14
14
  AssetType["VIDEO"] = "VIDEO";
15
- })(AssetType = exports.AssetType || (exports.AssetType = {}));
15
+ })(AssetType || (exports.AssetType = AssetType = {}));
16
16
  /**
17
17
  * @description
18
18
  * ISO 4217 currency code
@@ -335,14 +335,14 @@ var CurrencyCode;
335
335
  CurrencyCode["ZMW"] = "ZMW";
336
336
  /** Zimbabwean dollar */
337
337
  CurrencyCode["ZWL"] = "ZWL";
338
- })(CurrencyCode = exports.CurrencyCode || (exports.CurrencyCode = {}));
338
+ })(CurrencyCode || (exports.CurrencyCode = CurrencyCode = {}));
339
339
  var DeletionResult;
340
340
  (function (DeletionResult) {
341
341
  /** The entity was successfully deleted */
342
342
  DeletionResult["DELETED"] = "DELETED";
343
343
  /** Deletion did not take place, reason given in message */
344
344
  DeletionResult["NOT_DELETED"] = "NOT_DELETED";
345
- })(DeletionResult = exports.DeletionResult || (exports.DeletionResult = {}));
345
+ })(DeletionResult || (exports.DeletionResult = DeletionResult = {}));
346
346
  var ErrorCode;
347
347
  (function (ErrorCode) {
348
348
  ErrorCode["ALREADY_REFUNDED_ERROR"] = "ALREADY_REFUNDED_ERROR";
@@ -388,13 +388,13 @@ var ErrorCode;
388
388
  ErrorCode["REFUND_STATE_TRANSITION_ERROR"] = "REFUND_STATE_TRANSITION_ERROR";
389
389
  ErrorCode["SETTLE_PAYMENT_ERROR"] = "SETTLE_PAYMENT_ERROR";
390
390
  ErrorCode["UNKNOWN_ERROR"] = "UNKNOWN_ERROR";
391
- })(ErrorCode = exports.ErrorCode || (exports.ErrorCode = {}));
391
+ })(ErrorCode || (exports.ErrorCode = ErrorCode = {}));
392
392
  var GlobalFlag;
393
393
  (function (GlobalFlag) {
394
394
  GlobalFlag["FALSE"] = "FALSE";
395
395
  GlobalFlag["INHERIT"] = "INHERIT";
396
396
  GlobalFlag["TRUE"] = "TRUE";
397
- })(GlobalFlag = exports.GlobalFlag || (exports.GlobalFlag = {}));
397
+ })(GlobalFlag || (exports.GlobalFlag = GlobalFlag = {}));
398
398
  var HistoryEntryType;
399
399
  (function (HistoryEntryType) {
400
400
  HistoryEntryType["CUSTOMER_ADDED_TO_GROUP"] = "CUSTOMER_ADDED_TO_GROUP";
@@ -421,7 +421,7 @@ var HistoryEntryType;
421
421
  HistoryEntryType["ORDER_PAYMENT_TRANSITION"] = "ORDER_PAYMENT_TRANSITION";
422
422
  HistoryEntryType["ORDER_REFUND_TRANSITION"] = "ORDER_REFUND_TRANSITION";
423
423
  HistoryEntryType["ORDER_STATE_TRANSITION"] = "ORDER_STATE_TRANSITION";
424
- })(HistoryEntryType = exports.HistoryEntryType || (exports.HistoryEntryType = {}));
424
+ })(HistoryEntryType || (exports.HistoryEntryType = HistoryEntryType = {}));
425
425
  /**
426
426
  * @description
427
427
  * The state of a Job in the JobQueue
@@ -436,7 +436,7 @@ var JobState;
436
436
  JobState["PENDING"] = "PENDING";
437
437
  JobState["RETRYING"] = "RETRYING";
438
438
  JobState["RUNNING"] = "RUNNING";
439
- })(JobState = exports.JobState || (exports.JobState = {}));
439
+ })(JobState || (exports.JobState = JobState = {}));
440
440
  /**
441
441
  * @description
442
442
  * Languages in the form of a ISO 639-1 language code with optional
@@ -762,28 +762,28 @@ var LanguageCode;
762
762
  LanguageCode["zh_Hant"] = "zh_Hant";
763
763
  /** Zulu */
764
764
  LanguageCode["zu"] = "zu";
765
- })(LanguageCode = exports.LanguageCode || (exports.LanguageCode = {}));
765
+ })(LanguageCode || (exports.LanguageCode = LanguageCode = {}));
766
766
  var LogicalOperator;
767
767
  (function (LogicalOperator) {
768
768
  LogicalOperator["AND"] = "AND";
769
769
  LogicalOperator["OR"] = "OR";
770
- })(LogicalOperator = exports.LogicalOperator || (exports.LogicalOperator = {}));
770
+ })(LogicalOperator || (exports.LogicalOperator = LogicalOperator = {}));
771
771
  var MetricInterval;
772
772
  (function (MetricInterval) {
773
773
  MetricInterval["Daily"] = "Daily";
774
- })(MetricInterval = exports.MetricInterval || (exports.MetricInterval = {}));
774
+ })(MetricInterval || (exports.MetricInterval = MetricInterval = {}));
775
775
  var MetricType;
776
776
  (function (MetricType) {
777
777
  MetricType["AverageOrderValue"] = "AverageOrderValue";
778
778
  MetricType["OrderCount"] = "OrderCount";
779
779
  MetricType["OrderTotal"] = "OrderTotal";
780
- })(MetricType = exports.MetricType || (exports.MetricType = {}));
780
+ })(MetricType || (exports.MetricType = MetricType = {}));
781
781
  var OrderType;
782
782
  (function (OrderType) {
783
783
  OrderType["Aggregate"] = "Aggregate";
784
784
  OrderType["Regular"] = "Regular";
785
785
  OrderType["Seller"] = "Seller";
786
- })(OrderType = exports.OrderType || (exports.OrderType = {}));
786
+ })(OrderType || (exports.OrderType = OrderType = {}));
787
787
  /**
788
788
  * @description
789
789
  * Permissions for administrators and customers. Used to control access to
@@ -1006,12 +1006,12 @@ var Permission;
1006
1006
  Permission["UpdateTaxRate"] = "UpdateTaxRate";
1007
1007
  /** Grants permission to update Zone */
1008
1008
  Permission["UpdateZone"] = "UpdateZone";
1009
- })(Permission = exports.Permission || (exports.Permission = {}));
1009
+ })(Permission || (exports.Permission = Permission = {}));
1010
1010
  var SortOrder;
1011
1011
  (function (SortOrder) {
1012
1012
  SortOrder["ASC"] = "ASC";
1013
1013
  SortOrder["DESC"] = "DESC";
1014
- })(SortOrder = exports.SortOrder || (exports.SortOrder = {}));
1014
+ })(SortOrder || (exports.SortOrder = SortOrder = {}));
1015
1015
  var StockMovementType;
1016
1016
  (function (StockMovementType) {
1017
1017
  StockMovementType["ADJUSTMENT"] = "ADJUSTMENT";
@@ -1020,7 +1020,7 @@ var StockMovementType;
1020
1020
  StockMovementType["RELEASE"] = "RELEASE";
1021
1021
  StockMovementType["RETURN"] = "RETURN";
1022
1022
  StockMovementType["SALE"] = "SALE";
1023
- })(StockMovementType = exports.StockMovementType || (exports.StockMovementType = {}));
1023
+ })(StockMovementType || (exports.StockMovementType = StockMovementType = {}));
1024
1024
  exports.GetBadgesDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "GetBadges" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "options" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "BadgeListOptions" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "badges" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "options" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "options" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "createdAt" } }, { "kind": "Field", "name": { "kind": "Name", "value": "updatedAt" } }, { "kind": "Field", "name": { "kind": "Name", "value": "collection" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "collectionId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "position" } }, { "kind": "Field", "name": { "kind": "Name", "value": "asset" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "type" } }, { "kind": "Field", "name": { "kind": "Name", "value": "mimeType" } }, { "kind": "Field", "name": { "kind": "Name", "value": "width" } }, { "kind": "Field", "name": { "kind": "Name", "value": "height" } }, { "kind": "Field", "name": { "kind": "Name", "value": "fileSize" } }, { "kind": "Field", "name": { "kind": "Name", "value": "source" } }, { "kind": "Field", "name": { "kind": "Name", "value": "preview" } }] } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "totalItems" } }] } }] } }] };
1025
1025
  exports.CreateBadgeDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "CreateBadge" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "CreateBadgeInput" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "createBadge" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "input" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }] } }] } }] };
1026
1026
  exports.DeleteBadgeDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "DeleteBadge" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "ids" } }, "type": { "kind": "NonNullType", "type": { "kind": "ListType", "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "ID" } } } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "deleteBadge" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "ids" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "ids" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "result" } }, { "kind": "Field", "name": { "kind": "Name", "value": "message" } }] } }] } }] };
@@ -14,6 +14,9 @@ const core_1 = require("@angular/core");
14
14
  const forms_1 = require("@angular/forms");
15
15
  const core_2 = require("@vendure/admin-ui/core");
16
16
  const gql_1 = require("./gql");
17
+ const common_1 = require("@angular/common");
18
+ const ng_select_1 = require("@ng-select/ng-select");
19
+ const core_3 = require("@ngx-translate/core");
17
20
  const updateBadgeDocument = (0, gql_1.graphql)(`
18
21
  mutation UpdateBadge($input: UpdateBadgeInput!) {
19
22
  updateBadge(input: $input) {
@@ -34,10 +37,7 @@ let UpdateBadgeComponent = class UpdateBadgeComponent {
34
37
  this.formBuilder = formBuilder;
35
38
  this.changeDetector = changeDetector;
36
39
  this.dataService = dataService;
37
- this.form = this.formBuilder.group({
38
- collectionId: [''],
39
- position: [''],
40
- });
40
+ this.form = this.formBuilder.group({ collectionId: [''], position: [''] });
41
41
  this.allCollections$ = this.dataService.collection
42
42
  .getCollections()
43
43
  .mapSingle((data) => data.collections.items);
@@ -77,6 +77,7 @@ let UpdateBadgeComponent = class UpdateBadgeComponent {
77
77
  });
78
78
  }
79
79
  };
80
+ exports.UpdateBadgeComponent = UpdateBadgeComponent;
80
81
  __decorate([
81
82
  (0, core_1.Input)(),
82
83
  __metadata("design:type", Object)
@@ -89,15 +90,22 @@ __decorate([
89
90
  (0, core_1.Output)(),
90
91
  __metadata("design:type", core_1.EventEmitter)
91
92
  ], UpdateBadgeComponent.prototype, "badgeUpdated", void 0);
92
- UpdateBadgeComponent = __decorate([
93
+ exports.UpdateBadgeComponent = UpdateBadgeComponent = __decorate([
93
94
  (0, core_1.Component)({
94
95
  selector: 'update-badge',
95
96
  templateUrl: './update-badge.component.html',
96
97
  styleUrls: ['./update-badge.component.scss'],
97
98
  changeDetection: core_1.ChangeDetectionStrategy.OnPush,
99
+ standalone: true,
100
+ imports: [
101
+ common_1.CommonModule,
102
+ forms_1.ReactiveFormsModule,
103
+ ng_select_1.NgSelectModule,
104
+ core_2.LabeledDataComponent,
105
+ core_3.TranslateModule,
106
+ ],
98
107
  }),
99
108
  __metadata("design:paramtypes", [forms_1.FormBuilder,
100
109
  core_1.ChangeDetectorRef,
101
110
  core_2.DataService])
102
111
  ], UpdateBadgeComponent);
103
- exports.UpdateBadgeComponent = UpdateBadgeComponent;
@@ -8,11 +8,14 @@ import {
8
8
  SimpleChanges,
9
9
  EventEmitter,
10
10
  } from '@angular/core'
11
- import { FormBuilder, FormGroup } from '@angular/forms'
11
+ import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms'
12
12
  import { Observable } from 'rxjs'
13
- import { DataService } from '@vendure/admin-ui/core'
13
+ import { DataService, LabeledDataComponent } from '@vendure/admin-ui/core'
14
14
  import { Badge, Collection } from './gql/graphql'
15
15
  import { graphql } from './gql'
16
+ import { CommonModule } from '@angular/common'
17
+ import { NgSelectModule } from '@ng-select/ng-select'
18
+ import { TranslateModule } from '@ngx-translate/core'
16
19
 
17
20
  const updateBadgeDocument = graphql(`
18
21
  mutation UpdateBadge($input: UpdateBadgeInput!) {
@@ -27,6 +30,14 @@ const updateBadgeDocument = graphql(`
27
30
  templateUrl: './update-badge.component.html',
28
31
  styleUrls: ['./update-badge.component.scss'],
29
32
  changeDetection: ChangeDetectionStrategy.OnPush,
33
+ standalone: true,
34
+ imports: [
35
+ CommonModule,
36
+ ReactiveFormsModule,
37
+ NgSelectModule,
38
+ LabeledDataComponent,
39
+ TranslateModule,
40
+ ],
30
41
  })
31
42
  export class UpdateBadgeComponent implements OnChanges {
32
43
  @Input() badge: Badge
@@ -42,10 +53,7 @@ export class UpdateBadgeComponent implements OnChanges {
42
53
  private changeDetector: ChangeDetectorRef,
43
54
  private dataService: DataService,
44
55
  ) {
45
- this.form = this.formBuilder.group({
46
- collectionId: [''],
47
- position: [''],
48
- })
56
+ this.form = this.formBuilder.group({ collectionId: [''], position: [''] })
49
57
  this.allCollections$ = this.dataService.collection
50
58
  .getCollections()
51
59
  .mapSingle((data) => data.collections.items as Collection[])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haus-tech/badge-plugin",
3
- "version": "4.0.1",
3
+ "version": "4.0.3-rc.1",
4
4
  "description": "Adds a badge to product images",
5
5
  "author": "Haus Tech",
6
6
  "repository": "https://github.com/WeAreHausTech/haus-tech-vendure-plugins",
@@ -21,7 +21,7 @@
21
21
  "prepublishOnly": "yarn && yarn build"
22
22
  },
23
23
  "devDependencies": {
24
- "@types/lodash": "^4.14.202",
24
+ "@types/lodash": "^4.17.17",
25
25
  "lodash": "^4.17.21"
26
26
  }
27
27
  }