[MM-52271] Add recommended tag to Work Template integrations (#23016)
Этот коммит содержится в:
@@ -117,7 +117,7 @@ const Preview = ({template, className, pluginsEnabled}: PreviewProps) => {
|
||||
if (c.playbook) {
|
||||
playbooks.push(c.playbook);
|
||||
}
|
||||
if (c.integration) {
|
||||
if (c.integration && c.integration.recommended) {
|
||||
availableIntegrations.push(c.integration);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -232,7 +232,12 @@ const WorkTemplateModal = () => {
|
||||
|
||||
const execute = async (template: WorkTemplate, name = '', visibility: Visibility) => {
|
||||
const pbTemplates = [];
|
||||
for (const item of template.content) {
|
||||
for (const ctt in template.content) {
|
||||
if (!Object.hasOwn(template.content, ctt)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const item = template.content[ctt];
|
||||
if (item.playbook) {
|
||||
const pbTemplate = playbookTemplates.find((pb) => pb.title === item.playbook.template);
|
||||
if (pbTemplate) {
|
||||
@@ -241,11 +246,20 @@ const WorkTemplateModal = () => {
|
||||
}
|
||||
}
|
||||
|
||||
// remove non recommended integrations
|
||||
const filteredTemplate = {...template};
|
||||
filteredTemplate.content = template.content.filter((item) => {
|
||||
if (!item.integration) {
|
||||
return true;
|
||||
}
|
||||
return item.integration.recommended;
|
||||
});
|
||||
|
||||
const req: ExecuteWorkTemplateRequest = {
|
||||
team_id: teamId,
|
||||
name,
|
||||
visibility,
|
||||
work_template: template,
|
||||
work_template: filteredTemplate,
|
||||
playbook_templates: pbTemplates,
|
||||
};
|
||||
|
||||
|
||||
@@ -64,6 +64,7 @@ export interface Playbook {
|
||||
}
|
||||
export interface Integration {
|
||||
id: string;
|
||||
recommended: boolean;
|
||||
name?: string;
|
||||
icon?: string;
|
||||
installed?: boolean;
|
||||
|
||||
Ссылка в новой задаче
Block a user