Skip to content

Commit

Permalink
Fix authoring and field (#4697)
Browse files Browse the repository at this point in the history
  • Loading branch information
thecalcc authored Dec 17, 2024
1 parent 7d4f943 commit 66562d0
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 27 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
"sass-loader": "6.0.6",
"shortid": "2.2.8",
"style-loader": "0.20.2",
"superdesk-ui-framework": "4.0.3",
"superdesk-ui-framework": "^4.0.4",
"ts-loader": "3.5.0",
"typescript": "4.9.5",
"uuid": "8.3.1",
Expand Down
44 changes: 23 additions & 21 deletions scripts/apps/authoring-react/authoring-react.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1451,7 +1451,7 @@ export class AuthoringReact<T extends IBaseRestApiResponse> extends React.PureCo
{this.props.headerToolbar != null && (
<AuthoringToolbar
entity={state.itemWithChanges}
widgets={this.props.headerToolbar(exposed)}
widgets={this.props.headerToolbar?.(exposed) ?? []}
backgroundColor={authoringOptions?.toolbarBgColor}
/>
)}
Expand All @@ -1477,26 +1477,28 @@ export class AuthoringReact<T extends IBaseRestApiResponse> extends React.PureCo
</div>
)}
>
<AuthoringSection
uiTheme={uiTheme}
padding="3.2rem 4rem 5.2rem 4rem"
fields={state.profile.content}
fieldsData={state.fieldsDataWithChanges}
onChange={this.handleFieldChange}
reinitialize={(item) => {
this.reinitialize(state, item);
}}
language={getLanguage(state.itemWithChanges)}
userPreferencesForFields={state.userPreferencesForFields}
setUserPreferencesForFields={this.setUserPreferences}
getVocabularyItems={this.getVocabularyItems}
toggledFields={state.toggledFields}
toggleField={this.toggleField}
readOnly={readOnly}
validationErrors={state.validationErrors}
item={state.itemWithChanges}
computeLatestEntity={this.computeLatestEntity}
/>
{state.profile.content.count() < 1 ? null : (
<AuthoringSection
uiTheme={uiTheme}
padding="3.2rem 4rem 5.2rem 4rem"
fields={state.profile.content}
fieldsData={state.fieldsDataWithChanges}
onChange={this.handleFieldChange}
reinitialize={(item) => {
this.reinitialize(state, item);
}}
language={getLanguage(state.itemWithChanges)}
userPreferencesForFields={state.userPreferencesForFields}
setUserPreferencesForFields={this.setUserPreferences}
getVocabularyItems={this.getVocabularyItems}
toggledFields={state.toggledFields}
toggleField={this.toggleField}
readOnly={readOnly}
validationErrors={state.validationErrors}
item={state.itemWithChanges}
computeLatestEntity={this.computeLatestEntity}
/>
)}
</Layout.AuthoringMain>
)}
sideOverlay={!isPinned && OpenWidgetComponent != null && OpenWidgetComponent}
Expand Down
5 changes: 4 additions & 1 deletion scripts/apps/authoring-react/fields/datetime/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ export class Editor extends React.PureComponent<IProps> {
<Container>
<DateTimePicker
dateFormat={appConfig.view.dateformat}
label={gettext('Date time (AUTHORING-REACT)')}
label={{
text: gettext('Date time'),
hidden: true,
}}
onChange={(value) => {
this.props.onChange(value);
}}
Expand Down
1 change: 0 additions & 1 deletion scripts/core/menu/authoring-switch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export const setupAuthoringReact = (url: string) => {
const isNavigatingToAnExtensionPage = extensionUrls.find(
(extensionUrl) => extensionUrl.startsWith(trimStartExact(parsedPath.hash, '#')),
) != null;

const isNavigatingToPlanning = parsedPath.hash.startsWith('#/planning');

const action: 'register' | 'deregister' = (() => {
Expand Down

0 comments on commit 66562d0

Please sign in to comment.