Skip to content

Commit

Permalink
Revert "WIP"
Browse files Browse the repository at this point in the history
This reverts commit 2cc6fe8.
  • Loading branch information
tomaskikutis committed Dec 23, 2024
1 parent cbd0986 commit 6b4bb76
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ export class CoverageFormComponent extends React.Component<IProps, IState> {
}

onChange(field: string, value: any) {
debugger;
this.props.onChange(
`${this.props.field}.${field}`,
value
Expand Down
1 change: 0 additions & 1 deletion client/components/Planning/PlanningEditor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ class PlanningEditorComponent extends React.Component<IProps, IState> {

onCoverageChange(field: string, value: any, planningFormEdited: boolean = true) {
let valueToUpdate = value;
//

if (field.match(/^coverages\[/)) {
const {newsCoverageStatus} = this.props;
Expand Down
1 change: 0 additions & 1 deletion client/components/fields/editor/Coverages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export class EditorFieldCoverages extends React.PureComponent<IPropsEditorFieldC
const {gettext} = superdeskApi.localization;
const field = this.props.field ?? 'coverages';
const value = get(this.props.item, field, this.props.defaultValue);
//

return (
<CoverageArrayInput
Expand Down
5 changes: 0 additions & 5 deletions client/components/fields/editor/Genre.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,14 @@ export class EditorFieldGenreComponent extends React.PureComponent<IProps> {
render() {
const {gettext} = superdeskApi.localization;

console.log('genre props', this.props);

return (
<>
<EditorFieldSelect
{...this.props}
field={this.props.field ?? 'genre'}
label={this.props.label ?? gettext('Genre')}
options={this.props.genres}
labelField="name"
/>
<div>zap: {this.props.field ?? 'genre'}</div>
</>
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {superdeskApi} from '../../superdeskApi';
import {getProfile} from './profile';
import {omitFields} from './utils';
import {AutoSavePlanningItem, NoAutoSavePlanningItem} from './authoring-autosave';
import {planningUtils} from '../../utils';

const getAutosavedPlanningItem = (id: IPlanningItem['_id']): Promise<IPlanningItem | null> => {
return new Promise((resolve) => {
Expand All @@ -31,10 +30,7 @@ export const authoringStoragePlanningItemHttp: IAuthoringStorage<IPlanningItem>
path: `/planning/${id}`,
})
]).then(([autosaved, saved]) => {
return {
autosaved: autosaved == null ? null : planningUtils.modifyForClient(autosaved),
saved: planningUtils.modifyForClient(saved),
};
return {autosaved, saved};
});
},

Expand All @@ -51,12 +47,7 @@ export const authoringStoragePlanningItemHttp: IAuthoringStorage<IPlanningItem>
return httpRequestJsonLocal<IPlanningItem>({
method: 'PATCH',
path: `/planning/${original._id}`,
payload: omitFields(
generatePatch(
planningUtils.modifyForServer(original),
planningUtils.modifyForServer(current),
),
),
payload: omitFields(generatePatch(original, current)),
headers: {
'If-Match': original._etag,
},
Expand Down
2 changes: 1 addition & 1 deletion client/utils/planning.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ function getPlanningActionsForUiFrameworkMenu(data: IGetPlanningActionArgs): Arr
return toUIFrameworkInterface(planningUtils.getPlanningActions(data));
}

export function modifyForClient<T extends IPlanningItem | Partial<IPlanningItem>>(plan: T): T {
export function modifyForClient(plan: Partial<IPlanningItem>): Partial<IPlanningItem> {
sanitizeItemFields(plan);

// The `_status` field is available when the item comes from a POST/PATCH request
Expand Down

0 comments on commit 6b4bb76

Please sign in to comment.