Multiple minor slash command fixes
Этот коммит содержится в:
@@ -234,7 +234,7 @@ class UserSettingsModal extends React.Component {
|
|||||||
tabs.push({name: 'developer', uiName: formatMessage(holders.developer), icon: 'glyphicon glyphicon-th'});
|
tabs.push({name: 'developer', uiName: formatMessage(holders.developer), icon: 'glyphicon glyphicon-th'});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (global.window.mm_config.EnableIncomingWebhooks === 'true' || global.window.mm_config.EnableOutgoingWebhooks === 'true') {
|
if (global.window.mm_config.EnableIncomingWebhooks === 'true' || global.window.mm_config.EnableOutgoingWebhooks === 'true' || global.window.mm_config.EnableCommands === 'true') {
|
||||||
tabs.push({name: 'integrations', uiName: formatMessage(holders.integrations), icon: 'glyphicon glyphicon-transfer'});
|
tabs.push({name: 'integrations', uiName: formatMessage(holders.integrations), icon: 'glyphicon glyphicon-transfer'});
|
||||||
}
|
}
|
||||||
tabs.push({name: 'display', uiName: formatMessage(holders.display), icon: 'glyphicon glyphicon-eye-open'});
|
tabs.push({name: 'display', uiName: formatMessage(holders.display), icon: 'glyphicon glyphicon-eye-open'});
|
||||||
|
|||||||
@@ -779,13 +779,19 @@ export function getSuggestedCommands(command, suggestionId, component) {
|
|||||||
var matches = [];
|
var matches = [];
|
||||||
data.forEach((cmd) => {
|
data.forEach((cmd) => {
|
||||||
if (('/' + cmd.trigger).indexOf(command) === 0) {
|
if (('/' + cmd.trigger).indexOf(command) === 0) {
|
||||||
|
let s = '/' + cmd.trigger;
|
||||||
|
if (cmd.auto_complete_hint && cmd.auto_complete_hint.length !== 0) {
|
||||||
|
s += ' ' + cmd.auto_complete_hint;
|
||||||
|
}
|
||||||
matches.push({
|
matches.push({
|
||||||
suggestion: '/' + cmd.trigger + ' ' + cmd.auto_complete_hint,
|
suggestion: s,
|
||||||
description: cmd.auto_complete_desc
|
description: cmd.auto_complete_desc
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
matches = matches.sort((a, b) => a.suggestion.localeCompare(b.suggestion));
|
||||||
|
|
||||||
// pull out the suggested commands from the returned data
|
// pull out the suggested commands from the returned data
|
||||||
const terms = matches.map((suggestion) => suggestion.suggestion);
|
const terms = matches.map((suggestion) => suggestion.suggestion);
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user