Skip to content

Commit 50d869e

Browse files
author
Mint de Wit
committed
chore: various review comments
1 parent 80ae9d8 commit 50d869e

File tree

18 files changed

+210
-332
lines changed

18 files changed

+210
-332
lines changed

packages/blueprints-integration/src/userEditing.ts

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ import { SourceLayerType } from './content'
66
/**
77
* Description of a user performed editing operation allowed on an document
88
*/
9-
export type UserEditingDefinition =
10-
| UserEditingDefinitionAction
11-
| UserEditingDefinitionForm
12-
| UserEditingDefinitionSourceLayerForm
9+
export type UserEditingDefinition = UserEditingDefinitionAction | UserEditingDefinitionForm
1310

1411
/**
1512
* A simple 'action' that can be performed
@@ -26,8 +23,6 @@ export interface UserEditingDefinitionAction {
2623
svgIconInactive?: string
2724
/** Whether this action should be indicated as being active */
2825
isActive?: boolean
29-
/** Button Type */
30-
buttonType?: UserEditingButtonType
3126
}
3227

3328
/**
@@ -45,32 +40,11 @@ export interface UserEditingDefinitionForm {
4540
currentValues: Record<string, any>
4641
}
4742

48-
/**
49-
* A form based operation where the user first selects the type
50-
* of form they want to use (i.e. Camera form vs VT form)
51-
*/
52-
export interface UserEditingDefinitionSourceLayerForm {
53-
type: UserEditingType.SOURCE_LAYER_FORM
54-
/** Id of this operation */
55-
id: string
56-
/** Label to show to the user for this operation */
57-
label: ITranslatableMessage
58-
/** The json schemas describing the form to display */
59-
schemas: Record<string, UserEditingSourceLayer>
60-
/** Current values to populate the form with */
61-
currentValues: {
62-
type: SourceLayerType
63-
value: Record<string, any>
64-
}
65-
}
66-
6743
export enum UserEditingType {
6844
/** Action */
6945
ACTION = 'action',
7046
/** Form */
7147
FORM = 'form',
72-
/** Forms that the user has to select a sourceLayerType first */
73-
SOURCE_LAYER_FORM = 'sourceLayerForm',
7448
}
7549

