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

port send to desk changes from angular based authoring #4177

Merged
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class SendToTab extends React.PureComponent<IProps, IState> {
super(props);

this.availableDesks = sdApi.desks.getAllDesks()
.filter((desk) => desk.send_to_desk_allowed)
.filter((desk) => desk?.send_to_desk_not_allowed === false)
thecalcc marked this conversation as resolved.
Show resolved Hide resolved
.toOrderedMap();

this.state = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function getInitialDestination(

// If destinationDesk isn't found in availableDesks we set the
// destinationDesk to the first item from availableDesks
if (availableDesks.filter(({_id}) => _id === destinationDesk).count() === 0) {
if (!availableDesks.has(destinationDesk)) {
destinationDesk = availableDesks.first()?._id;
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/core/superdesk-api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@ declare module 'superdesk-api' {
sams_settings?: {
allowed_sets?: Array<string>;
};
send_to_desk_allowed: boolean;
send_to_desk_not_allowed?: boolean;
}

export interface IStage extends IBaseRestApiResponse {
Expand Down
2 changes: 1 addition & 1 deletion scripts/test-data/test-desk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ export const testDesk: IDesk = {
default_content_template: 'test-desk-template',
preferred_cv_items: {},
preserve_published_content: false,
send_to_desk_allowed: false,
send_to_desk_not_allowed: false,
};