@@ -184,12 +184,11 @@ const showIssueDropdown = computed(() => {
184
184
return option? .isPublished !== null ;
185
185
});
186
186
187
- // TODO : need it ?
188
- // dynamic isRequired based on selection and props.isRequired
187
+ // dynamic isRequired based on selection and `props.isRequired`
189
188
const isIssueSelectionRequired = computed (() => {
190
- // Only require issue selection if:
191
- // 1. The field is marked as required (from PHP or JS)
192
- // 2. AND the selected assignment type actually requires an issue (isPublished !== null)
189
+ // we are only going to require issue selection if:
190
+ // 1. The field is marked as required (from PHP or JS)
191
+ // 2. AND the selected assignment type actually requires an issue (isPublished !== null)
193
192
const selectedOption = assignmentOptions .value .find (
194
193
(opt ) => opt .value === selectedAssignmentType .value ,
195
194
);
@@ -204,8 +203,6 @@ const shouldFetchPublishedIssues = computed(() => {
204
203
return option? .isPublished ;
205
204
});
206
205
207
- // TODO : need this ?
208
- // better validation logic
209
206
const isValid = computed (() => {
210
207
// If no assignment type selected, not valid
211
208
if (! selectedAssignmentType .value ) {
@@ -232,18 +229,13 @@ const publicationStatus = computed(() => {
232
229
return option? .status || null ;
233
230
});
234
231
235
- // TODO : need this ?
236
232
// validation error messages
237
233
const validationErrors = computed (() => {
238
234
if (! isValid .value ) {
239
235
// If assignment type requires issue but none selected
240
236
if (isIssueSelectionRequired .value && ! selectedIssueId .value ) {
241
237
return [t (' publication.assignToIssue.validation.issueRequired' )];
242
238
}
243
- // If no assignment type selected
244
- if (! selectedAssignmentType .value ) {
245
- return [t (' publication.assignToIssue.validation.assignmentRequired' )];
246
- }
247
239
}
248
240
return [];
249
241
});
@@ -258,16 +250,6 @@ watch(
258
250
{immediate: true },
259
251
);
260
252
261
- // Watch for assignment type changes to update validation
262
- watch (
263
- selectedAssignmentType,
264
- () => {
265
- // Trigger validation update when assignment type changes
266
- // This ensures validationErrors computed property updates
267
- },
268
- {immediate: true },
269
- );
270
-
271
253
const describedByErrorId = computed (() => {
272
254
return ` ${ props .formId || ' form' } -${ props .name } -error` ;
273
255
});
@@ -292,7 +274,7 @@ const onIssueChange = (fieldName, propName, newValue) => {
292
274
const emitValue = () => {
293
275
if (props .isPhpForm ) {
294
276
if (assignmentOptions .value .length > 0 ) {
295
- emit (' change' , ' issueId ' , ' value' , selectedIssueId .value );
277
+ emit (' change' , props . name , ' value' , selectedIssueId .value );
296
278
emit (' change' , ' status' , ' value' , publicationStatus .value );
297
279
}
298
280
} else {
@@ -388,7 +370,7 @@ watch(
388
370
389
371
emitValue (); // emit the value change
390
372
},
391
- {immediate: false }, // not run immediately since we handle it in onMounted
373
+ {immediate: false }, // not run immediately since it's been handled in onMounted
392
374
);
393
375
394
376
// emit initial required state
@@ -436,12 +418,13 @@ onMounted(async () => {
436
418
.pkpFormGroup -- issueSelection {
437
419
border: 1px solid #ddd;
438
420
border- radius: 2px ;
421
+ padding- left: 0rem ;
422
+ padding- right: 0rem ;
439
423
440
424
.pkpFormGroup__heading {
441
- border- bottom: 1px solid #ddd;
425
+ border- bottom: 0 . 1rem solid #ddd;
442
426
margin: - 2rem 0rem 2rem 0rem ;
443
- padding: 1 .5rem 0rem 2rem 0rem ;
444
- border- radius: 4px 4px 0 0 ;
427
+ padding: 1 .5rem 2rem 2rem 2rem ;
445
428
float: none;
446
429
width: 100 % ;
447
430
padding- inline- end: 2rem ;
@@ -451,6 +434,8 @@ onMounted(async () => {
451
434
float: none;
452
435
width: 100 % ;
453
436
padding- inline- start: 0 ;
437
+ padding- left: 2rem ! important;
438
+ padding- right: 2rem ! important;
454
439
455
440
> * + * {
456
441
margin- top: 1 .5rem ;
0 commit comments