@@ -6,6 +6,7 @@ import BaseButton from "@/components/BaseButton.vue";
6
6
import type { PropType } from " vue" ;
7
7
import type { Endpoint } from " @/types/redirect" ;
8
8
import { parseRuleGroup } from " @/useRules" ;
9
+ import ConfirmsSubscriptionStart from " @/components/modals/ConfirmsSubscriptionStart.vue" ;
9
10
10
11
defineProps ({
11
12
redirectId: {
@@ -17,7 +18,7 @@ defineProps({
17
18
required: false ,
18
19
default : () => [],
19
20
},
20
- hasBillableRedirects : {
21
+ subscribed : {
21
22
type: Boolean ,
22
23
required: false ,
23
24
default: false ,
@@ -43,22 +44,27 @@ defineProps({
43
44
<h3 >{{ $t("No destinations yet") }}</h3 >
44
45
<p >
45
46
{{
46
- hasBillableRedirects
47
+ subscribed
47
48
? $t("Add free destinations")
48
49
: $t("Add more destinations to same code")
49
50
}}
50
51
</p >
51
52
</hgroup >
52
53
</card-element >
53
54
</template >
54
- <template v-else v-for =" endpoint in endpoints " :key =" endpoint .id " >
55
+ <template v-else v-for =" ( endpoint , index ) in endpoints " :key =" endpoint .id " >
55
56
<edit-endpoint
56
57
v-if =" endpoint.id && endpoint.redirect_uuid"
57
58
:redirectId =" endpoint.redirect_uuid"
58
59
:endpointId =" endpoint.id"
59
60
:currentUrl =" endpoint.endpoint"
60
61
>
61
- <card-element :loading =" isLoading" >
62
+ <card-element
63
+ :loading =" isLoading"
64
+ :class =" {
65
+ disabled: !subscribed && index > 0,
66
+ }"
67
+ >
62
68
<hgroup >
63
69
<h3 >{{ removeProtocol(endpoint.endpoint) }}</h3 >
64
70
<p v-if =" endpoint.rule_groups?.[0]" >
@@ -70,6 +76,18 @@ defineProps({
70
76
</hgroup >
71
77
</card-element >
72
78
</edit-endpoint >
79
+
80
+ <!-- IF we have more than 1 endpoint, and the others are locked due to unsub, show subsctibe button -->
81
+ <confirms-subscription-start
82
+ v-if =" redirectId && !subscribed && index === 0 && endpoints.length > 1"
83
+ :redirectId =" redirectId"
84
+ :title =" $t('Activate other destinations')"
85
+ :submitText =" $t('Activate other destinations')"
86
+ >
87
+ <base-button class =" full-width" >{{
88
+ $t("Activate other destinations")
89
+ }}</base-button >
90
+ </confirms-subscription-start >
73
91
</template >
74
92
<base-button
75
93
v-if =" redirectId"
@@ -79,7 +97,7 @@ defineProps({
79
97
}"
80
98
:loading =" isLoading"
81
99
>{{
82
- hasBillableRedirects
100
+ subscribed
83
101
? $t("Add more free destinations")
84
102
: $t("Add more destinations to same code")
85
103
}}</base-button
0 commit comments