Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix authoring and field #4697

Merged
merged 4 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo would be better to avoid ^ there, we had changes in hotfix version which broke builds, the idea to remove that was that we get the updated framework version tested before it's used by clients
cc @tomaskikutis

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might have replied about it before, but I forgot - why package-lock isn't enough for hotfixes?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will start breaking builds in superdesk repo but not in superdesk-client-core when there is a change that requires changes in core

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why would it break builds in main superdesk repo? It also has package-lock

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or you say that when client-core is being updated from root repo it would update the version then?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dependabot will update ui framework and the build will fail, but it won't be visible on client-core repo but rather on some superdesk-cp where we would be using an older version, but which none of the ui team is following

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a grep-lint rule for this #4710

"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
Loading