Feature/#24 deactivate closing comments#170
Conversation
| @@ -1,5 +1,10 @@ | |||
| import { RocketChat, UiTextContext } from 'meteor/rocketchat:lib'; | |||
|
|
|||
| const showClosingComment = function() { | |||
There was a problem hiding this comment.
The function was invoked to determine if the close comment section should be visible or not. I tried a lot to have this function referenced to sweet alert config using inline/shorthand declaration. However, did not work :(.
| section: 'General' | ||
| }); | ||
|
|
||
| RocketChat.settings.add('Assitify_Deactivate_request_closing_comments', false, { |
There was a problem hiding this comment.
I do not want to test my German skill here :). So Please help to translate.
There was a problem hiding this comment.
"Kommentieren beim Schließen von Anfragen verhindern"
mrsimpson
left a comment
There was a problem hiding this comment.
Please check the swal-config creation
| Close_HelpRequest: Close chat | ||
| Close_request_comment: You can add (famous) last words | ||
| Close_request_warning: Please do close the request once you are finished answering the questions asked. This way, we can learn from what you have written. | ||
| Deactivate_close_comment: Allow Request closing comment |
There was a problem hiding this comment.
should this not be the other way round:
Deactivate_close_comment: Don't allow closing comments
| section: 'General' | ||
| }); | ||
|
|
||
| RocketChat.settings.add('Assitify_Deactivate_request_closing_comments', false, { |
There was a problem hiding this comment.
"Kommentieren beim Schließen von Anfragen verhindern"
| title: t('Closing_chat'), | ||
| text: warnText ? t(warnText) : '', | ||
| type: 'input', | ||
| type: showClosingComment(), |
There was a problem hiding this comment.
This is kind-of-a-hack. The swal-configuration could also not contain the input properties. Let me give you a sample
let swalConfig = {
title: t('Closing_chat'),
type: showClosingComment(),
showCancelButton: true,
closeOnConfirm: false
};
if (showClosingComment()) {
swalConfig = _.extend(swalConfig, {
type: 'input',
inputPlaceholder: t('Please_add_a_comment')
});
}
swal(swalConfig, (inputValue) => {
|
The functionality works like expected. |
|
The |
vickyokrm
left a comment
There was a problem hiding this comment.
Updated text translation for DE and Property merging using Object.assign
|
@vickyokrm My apologies, you are correct it was |
|
And Object.assign is not supported by IE. And as we’re on the frontend in this case, we’ll stick to _ . I know why I hate that UI-stuff |
Features Deactivation of Closing comment solution. This closes #24
Thus, Please check if the solution and the code is optimistic.
Solution Overview
Assitify_Deactivate_request_closing_commentsgrouped underAssitifyis created.setting-based-permissionsection with no implications found while testing together.