Skip to content

Commit

Permalink
style header lables and fix group items function (superdesk#4520)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzonidoo committed Jun 12, 2024
1 parent 2d153d9 commit ed1c9d4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ function groupItemsToRows<T>(items: Array<T>, getWidth: (item: T) => number) {
rowWidth = rowWidth + itemWidth;
} else {
itemGroups.push([]);
if (itemWidth === 100) {
rowWidth = 100;
} else {
rowWidth = 0;
}
}

const lastGroup = itemGroups[itemGroups.length - 1];
Expand Down Expand Up @@ -85,13 +90,13 @@ export class AuthoringSection<T> extends React.PureComponent<IPropsAuthoringSect
backgroundColor: themeApplies ? this.props.uiTheme.backgroundColor : undefined,
display: 'flex',
flexDirection: 'column',
gap: '10px',
gap: '12px',
padding: this.props.padding,
}}
>
{
grouped.map((group, index) => (
<div key={index} style={{display: 'flex', gap: '10px'}}>
<div key={index} style={{display: 'flex', gap: '12px'}}>
{
group.map((field) => {
const canBeToggled = toggledFields[field.id] != null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,12 @@ export function getFieldContainer(

return (
<div className={sectionClassNames?.header}>
<div
style={{
display: 'flex',
justifyContent: 'start',
alignItems: 'center',
}}
>
<Spacer v gap="0">
<span
className={classNames(
'form-label',
{'form-label--invalid': validationError != null},
)}
style={{
width: '90px',
justifyContent: 'end',
}}
>
<Spacer h gap="8" noGrow noWrap>
<span style={{textAlign: 'end'}}>
Expand Down Expand Up @@ -79,7 +69,7 @@ export function getFieldContainer(
)
}
</div>
</div>
</Spacer>
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const itemTypesConfig: IDropdownConfigVocabulary = {
source: 'vocabulary',
vocabularyId: RUNDOWN_ITEM_TYPES_VOCABULARY_ID,
multiple: false,
width: 100,
width: 33,
};

const itemTypeField: IAuthoringFieldV2 = {
Expand All @@ -109,7 +109,7 @@ const cameraConfig: IDropdownConfigVocabulary = {
source: 'vocabulary',
vocabularyId: CAMERA,
multiple: true,
width: 100,
width: 33,
};

const cameraField: IAuthoringFieldV2 = {
Expand All @@ -124,7 +124,7 @@ const durationField: IAuthoringFieldV2 = {
name: gettext('Duration'),
fieldType: 'duration',
fieldConfig: {
width: 100,
width: 50,
},
};

Expand All @@ -133,7 +133,7 @@ const plannedDurationField: IAuthoringFieldV2 = {
name: gettext('Planned duration'),
fieldType: 'duration',
fieldConfig: {
width: 100,
width: 50,
},
};

Expand All @@ -150,7 +150,7 @@ const statusConfig: IDropdownConfigVocabulary = {
source: 'vocabulary',
vocabularyId: STATUS_VOCABULARY_ID,
multiple: false,
width: 100,
width: 33,
};

const statusField: IAuthoringFieldV2 = {
Expand Down

0 comments on commit ed1c9d4

Please sign in to comment.