- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2023 05:14 PM
Hello,
I am trying to enable Edit button when the article is in 'Scheduled for Publish' state.
Followed the UI Page and macros, but getting lost where 'isEditable' or showUpdateAction is set.
UI Macro:
kb_view_common_header_toolbar ->
<button role="link" id="editArticle" style="margin-left:0.4em;" title="${gs.getMessage('Edit content')}" aria-label="${gs.getMessage('Edit content')}" class="btn btn-default navbar-btn snc-article-header-toolbar-button pull-right">${gs.getMessage("Edit")}</button>
this leads to 'kb_view_common' -->
var showUpdateAction = !jelly.sysparm_no_update && isEditable;
I tried other solutions in the community to modify 'KBCommon' to override 'canContribute', but did not work.
I think 'Edit' button is enabled currently for Draft state, thought I will extend it for other states.
Can someone please suggest on this?
Regards,
Viji
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2023 07:22 PM
overriding the function 'canWrite' in 'KBVersioning' script solved the issue. Providing the details here in case it is helpful to someone.
case 'scheduled_publish':
return false ; // OOTB - Modify the condition here to enable Edit button for this state.
return (this.isOwnerOrAdmin(current) || (this._isReviser(current)
&& this.safeExecute(this._knowledgeHelper.canContribute, current))
|| this.isMemberOfValidGroup(current,this.OWNERSHIP_GROUP));
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2023 07:22 PM
overriding the function 'canWrite' in 'KBVersioning' script solved the issue. Providing the details here in case it is helpful to someone.
case 'scheduled_publish':
return false ; // OOTB - Modify the condition here to enable Edit button for this state.
return (this.isOwnerOrAdmin(current) || (this._isReviser(current)
&& this.safeExecute(this._knowledgeHelper.canContribute, current))
|| this.isMemberOfValidGroup(current,this.OWNERSHIP_GROUP));