Skip to content

Commit

Permalink
[cuegui] Add Request Core Buttons to MenuActions (#1477)
Browse files Browse the repository at this point in the history
This new feature adds a new menu action that opens a new `dialog` to
request more cores via email for a given job.

The `dialog` is an Email composed where the message is pre-populated
with relevant data about the job. Fields, like `to`, `cc` and `bcc`,
need to be filled manually. The content of the message is editable.



![image](https://github.com/user-attachments/assets/563157e6-c901-4a1d-8109-c43f804ec0be)

---------

Signed-off-by: Diego Tavares <[email protected]>
Co-authored-by: Roula O'Regan <[email protected]>
  • Loading branch information
DiegoTavares and roulaoregan-spi authored Aug 21, 2024
1 parent 0df0678 commit 97ced67
Show file tree
Hide file tree
Showing 7 changed files with 391 additions and 15 deletions.
18 changes: 8 additions & 10 deletions cuegui/cuegui/Constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,6 @@ def __packaged_version():
if not os.path.isabs(CONFIG_PATH):
CONFIG_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), CONFIG_PATH))


EMAIL_SUBJECT_PREFIX = "cuemail: please check "
EMAIL_BODY_PREFIX = "Your PSTs request that you check:\n"
EMAIL_BODY_SUFFIX = "\n\n"
EMAIL_DOMAIN = ""

DEFAULT_INI_PATH = os.getenv('CUEGUI_DEFAULT_INI_PATH', __config.get('paths.default_ini_path'))
if not os.path.isabs(DEFAULT_INI_PATH):
DEFAULT_INI_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), DEFAULT_INI_PATH))
Expand All @@ -133,10 +127,14 @@ def __packaged_version():
LOGGER_FORMAT = __config.get('logger.format')
LOGGER_LEVEL = __config.get('logger.level')

EMAIL_SUBJECT_PREFIX = __config.get('email.subject_prefix')
EMAIL_BODY_PREFIX = __config.get('email.body_prefix')
EMAIL_BODY_SUFFIX = __config.get('email.body_suffix')
EMAIL_DOMAIN = __config.get('email.domain')
EMAIL_SUBJECT_PREFIX = __config.get('email.subject_prefix', "cuemail: please check ")
EMAIL_BODY_PREFIX = __config.get('email.body_prefix',
"Your Support Team requests that you check:\n")
EMAIL_BODY_SUFFIX = __config.get('email.body_suffix', "\n\n")
EMAIL_DOMAIN = __config.get('email.domain', "")
SHOW_SUPPORT_CC_TEMPLATE = [val.strip()
for val
in __config.get('email.show_support_cc_template', '').split(',')]

GITHUB_CREATE_ISSUE_URL = __config.get('links.issue.create')
URL_USERGUIDE = __config.get('links.user_guide')
Expand Down
1 change: 1 addition & 0 deletions cuegui/cuegui/CueJobMonitorTree.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,7 @@ def contextMenuEvent(self, e):

self.__menuActions.jobs().addAction(menu, "view")
self.__menuActions.jobs().addAction(menu, "emailArtist")
self.__menuActions.jobs().addAction(menu, "requestCores")
self.__menuActions.jobs().addAction(menu, "subscribeToJob")
self.__menuActions.jobs().addAction(menu, "viewComments")
self.__menuActions.jobs().addAction(menu, "sendToGroup")
Expand Down
1 change: 1 addition & 0 deletions cuegui/cuegui/JobMonitorTree.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ def contextMenuEvent(self, e):
self.__menuActions.jobs().addAction(menu, "unmonitor")
self.__menuActions.jobs().addAction(menu, "view")
self.__menuActions.jobs().addAction(menu, "emailArtist")
self.__menuActions.jobs().addAction(menu, "requestCores")
self.__menuActions.jobs().addAction(menu, "subscribeToJob")
self.__menuActions.jobs().addAction(menu, "viewComments")

Expand Down
8 changes: 8 additions & 0 deletions cuegui/cuegui/MenuActions.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import cuegui.LocalBooking
import cuegui.Logger
import cuegui.PreviewWidget
import cuegui.RequestCoresDialog
import cuegui.ProcChildren
import cuegui.ServiceDialog
import cuegui.ShowDialog
Expand Down Expand Up @@ -256,6 +257,13 @@ def subscribeToJob(self, rpcObjects=None):
# Dialog to ask for email. Use show PST email as default
cuegui.SubscribeToJobDialog.SubscribeToJobDialog(jobs, self._caller).show()

requestCores_info = ["Request Cores...", None, "mail"]

def requestCores(self, rpcObjects=None):
jobs = self._getOnlyJobObjects(rpcObjects)
if jobs:
cuegui.RequestCoresDialog.RequestCoresDialog(jobs[0], self._caller).show()

setMinCores_info = ["Set Minimum Cores...", "Set Job(s) Minimum Cores", "configure"]

def setMinCores(self, rpcObjects=None):
Expand Down
Loading

0 comments on commit 97ced67

Please sign in to comment.