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 failing e2e #2185

Merged
merged 8 commits into from
Jan 22, 2025
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
39 changes: 39 additions & 0 deletions client/components/Contacts/ActionBar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import React from 'react';
import PropTypes from 'prop-types';
import {gettext} from 'core/utils';

export const ActionBar: React.FunctionComponent<any> = ({svc, readOnly, dirty, valid, onSave, onCancel}) => (
<div className="action-bar show">
Copy link
Collaborator

Choose a reason for hiding this comment

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

@fritzSF @tomaskikutis Are there components in the UI Framework that can be used here instead of this?

Copy link
Member

Choose a reason for hiding this comment

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

There is subnav that might be similar, but if existing one works without issues I won't be spending time to replace it.

<div className="button-group button-group--end button-group--comfort">
<button
id="cancel-edit-btn"
type="button"
className="btn"
onClick={onCancel}
>
{gettext('Cancel')}
</button>

{!readOnly && (
<button
id="save-edit-btn"
type="button"
className="btn btn--primary"
onClick={onSave}
disabled={!valid || !dirty}
>
{gettext('Save')}
</button>
)}
</div>
</div>
);

ActionBar.propTypes = {
svc: PropTypes.object.isRequired,
onSave: PropTypes.func,
onCancel: PropTypes.func,
readOnly: PropTypes.bool,
dirty: PropTypes.bool,
valid: PropTypes.bool,
};
3 changes: 2 additions & 1 deletion client/components/Contacts/ContactEditor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {gettext} from '../../../utils';
import * as ContactFormComponents from 'superdesk-core/scripts/apps/contacts/components/Form';
import {IContact} from 'superdesk-core/scripts/apps/contacts/Contacts';
import ng from 'superdesk-core/scripts/core/services/ng';
import {ActionBar} from '../ActionBar';

interface IProps {
currentContact: IContact;
Expand Down Expand Up @@ -75,7 +76,7 @@ export class ContactEditor extends React.Component<IProps, IState> {
}

render() {
const {ContactFormContainer, ActionBar} = ContactFormComponents;
const {ContactFormContainer} = ContactFormComponents;
const {currentContact} = this.props;

// Provides required services for Contact components
Expand Down
6 changes: 3 additions & 3 deletions e2e/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.8"

name: superdesk-planning-e2e

services:
Expand All @@ -9,6 +7,8 @@ services:
- discovery.type=single-node
networks:
- e2e
ports:
- "9200:9200"
tmpfs:
- /usr/share/elasticsearch/data

Expand All @@ -18,7 +18,7 @@ services:
- e2e

mongo:
image: mongo:4
image: mongo:6
networks:
- e2e
tmpfs:
Expand Down
2 changes: 1 addition & 1 deletion server/planning/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ def update_ingest_on_patch(updates: Dict[str, Any], original: Dict[str, Any]):
# The local version has not been published yet
# So remove the provided ``pubstatus``
updates.pop("pubstatus", None)
elif original.get("pubstatus") == updates.get("ingest_pubstatus") or original.get("pubstatus"):
elif original.get("pubstatus") == updates.get("ingest_pubstatus"):
# The local version has been published
# and no change to ``pubstatus`` on ingested item
updates.pop("state")
Expand Down
2 changes: 1 addition & 1 deletion server/planning/events/events_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"ingest_provider_sequence": metadata_schema["ingest_provider_sequence"],
"ingest_firstcreated": metadata_schema["versioncreated"],
"ingest_versioncreated": metadata_schema["versioncreated"],
"ingest_pubstatus": metadata_schema["pubstatus"],
"ingest_pubstatus": {"type": "string", "mapping": not_analyzed},
"event_created": {"type": "datetime"},
"event_lastmodified": {"type": "datetime"},
# Event Details
Expand Down
2 changes: 1 addition & 1 deletion server/planning/planning/planning.py
Original file line number Diff line number Diff line change
Expand Up @@ -1814,7 +1814,7 @@ def _iter_recurring_plannings_to_update(self, updates, original, update_method):
"ingest_provider_sequence": metadata_schema["ingest_provider_sequence"],
"ingest_firstcreated": metadata_schema["versioncreated"],
"ingest_versioncreated": metadata_schema["versioncreated"],
"ingest_pubstatus": metadata_schema["pubstatus"],
"ingest_pubstatus": {"type": "string", "mapping": not_analyzed},
# Agenda Item details
"agendas": {
"type": "list",
Expand Down
Loading