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

GPII-4489 Site Config Option to enable/disable capture tool. #210

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sgithens
Copy link
Member

Adding optional menu item generation to be able to selectively include Capture Tool

@gpii-bot
Copy link

CI job passed: https://ci.gpii.net/job/gpii-app-tests/1194/

* @param {String} label - The label of the item.
* @param {String} event - The event to be triggered on click.
* @param {Object} [payload] - The payload that is to be supplied with the on click event.
* @return {ElectronMenuItem} A simple selectable Electron menu item.
Copy link
Member

Choose a reason for hiding this comment

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

Declare that the return is optional - e.g. {ElectronMenuItem|Undefined}

* @return {ElectronMenuItem} A simple selectable Electron menu item.
*/
gpii.app.menu.getOptionalMenuItem = function (hideItem, label, event, payload) {
if (hideItem) {
Copy link
Member

Choose a reason for hiding this comment

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

I'm not a religious fanatic, but single (and explicit) return-ism is slightly preferable - how about

return hideItem ? undefined : {
            label: label,
            click: event,
            args: payload || {}
        };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants