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 : Locked items in package widget cannot be opened [SDESK-6706] #4168

Merged
merged 4 commits into from
Jan 6, 2023
Merged
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
5 changes: 3 additions & 2 deletions scripts/apps/authoring/packages/packages.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import _ from 'lodash';
import {gettext} from 'core/utils';
import {openArticle} from 'core/get-superdesk-api-implementation';

PackagesCtrl.$inject = ['$scope', 'superdesk', 'api', 'search'];
function PackagesCtrl($scope, superdesk, api, search) {
Expand Down Expand Up @@ -27,9 +28,9 @@ function PackagesCtrl($scope, superdesk, api, search) {

$scope.openPackage = function(packageItem) {
if (packageItem._type === 'published') {
superdesk.intent('view', 'item', packageItem);
openArticle(packageItem._id, 'view');
} else {
superdesk.intent('edit', 'item', packageItem);
Copy link
Member

Choose a reason for hiding this comment

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

A function is called here to initiate editing. You should go to the implementation and fix the issue there

Copy link
Member Author

Choose a reason for hiding this comment

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

did you mean superdesk.intent needs to be changed?

Copy link
Member

Choose a reason for hiding this comment

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

superdesk.intent is a general function that is used for many things, but yes - you should track the callstack through the intent call until you get to code that is initiating the editing and do the change there.

openArticle(packageItem._id, 'edit');
}
};

Expand Down