@mundogamernetwork/shared-ui 1.1.79 → 1.1.80
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.
- package/locales/de.json +6 -1
- package/locales/en.json +6 -1
- package/locales/pt-BR.json +6 -1
- package/locales/ro.json +6 -1
- package/package.json +1 -1
- package/pages/key-campaigns/redeem-key.vue +42 -4
package/locales/de.json
CHANGED
|
@@ -169,7 +169,12 @@
|
|
|
169
169
|
},
|
|
170
170
|
"status_label": "Status",
|
|
171
171
|
"error_no_keys": "Derzeit sind keine Schlüssel für diese Kampagne verfügbar.",
|
|
172
|
-
"error_not_approved": "Ihre Anfrage wurde noch nicht genehmigt."
|
|
172
|
+
"error_not_approved": "Ihre Anfrage wurde noch nicht genehmigt.",
|
|
173
|
+
"quantity": "Anzahl der Schlüssel",
|
|
174
|
+
"error_duplicate": "Sie haben bereits eine Anfrage für diese Kampagne. Überprüfen Sie 'Meine Bestellungen' für den Status.",
|
|
175
|
+
"error_user_blocked": "Ihr Zugang zu Key-Anfragen wurde vorübergehend gesperrt, da Material-Einreichungen überfällig sind. Bitte reichen Sie Ihre ausstehenden Materialien ein.",
|
|
176
|
+
"error_not_eligible": "Diese Kampagne ist für Ihren aktuellen Plan nicht verfügbar.",
|
|
177
|
+
"error_pending_limit": "Sie haben das gleichzeitige Anfragenlimit Ihres Plans erreicht. Bitte erfüllen Sie Ihre ausstehenden Verpflichtungen, bevor Sie einen neuen Key anfordern."
|
|
173
178
|
},
|
|
174
179
|
"materials": {
|
|
175
180
|
"title": "Submit material",
|
package/locales/en.json
CHANGED
|
@@ -169,7 +169,12 @@
|
|
|
169
169
|
},
|
|
170
170
|
"status_label": "Status",
|
|
171
171
|
"error_no_keys": "No keys available for this campaign at the moment.",
|
|
172
|
-
"error_not_approved": "Your request has not been approved yet."
|
|
172
|
+
"error_not_approved": "Your request has not been approved yet.",
|
|
173
|
+
"quantity": "Number of keys",
|
|
174
|
+
"error_duplicate": "You already have a request for this campaign. Check 'My Orders' to see the status.",
|
|
175
|
+
"error_user_blocked": "Your key request access has been temporarily blocked due to overdue material submissions. Please submit your pending materials to restore access.",
|
|
176
|
+
"error_not_eligible": "This campaign is not available for your current plan.",
|
|
177
|
+
"error_pending_limit": "You have reached the simultaneous request limit for your plan. Please fulfill your pending obligations before requesting a new key."
|
|
173
178
|
},
|
|
174
179
|
"materials": {
|
|
175
180
|
"title": "Submit material",
|
package/locales/pt-BR.json
CHANGED
|
@@ -169,7 +169,12 @@
|
|
|
169
169
|
},
|
|
170
170
|
"status_label": "Status",
|
|
171
171
|
"error_no_keys": "Não há chaves disponíveis para esta campanha no momento.",
|
|
172
|
-
"error_not_approved": "Sua solicitação ainda não foi aprovada."
|
|
172
|
+
"error_not_approved": "Sua solicitação ainda não foi aprovada.",
|
|
173
|
+
"quantity": "Quantidade de chaves",
|
|
174
|
+
"error_duplicate": "Você já tem um pedido para esta campanha. Acesse 'Meus Pedidos' para ver o status.",
|
|
175
|
+
"error_user_blocked": "Seu acesso a pedidos de chave está temporariamente bloqueado por materiais não entregues. Envie seus materiais pendentes para restaurar o acesso.",
|
|
176
|
+
"error_not_eligible": "Esta campanha não está disponível para o seu plano atual.",
|
|
177
|
+
"error_pending_limit": "Você atingiu o limite de pedidos simultâneos do seu plano. Entregue o material pendente antes de solicitar uma nova chave."
|
|
173
178
|
},
|
|
174
179
|
"materials": {
|
|
175
180
|
"title": "Submit material",
|
package/locales/ro.json
CHANGED
|
@@ -169,7 +169,12 @@
|
|
|
169
169
|
},
|
|
170
170
|
"status_label": "Status",
|
|
171
171
|
"error_no_keys": "Nu există chei disponibile pentru această campanie în acest moment.",
|
|
172
|
-
"error_not_approved": "Cererea ta nu a fost aprobată încă."
|
|
172
|
+
"error_not_approved": "Cererea ta nu a fost aprobată încă.",
|
|
173
|
+
"quantity": "Numărul de chei",
|
|
174
|
+
"error_duplicate": "Aveți deja o cerere pentru această campanie. Verificați 'Comenzile mele' pentru status.",
|
|
175
|
+
"error_user_blocked": "Accesul dvs. la solicitările de chei a fost blocat temporar din cauza transmisiilor de materiale restante. Trimiteți materialele dvs. pentru a restabili accesul.",
|
|
176
|
+
"error_not_eligible": "Această campanie nu este disponibilă pentru planul dvs. actual.",
|
|
177
|
+
"error_pending_limit": "Ați atins limita de cereri simultane a planului dvs. Îndepliniți-vă obligațiile restante înainte de a solicita o nouă cheie."
|
|
173
178
|
},
|
|
174
179
|
"materials": {
|
|
175
180
|
"title": "Submit material",
|
package/package.json
CHANGED
|
@@ -35,6 +35,15 @@ const requestError = ref("")
|
|
|
35
35
|
const selectedPlatformId = ref<number | null>(null)
|
|
36
36
|
const selectedRegionId = ref<number | null>(null)
|
|
37
37
|
const description = ref("")
|
|
38
|
+
const quantity = ref<number | null>(1)
|
|
39
|
+
|
|
40
|
+
const maxKeysForUser = computed(() => campaign.value?.max_keys_for_user ?? 1)
|
|
41
|
+
|
|
42
|
+
function clampQuantity() {
|
|
43
|
+
if (quantity.value === null) return
|
|
44
|
+
if (quantity.value < 1) quantity.value = 1
|
|
45
|
+
if (quantity.value > maxKeysForUser.value) quantity.value = maxKeysForUser.value
|
|
46
|
+
}
|
|
38
47
|
|
|
39
48
|
onMounted(async () => {
|
|
40
49
|
if (!currentUser) {
|
|
@@ -63,7 +72,7 @@ onMounted(async () => {
|
|
|
63
72
|
})
|
|
64
73
|
|
|
65
74
|
const canSubmit = computed(() =>
|
|
66
|
-
!!selectedPlatformId.value && !!selectedRegionId.value && !submitting.value,
|
|
75
|
+
!!selectedPlatformId.value && !!selectedRegionId.value && !!quantity.value && !submitting.value,
|
|
67
76
|
)
|
|
68
77
|
|
|
69
78
|
async function submit() {
|
|
@@ -76,15 +85,27 @@ async function submit() {
|
|
|
76
85
|
platform_ids: [selectedPlatformId.value],
|
|
77
86
|
region_ids: [selectedRegionId.value],
|
|
78
87
|
description: description.value || "-",
|
|
79
|
-
quantity_keys: 1,
|
|
88
|
+
quantity_keys: Number(quantity.value) || 1,
|
|
80
89
|
})
|
|
81
90
|
success.value = true
|
|
82
91
|
setTimeout(() => {
|
|
83
92
|
navigateTo(`/${locale.value}/key-campaigns`)
|
|
84
93
|
}, 2000)
|
|
85
94
|
} catch (e: any) {
|
|
86
|
-
const
|
|
87
|
-
|
|
95
|
+
const status = e?.response?.status
|
|
96
|
+
const errorCode = e?.response?.data?.error_code
|
|
97
|
+
if (status === 409) {
|
|
98
|
+
requestError.value = $i18n.t("keys.campaigns.error_duplicate")
|
|
99
|
+
} else if (status === 403 && errorCode === "user_key_blocked") {
|
|
100
|
+
requestError.value = $i18n.t("keys.campaigns.error_user_blocked")
|
|
101
|
+
} else if (status === 403) {
|
|
102
|
+
requestError.value = $i18n.t("keys.campaigns.error_not_eligible")
|
|
103
|
+
} else if (status === 422 && errorCode === "pending_limit_reached") {
|
|
104
|
+
requestError.value = $i18n.t("keys.campaigns.error_pending_limit")
|
|
105
|
+
} else {
|
|
106
|
+
const msg = e?.response?.data?.message || e?.message || ""
|
|
107
|
+
requestError.value = msg || $i18n.t("keys.campaigns.error_request")
|
|
108
|
+
}
|
|
88
109
|
} finally {
|
|
89
110
|
submitting.value = false
|
|
90
111
|
}
|
|
@@ -161,6 +182,19 @@ function goBack() {
|
|
|
161
182
|
</div>
|
|
162
183
|
</div>
|
|
163
184
|
|
|
185
|
+
<!-- Quantity -->
|
|
186
|
+
<div class="field" v-if="maxKeysForUser > 1">
|
|
187
|
+
<label class="label">{{ $t("keys.campaigns.quantity") }}</label>
|
|
188
|
+
<input
|
|
189
|
+
v-model.number="quantity"
|
|
190
|
+
type="number"
|
|
191
|
+
min="1"
|
|
192
|
+
:max="maxKeysForUser"
|
|
193
|
+
class="textarea quantity-input"
|
|
194
|
+
@change="clampQuantity"
|
|
195
|
+
/>
|
|
196
|
+
</div>
|
|
197
|
+
|
|
164
198
|
<!-- Description (optional) -->
|
|
165
199
|
<div class="field">
|
|
166
200
|
<label class="label">{{ $t("keys.campaigns.description_optional") }}</label>
|
|
@@ -278,6 +312,10 @@ function goBack() {
|
|
|
278
312
|
}
|
|
279
313
|
}
|
|
280
314
|
|
|
315
|
+
.quantity-input {
|
|
316
|
+
width: 120px;
|
|
317
|
+
}
|
|
318
|
+
|
|
281
319
|
.textarea {
|
|
282
320
|
width: 100%;
|
|
283
321
|
background: var(--bg-app-badge);
|