Skip to content

Commit

Permalink
fix adding role without template
Browse files Browse the repository at this point in the history
when no template is selected the templatename field should be empty as
well in the newly added line
  • Loading branch information
mawinter69 committed Jul 22, 2023
1 parent 31d51ec commit 7397aaa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

<template id="newItemRoleTemplate">
<tr class="permission-row highlight-row">
<local:roleRow title="{{ROLE}}" global="${false}" pattern="{{PATTERN}}" type="${it.strategy.PROJECT}" templateName="{{TEMPLATENAME}}"
<local:roleRow title="{{ROLE}}" global="${false}" pattern="{{PATTERN}}" type="${it.strategy.PROJECT}" templateName=""
showRoleName="${true}" showPattern="${true}" showTemplate="${true}"
/>
</tr>
Expand All @@ -73,7 +73,7 @@
</f:entry>
<f:entry>
<rs:dropdownList title="Permission Template" name="template" id="${tableid}template">
<f:dropdownListBlock title="None" selected="true" value="__none__">
<f:dropdownListBlock title="None" selected="true" value="">
</f:dropdownListBlock>
<j:forEach var="permissionTemplate" items="${it.strategy.getPermissionTemplates()}">
<f:dropdownListBlock title="${permissionTemplate.getName()}" selected="false" value="${permissionTemplate.getName()}">
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/js/tableManage.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ addButtonAction = function(e, templateId, table, tableHighlighter, tableId) {
if (tableId === "projectRoles") {
let templateSelect = document.getElementById(tableId + 'template');
let templateName = templateSelect.value;
if (templateName !== '__none__') {
if (templateName !== '') {
template = window[templateId + "-" + templateName].content.firstElementChild.cloneNode(true);
}
}
Expand Down

0 comments on commit 7397aaa

Please sign in to comment.