Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Supported deleting grouped as well as one Note(s) on manage Notes page
- Loading branch information
Showing
3 changed files
with
110 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -396,7 +396,7 @@ public JSONArray fetchAllNotesForManageUI(boolean wholePageIsToBeLoaded) { | |
|
||
for (ChartSearchNote note : allNotes) { | ||
JSONObject json = new JSONObject(); | ||
if (note.getNoteOwner().getUserId().equals(Context.getAuthenticatedUser().getUserId())) {//manage owned notes only | ||
if (note.getNoteOwner().getUserId().equals(Context.getAuthenticatedUser().getUserId()) && null != note) {//manage owned notes only | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
||
json.put("uuid", note.getUuid()); | ||
json.put("createdOrLastModifiedAt", note.getCreatedOrLastModifiedAt().getTime()); | ||
json.put("backgroundColor", note.getDisplayColor()); | ||
|
@@ -415,6 +415,18 @@ public JSONArray fetchAllNotesForManageUI(boolean wholePageIsToBeLoaded) { | |
return jsonArr; | ||
} | ||
|
||
public JSONArray deleteSelectedNotes(String[] uuids) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
k-joseph
Author
Member
|
||
if (uuids != null && uuids.length != 0) { | ||
for (int i = 0; i < uuids.length; i++) { | ||
ChartSearchNote note = chartSearchService.getSearchNoteByUuid(uuids[i]); | ||
if (note != null) { | ||
chartSearchService.deleteSearchNote(note); | ||
} | ||
} | ||
} | ||
return fetchAllNotesForManageUI(false); | ||
} | ||
|
||
private <T> T getComponent(Class<T> clazz) { | ||
List<T> list = Context.getRegisteredComponents(clazz); | ||
if (list == null || list.size() == 0) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
why don't you say note != null?