Skip to content

Commit 8fa8bcc

Browse files
authored
Merge pull request #1508 from Sofie-Automation/fix/SOFIE-4126
Fix: input type of PM Quantel Accessor ISAURLs (SOFIE-4126)
2 parents 3f35590 + 7184cf2 commit 8fa8bcc

File tree

1 file changed

+110
-10
lines changed

1 file changed

+110
-10
lines changed

packages/webui/src/client/ui/Settings/Studio/PackageManager/AccessorTableRow.tsx

Lines changed: 110 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { TextInputControl } from '../../../../lib/Components/TextInput'
1717
import { DropdownInputControl, getDropdownInputOptions } from '../../../../lib/Components/DropdownInput'
1818
import { OverrideOpHelper, WrappedOverridableItemNormal } from '../../util/OverrideOpHelper'
1919
import { CheckboxControl } from '../../../../lib/Components/Checkbox'
20+
import { IntInputControl } from '../../../../lib/Components/IntInput'
2021

2122
interface AccessorTableRowProps {
2223
packageContainer: WrappedOverridableItemNormal<StudioPackageContainer>
@@ -183,7 +184,7 @@ export function AccessorTableRow({
183184
)}
184185
</LabelAndOverrides>
185186
<LabelAndOverrides
186-
label={t('Resourse Id')}
187+
label={t('Resource Id')}
187188
hint={t('(Optional) This could be the name of the computer on which the local folder is on')}
188189
item={packageContainer}
189190
//@ts-expect-error can't be 4 levels deep
@@ -411,14 +412,21 @@ export function AccessorTableRow({
411412
itemKey={`container.accessors.${accessorId}.ISAUrls`}
412413
overrideHelper={overrideHelper}
413414
>
414-
{(value, handleUpdate) => (
415-
<TextInputControl
416-
modifiedClassName="bghl"
417-
classNames="input text-input input-l"
418-
value={value}
419-
handleUpdate={handleUpdate}
420-
/>
421-
)}
415+
{(value, handleUpdate) => {
416+
// Convert array of strings into comma-separated string for the input:
417+
const strValue = Array.isArray(value) ? value.join(', ') : value
418+
return (
419+
<TextInputControl
420+
modifiedClassName="bghl"
421+
classNames="input text-input input-l"
422+
value={strValue}
423+
handleUpdate={(value: string) => {
424+
// Convert comma-separated string into array of strings
425+
handleUpdate(value.split(',').map((s) => s.trim()))
426+
}}
427+
/>
428+
)
429+
}}
422430
</LabelAndOverrides>
423431
<LabelAndOverrides
424432
label={t('Quantel Zone ID')}
@@ -448,7 +456,7 @@ export function AccessorTableRow({
448456
overrideHelper={overrideHelper}
449457
>
450458
{(value, handleUpdate) => (
451-
<TextInputControl
459+
<IntInputControl
452460
modifiedClassName="bghl"
453461
classNames="input text-input input-l"
454462
value={value}
@@ -508,6 +516,98 @@ export function AccessorTableRow({
508516
)}
509517
</LabelAndOverrides>
510518
</>
519+
) : accessor.type === Accessor.AccessType.ATEM_MEDIA_STORE ? (
520+
<>
521+
<LabelAndOverrides
522+
label={t('Resource Id')}
523+
hint={t('(Optional) This could be the name of the compute')}
524+
item={packageContainer}
525+
//@ts-expect-error can't be 4 levels deep
526+
itemKey={`container.accessors.${accessorId}.resourceId`}
527+
overrideHelper={overrideHelper}
528+
>
529+
{(value, handleUpdate) => (
530+
<TextInputControl
531+
modifiedClassName="bghl"
532+
classNames="input text-input input-l"
533+
value={value}
534+
handleUpdate={handleUpdate}
535+
/>
536+
)}
537+
</LabelAndOverrides>
538+
<LabelAndOverrides
539+
label={t('Network Id')}
540+
hint={t('(Optional) A name/identifier of the local network where the Atem is located')}
541+
item={packageContainer}
542+
//@ts-expect-error can't be 4 levels deep
543+
itemKey={`container.accessors.${accessorId}.networkId`}
544+
overrideHelper={overrideHelper}
545+
>
546+
{(value, handleUpdate) => (
547+
<TextInputControl
548+
modifiedClassName="bghl"
549+
classNames="input text-input input-l"
550+
value={value}
551+
handleUpdate={handleUpdate}
552+
/>
553+
)}
554+
</LabelAndOverrides>
555+
556+
<LabelAndOverrides
557+
label={t('Network address')}
558+
hint={t('Hostname or IP address of the Atem')}
559+
item={packageContainer}
560+
//@ts-expect-error can't be 4 levels deep
561+
itemKey={`container.accessors.${accessorId}.atemHost`}
562+
overrideHelper={overrideHelper}
563+
>
564+
{(value, handleUpdate) => (
565+
<TextInputControl
566+
modifiedClassName="bghl"
567+
classNames="input text-input input-l"
568+
value={value}
569+
handleUpdate={handleUpdate}
570+
/>
571+
)}
572+
</LabelAndOverrides>
573+
<LabelAndOverrides
574+
label={t('Bank Index')}
575+
hint={t(' The index of the Atem media/clip banks')}
576+
item={packageContainer}
577+
//@ts-expect-error can't be 4 levels deep
578+
itemKey={`container.accessors.${accessorId}.bankIndex`}
579+
overrideHelper={overrideHelper}
580+
>
581+
{(value, handleUpdate) => (
582+
<IntInputControl
583+
modifiedClassName="bghl"
584+
classNames="input text-input input-l"
585+
value={value}
586+
handleUpdate={handleUpdate}
587+
/>
588+
)}
589+
</LabelAndOverrides>
590+
<LabelAndOverridesForDropdown
591+
label={t('Media Type')}
592+
hint={t('What type of bank')}
593+
item={packageContainer}
594+
//@ts-expect-error can't be 4 levels deep
595+
itemKey={`container.accessors.${accessorId}.mediaType`}
596+
overrideHelper={overrideHelper}
597+
options={getDropdownInputOptions(['clip', 'still'])}
598+
>
599+
{(value, handleUpdate, options) => {
600+
return (
601+
<DropdownInputControl
602+
classNames="input text-input input-l"
603+
options={options}
604+
value={value}
605+
handleUpdate={handleUpdate}
606+
/>
607+
)
608+
}}
609+
</LabelAndOverridesForDropdown>
610+
</>
511611
) : null}
512612

513613
<LabelAndOverridesForCheckbox

0 commit comments

Comments
 (0)