|
@@ -57,6 +57,21 @@ const PermissionSettingForEachCommandComponent = ({
|
|
|
if (editingCommandPermission == null) {
|
|
if (editingCommandPermission == null) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ function permissionTypeClickHandler(e) {
|
|
|
|
|
+ if (onPermissionTypeClicked == null) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ onPermissionTypeClicked(e);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ function onPermissionListChangeHandler(e) {
|
|
|
|
|
+ if (onPermissionListChanged == null) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ onPermissionListChanged(e);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
const permission = editingCommandPermission[commandName];
|
|
const permission = editingCommandPermission[commandName];
|
|
|
const hiddenClass = Array.isArray(permission) ? '' : 'd-none';
|
|
const hiddenClass = Array.isArray(permission) ? '' : 'd-none';
|
|
|
const textareaDefaultValue = Array.isArray(permission) ? permission.join(',') : '';
|
|
const textareaDefaultValue = Array.isArray(permission) ? permission.join(',') : '';
|
|
@@ -87,7 +102,7 @@ const PermissionSettingForEachCommandComponent = ({
|
|
|
type="button"
|
|
type="button"
|
|
|
name={commandName}
|
|
name={commandName}
|
|
|
value={PermissionTypes.ALLOW_ALL}
|
|
value={PermissionTypes.ALLOW_ALL}
|
|
|
- onClick={onPermissionTypeClicked}
|
|
|
|
|
|
|
+ onClick={e => permissionTypeClickHandler(e)}
|
|
|
>
|
|
>
|
|
|
{t('admin:slack_integration.accordion.allow_all_long')}
|
|
{t('admin:slack_integration.accordion.allow_all_long')}
|
|
|
</button>
|
|
</button>
|
|
@@ -96,7 +111,7 @@ const PermissionSettingForEachCommandComponent = ({
|
|
|
type="button"
|
|
type="button"
|
|
|
name={commandName}
|
|
name={commandName}
|
|
|
value={PermissionTypes.DENY_ALL}
|
|
value={PermissionTypes.DENY_ALL}
|
|
|
- onClick={onPermissionTypeClicked}
|
|
|
|
|
|
|
+ onClick={e => permissionTypeClickHandler(e)}
|
|
|
>
|
|
>
|
|
|
{t('admin:slack_integration.accordion.deny_all_long')}
|
|
{t('admin:slack_integration.accordion.deny_all_long')}
|
|
|
</button>
|
|
</button>
|
|
@@ -105,7 +120,7 @@ const PermissionSettingForEachCommandComponent = ({
|
|
|
type="button"
|
|
type="button"
|
|
|
name={commandName}
|
|
name={commandName}
|
|
|
value={PermissionTypes.ALLOW_SPECIFIED}
|
|
value={PermissionTypes.ALLOW_SPECIFIED}
|
|
|
- onClick={onPermissionTypeClicked}
|
|
|
|
|
|
|
+ onClick={e => permissionTypeClickHandler(e)}
|
|
|
>
|
|
>
|
|
|
{t('admin:slack_integration.accordion.allow_specified_long')}
|
|
{t('admin:slack_integration.accordion.allow_specified_long')}
|
|
|
</button>
|
|
</button>
|
|
@@ -118,7 +133,7 @@ const PermissionSettingForEachCommandComponent = ({
|
|
|
type="textarea"
|
|
type="textarea"
|
|
|
name={commandName}
|
|
name={commandName}
|
|
|
value={textareaDefaultValue}
|
|
value={textareaDefaultValue}
|
|
|
- onChange={onPermissionListChanged}
|
|
|
|
|
|
|
+ onChange={e => onPermissionListChangeHandler(e)}
|
|
|
/>
|
|
/>
|
|
|
<p className="form-text text-muted small">
|
|
<p className="form-text text-muted small">
|
|
|
{t('admin:slack_integration.accordion.allowed_channels_description', { commandName })}
|
|
{t('admin:slack_integration.accordion.allowed_channels_description', { commandName })}
|