Total Complexity | 9 |
Complexity/F | 1.8 |
Lines of Code | 64 |
Function Count | 5 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import template from './sw-extension-removal-modal.html.twig'; |
||
2 | import './sw-extension-removal-modal.scss'; |
||
3 | |||
4 | const { Component } = Shopware; |
||
|
|||
5 | |||
6 | /** |
||
7 | * @private |
||
8 | */ |
||
9 | Component.register('sw-extension-removal-modal', { |
||
10 | template, |
||
11 | |||
12 | props: { |
||
13 | extensionName: { |
||
14 | type: String, |
||
15 | required: true |
||
16 | }, |
||
17 | isLicensed: { |
||
18 | type: Boolean, |
||
19 | required: true |
||
20 | }, |
||
21 | isLoading: { |
||
22 | type: Boolean, |
||
23 | required: true |
||
24 | } |
||
25 | }, |
||
26 | |||
27 | computed: { |
||
28 | title() { |
||
29 | return this.isLicensed ? |
||
30 | this.$t( |
||
31 | 'sw-extension-store.component.sw-extension-removal-modal.titleCancel', |
||
32 | { extensionName: this.extensionName } |
||
33 | ) : |
||
34 | this.$t( |
||
35 | 'sw-extension-store.component.sw-extension-removal-modal.titleRemove', |
||
36 | { extensionName: this.extensionName } |
||
37 | ); |
||
38 | }, |
||
39 | |||
40 | alert() { |
||
41 | return this.isLicensed ? this.$tc('sw-extension-store.component.sw-extension-removal-modal.alertCancel') : |
||
42 | this.$tc('sw-extension-store.component.sw-extension-removal-modal.alertRemove'); |
||
43 | }, |
||
44 | |||
45 | btnLabel() { |
||
46 | return this.isLicensed ? this.$tc('sw-extension-store.component.sw-extension-removal-modal.labelCancel') : |
||
47 | this.$tc('sw-extension-store.component.sw-extension-removal-modal.labelRemove'); |
||
48 | } |
||
49 | }, |
||
50 | |||
51 | methods: { |
||
52 | emitClose() { |
||
53 | if (this.isLoading) { |
||
54 | return; |
||
55 | } |
||
56 | |||
57 | this.$emit('modal-close'); |
||
58 | }, |
||
59 | |||
60 | emitRemoval() { |
||
61 | this.$emit('remove-extension'); |
||
62 | } |
||
63 | } |
||
64 | }); |
||
65 |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.