Skip to content

Commit

Permalink
NXDRIVE-2912: Display Drive notification for document review --05/04 01
Browse files Browse the repository at this point in the history
  • Loading branch information
gitofanindya committed Apr 5, 2024
1 parent 2755b5e commit 3210980
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 24 deletions.
10 changes: 1 addition & 9 deletions nxdrive/data/qml/Systray.qml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ Rectangle {
}
}

Connections {
target: TasksModel

function onEngineChanged() {
taskState.pendingTasksCount = api.tasks_remaining(accountSelect.getRole("uid"))
}
}

Connections {
target: EngineModel

Expand Down Expand Up @@ -411,8 +403,8 @@ Rectangle {
target: taskState
text: qsTr("PENDING_DOCUMENT_REVIEWS").arg(pendingTasksCount) + tl.tr
onClicked: {
tasks_model.loadList(api.get_Tasks_list(accountSelect.getRole("uid")))
api.open_tasks_window(accountSelect.getRole("uid"))
tasks_model.loadList(api.get_Tasks_list(accountSelect.getRole("uid")));
}
}
}
Expand Down
9 changes: 0 additions & 9 deletions nxdrive/data/qml/SystrayMenu.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@ ShadowRectangle {
id: menuContent
spacing: 0

/*SystrayMenuItem {
text: qsTr("Tasks")
onClicked: {
api.show_tasks()
tasks_model.loadList();
control.visible = false
}
}*/

SystrayMenuItem {
text: qsTr("SETTINGS") + tl.tr
onClicked: {
Expand Down
8 changes: 4 additions & 4 deletions nxdrive/gui/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,12 +492,12 @@ def get_Tasks_list(self, engine_uid: str, /) -> list:
doc_id = task.targetDocumentIds[0]["id"]
doc_name = self.get_document_details(engine_uid, doc_id)
task.name = doc_name.title
type = task.directive
if "chooseParticipants" in type or "pleaseSelect" in type:
type_of_task = task.directive
if "chooseParticipants" in type_of_task or "pleaseSelect" in type_of_task:
task.workflowModelName = Translator.get("CHOOSE_PARTICIPANTS")
elif "give_opinion" in type:
elif "give_opinion" in type_of_task:
task.workflowModelName = Translator.get("GIVE_OPINION")
elif "AcceptReject" in type:
elif "AcceptReject" in type_of_task:
task.workflowModelName = Translator.get("VALIDATE_DOCUMENT")

return tasks_list
Expand Down
1 change: 0 additions & 1 deletion nxdrive/gui/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -1873,7 +1873,6 @@ def fetch_pending_tasks(self, engine: Engine, /) -> list:
except Exception:
log.info("Unable to fetch tasks")
tasks = []
self.tasks_model.loadList(tasks)
return tasks

def update_status(self, engine: Engine, /) -> None:
Expand Down
2 changes: 1 addition & 1 deletion nxdrive/gui/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ def get_model(self):

model = pyqtProperty(QObject, fget=get_model, constant=True)

@pyqtSlot(list, str)
@pyqtSlot(list)
def loadList(self, tasks_list: list, /) -> None:
self.taskmodel.clear()
for task in tasks_list:
Expand Down

0 comments on commit 3210980

Please sign in to comment.