7650
export interface UserEditingSourceLayer {
@@ -80,15 +54,6 @@ export interface UserEditingSourceLayer {
8054
defaultValue?: Record<string, any>
8155
}
8256

83-
export enum UserEditingButtonType {
84-
/** Button */
85-
BUTTON = 'button',
86-
/** Icon */
87-
SWITCH = 'switch',
88-
/** Hidden */
89-
HIDDEN = 'hidden',
90-
}
91-
9257
export interface UserEditingProperties {
9358
/**
9459
* These properties are dependent on the (primary) piece type, the user will get the option

packages/corelib/src/dataModel/UserEditingDefinitions.ts

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,10 @@ import type {
33
JSONBlob,
44
JSONSchema,
55
UserEditingSourceLayer,
6-
UserEditingButtonType,
7-
SourceLayerType,
86
} from '@sofie-automation/blueprints-integration'
97
import type { ITranslatableMessage } from '../TranslatableMessage'
108

11-
export type CoreUserEditingDefinition =
12-
| CoreUserEditingDefinitionAction
13-
| CoreUserEditingDefinitionForm
14-
| CoreUserEditingDefinitionSourceLayerForm
9+
export type CoreUserEditingDefinition = CoreUserEditingDefinitionAction | CoreUserEditingDefinitionForm
1510

1611
export interface CoreUserEditingDefinitionAction {
1712
type: UserEditingType.ACTION
@@ -25,8 +20,6 @@ export interface CoreUserEditingDefinitionAction {
2520
svgIconInactive?: string
2621
/** Whether this action should be indicated as being active */
2722
isActive?: boolean
28-
//** Button Type */
29-
buttonType?: UserEditingButtonType
3023
}
3124

3225
/**
@@ -46,27 +39,6 @@ export interface CoreUserEditingDefinitionForm {
4639
translationNamespaces: string[]
4740
}
4841

49-
/**
50-
* A form based operation where the user first selects the type
51-
* of form they want to use (i.e. Camera form vs VT form)
52-
*/
53-
export interface CoreUserEditingDefinitionSourceLayerForm {
54-
type: UserEditingType.SOURCE_LAYER_FORM
55-
/** Id of this operation */
56-
id: string
57-
/** Label to show to the user for this operation */
58-
label: ITranslatableMessage
59-
/** Sourcelayer Type */
60-
schemas: Record<string, UserEditingSourceLayer>
61-
/** Translation namespaces to use when rendering this form */
62-
translationNamespaces: string[]
63-
/** Current values to populate the form with */
64-
currentValues: {
65-
type: SourceLayerType
66-
value: Record<string, any>
67-
}
68-
}
69-
7042
export interface CoreUserEditingProperties {
7143
/**
7244
* These properties are dependent on the (primary) piece type, the user will get the option

packages/job-worker/src/blueprints/context/lib.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
CoreUserEditingDefinition,
1414
CoreUserEditingDefinitionAction,
1515
CoreUserEditingDefinitionForm,
16-
CoreUserEditingDefinitionSourceLayerForm,
1716
CoreUserEditingProperties,
1817
} from '@sofie-automation/corelib/dist/dataModel/UserEditingDefinitions'
1918
import { DBSegment } from '@sofie-automation/corelib/dist/dataModel/Segment'
@@ -58,7 +57,6 @@ import {
5857
UserEditingDefinition,
5958
UserEditingDefinitionAction,
6059
UserEditingDefinitionForm,
61-
UserEditingDefinitionSourceLayerForm,
6260
UserEditingProperties,
6361
UserEditingType,
6462
} from '@sofie-automation/blueprints-integration/dist/userEditing'
@@ -521,7 +519,6 @@ function translateUserEditsToBlueprint(
521519
svgIcon: userEdit.svgIcon,
522520
svgIconInactive: userEdit.svgIconInactive,
523521
isActive: userEdit.isActive,
524-
buttonType: userEdit.buttonType,
525522
} satisfies Complete<UserEditingDefinitionAction>
526523
case UserEditingType.FORM:
527524
return {
@@ -531,14 +528,6 @@ function translateUserEditsToBlueprint(
531528
schema: clone(userEdit.schema),
532529
currentValues: clone(userEdit.currentValues),
533530
} satisfies Complete<UserEditingDefinitionForm>
534-
case UserEditingType.SOURCE_LAYER_FORM:
535-
return {
536-
type: UserEditingType.SOURCE_LAYER_FORM,
537-
id: userEdit.id,
538-
label: omit(userEdit.label, 'namespaces'),
539-
schemas: clone(userEdit.schemas),
540-
currentValues: clone(userEdit.currentValues),
541-
} satisfies Complete<UserEditingDefinitionSourceLayerForm>
542531
default:
543532
assertNever(userEdit)
544533
return undefined
@@ -565,7 +554,6 @@ function translateUserEditPropertiesToBlueprint(
565554
svgIcon: userEdit.svgIcon,
566555
svgIconInactive: userEdit.svgIconInactive,
567556
isActive: userEdit.isActive,
568-
buttonType: userEdit.buttonType,
569557
} satisfies Complete<UserEditingDefinitionAction>)
570558
),
571559
}
@@ -588,7 +576,6 @@ export function translateUserEditsFromBlueprint(
588576
svgIcon: userEdit.svgIcon,
589577
svgIconInactive: userEdit.svgIconInactive,
590578
isActive: userEdit.isActive,
591-
buttonType: userEdit.buttonType,
592579
} satisfies Complete<CoreUserEditingDefinitionAction>
593580
case UserEditingType.FORM:
594581
return {
@@ -599,15 +586,6 @@ export function translateUserEditsFromBlueprint(
599586
currentValues: clone(userEdit.currentValues),
600587
translationNamespaces: unprotectStringArray(blueprintIds),
601588
} satisfies Complete<CoreUserEditingDefinitionForm>
602-
case UserEditingType.SOURCE_LAYER_FORM:
603-
return {
604-
type: UserEditingType.SOURCE_LAYER_FORM,
605-
id: userEdit.id,
606-
label: wrapTranslatableMessageFromBlueprints(userEdit.label, blueprintIds),
607-
schemas: clone(userEdit.schemas),
608-
currentValues: clone(userEdit.currentValues),
609-
translationNamespaces: unprotectStringArray(blueprintIds),
610-
} satisfies Complete<CoreUserEditingDefinitionSourceLayerForm>
611589
default:
612590
assertNever(userEdit)
613591
return undefined
@@ -635,7 +613,6 @@ export function translateUserEditPropertiesFromBlueprint(
635613
svgIcon: userEdit.svgIcon,
636614
svgIconInactive: userEdit.svgIconInactive,
637615
isActive: userEdit.isActive,
638-
buttonType: userEdit.buttonType,
639616
} satisfies Complete<UserEditingDefinitionAction>)
640617
),
641618

packages/webui/src/client/lib/forms/SchemaFormInPlace.scss

Lines changed: 68 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -2,75 +2,74 @@
22
// to get styling on the current Sofie UI schema/overrides components
33
// without changing current look and behavior in other places of Sofie
44
.styled-schema-form {
5-
width: 100%;
6-
7-
// Force the base input-l class
8-
.input-l {
9-
width: 100% !important;
10-
max-width: none !important;
11-
margin-left: 0px;
12-
border: none;
13-
}
14-
15-
// Force the select/text-input defaults
16-
.select,
17-
.inline-select,
18-
.text-input {
19-
display: block !important;
20-
position: relative;
21-
width: 100% !important;
22-
}
23-
24-
.input {
25-
border: 1px solid #e5e7eb;
26-
border-radius: 0.375rem;
27-
padding: 0.5rem 0.75rem;
28-
width: 100%;
29-
30-
&:focus {
31-
outline: none;
32-
border-color: #3b82f6;
33-
box-shadow: 0 0 0 1px #3b82f6;
34-
}
35-
}
36-
37-
.label-text {
38-
&:before {
39-
content: none !important;
40-
}
41-
}
42-
43-
.dropdown {
44-
background: white;
45-
border: 1px solid #e5e7eb;
46-
border-radius: 0.375rem;
47-
width: 100%;
48-
max-width: 100%;
49-
50-
.input,
51-
.input-l {
52-
border: none;
53-
outline: none;
54-
box-shadow: none;
55-
}
56-
57-
&:focus-within {
58-
border-color: #3b82f6;
59-
box-shadow: 0 0 0 1px #3b82f6;
60-
}
61-
}
5+
width: 100%;
626

63-
// Force the label over selector
64-
.label-actual {
65-
margin-bottom: 0.5rem !important; // Increased spacing between label and selector
66-
}
67-
68-
.label {
69-
font-size: 0.875rem;
70-
font-weight: 500;
71-
color: #374151;
72-
display: block;
73-
}
7+
// Force the base input-l class
8+
.input-l {
9+
width: 100% !important;
10+
max-width: none !important;
11+
margin-left: 0px;
12+
border: none;
13+
}
7414

15+
// Force the select/text-input defaults
16+
.select,
17+
.inline-select,
18+
.text-input {
19+
display: block !important;
20+
position: relative;
21+
width: 100% !important;
22+
}
7523

76-
}
24+
.input {
25+
border: 1px solid #e5e7eb;
26+
border-radius: 0.375rem;
27+
padding: 0.5rem 0.75rem;
28+
width: 100%;
29+
30+
&:focus {
31+
outline: none;
32+
border-color: #3b82f6;
33+
box-shadow: 0 0 0 1px #3b82f6;
34+
background-color: unset !important; // origo >.>
35+
}
36+
}
37+
38+
.label-text {
39+
&:before {
40+
content: none !important;
41+
}
42+
}
43+
44+
.dropdown {
45+
background: white;
46+
border: 1px solid #e5e7eb;
47+
border-radius: 0.375rem;
48+
width: 100%;
49+
max-width: 100%;
50+
51+
.input,
52+
.input-l {
53+
border: none;
54+
outline: none;
55+
box-shadow: none;
56+
}
57+
58+
&:focus-within {
59+
border-color: #3b82f6;
60+
box-shadow: 0 0 0 1px #3b82f6;
61+
}
62+
}
63+
64+
// Force the label over selector
65+
.label-actual {
66+
margin-bottom: 0.5rem !important; // Increased spacing between label and selector
67+
}
68+
69+
.label {
70+
font-size: 0.875rem;
71+
font-weight: 500;
72+
color: #374151;
73+
display: block;
74+
}
75+
}

0 commit comments

Comments
 (0)