Skip to content

Commit

Permalink
EPMRPP-86302 || Create Global integration modal. New design support (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
AmsterGet authored Oct 31, 2023
1 parent d8bdbac commit 13121f8
Show file tree
Hide file tree
Showing 22 changed files with 126 additions and 316 deletions.
3 changes: 1 addition & 2 deletions app/localization/translated/be.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"AddFilter.filterName": "Назва Фільтра",
"AddFilter.placeholderFilterName": "Увядзіце назву фільтра",
"AddIntegrationModal.createGlobalTitle": "Стварыць глабальную інтэграцыю",
"AddIntegrationModal.createManualTitle": "Стварыць інтэграцыю ўручную",
"AddIntegrationModal.createProjectTitle": "Стварыць праектную інтэграцыю",
"AddIntegrationModal.editAuthTitle": "Змяніць аўтарызацыю",
"AddNewCaseButton.addNewRuleButton": "Дадаць новае правіла",
"AddUserForm.addUserTitle": "Дадаць карыстальніка",
Expand Down Expand Up @@ -1044,7 +1044,6 @@
"IntegrationsCase.noIntegrationsDescription": "У вашым праекце яшчэ няма інтэграцый",
"IntegrationsCase.noIntegrationsMessage": "Ніякіх інтэграцый",
"IntegrationsDescription.ConnectionErrorMessage": "Памылка злучэння",
"IntegrationsDescription.GlobalIntegrationsSystemMessage": "Папярэджанне",
"IntegrationsDescription.GlobalIntegrationsSystemMessageModalCaption": "Глабальная і праектная інтэграцыі не могуць працаваць адначасова.",
"IntegrationsDescription.GlobalIntegrationsSystemMessageModalText": "Звярніце ўвагу, што глабальныя інтэграцыі будуць адключаныя, калі вы створыце інтэграцыю праекту!",
"IntegrationsDescription.GlobalIntegrationsSystemMessageText": "Глабальныя інтэграцыі неактыўныя, паколькі вы наладзілі інтэграцыю праекту.",
Expand Down
3 changes: 1 addition & 2 deletions app/localization/translated/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"AddFilter.filterName": "Имя фильтра",
"AddFilter.placeholderFilterName": "Ввести имя фильтра",
"AddIntegrationModal.createGlobalTitle": "Создать глобальную интеграцию",
"AddIntegrationModal.createManualTitle": "Создать интеграцию вручную",
"AddIntegrationModal.createProjectTitle": "Создать проектную интеграцию",
"AddIntegrationModal.editAuthTitle": "Изменить авторизацию",
"AddNewCaseButton.addNewRuleButton": "Добавить новое правило",
"AddUserForm.addUserTitle": "Добавить пользователя",
Expand Down Expand Up @@ -1041,7 +1041,6 @@
"IntegrationsCase.noIntegrationsDescription": "В вашем проекте еще нет интеграций",
"IntegrationsCase.noIntegrationsMessage": "Нет интеграций",
"IntegrationsDescription.ConnectionErrorMessage": "Ошибка соединения",
"IntegrationsDescription.GlobalIntegrationsSystemMessage": "Предупреждение",
"IntegrationsDescription.GlobalIntegrationsSystemMessageModalCaption": "Глобальная и проектная интеграции не могут работать одновременно.",
"IntegrationsDescription.GlobalIntegrationsSystemMessageModalText": "Обратите внимание, что глобальные интеграции будут отключены, если вы создадите интеграцию проекта!",
"IntegrationsDescription.GlobalIntegrationsSystemMessageText": "Глобальные интеграции неактивны, поскольку вы настроили интеграцию проекта.",
Expand Down
3 changes: 1 addition & 2 deletions app/localization/translated/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"AddFilter.filterName": "Ім’я фільтру",
"AddFilter.placeholderFilterName": "Ввести ім’я фільтру",
"AddIntegrationModal.createGlobalTitle": "Створити глобальну інтеграцію",
"AddIntegrationModal.createManualTitle": "Створити інтеграцію вручну",
"AddIntegrationModal.createProjectTitle": "Створити проектну інтеграцію",
"AddIntegrationModal.editAuthTitle": "Змінити авторизацію",
"AddNewCaseButton.addNewRuleButton": "Додати нове правило",
"AddUserForm.addUserTitle": "Додати користувача",
Expand Down Expand Up @@ -1042,7 +1042,6 @@
"IntegrationsCase.noIntegrationsDescription": "Ваш проект ще не має інтеграцій",
"IntegrationsCase.noIntegrationsMessage": "Ніяких інтеграцій",
"IntegrationsDescription.ConnectionErrorMessage": "Помилка з'єднання",
"IntegrationsDescription.GlobalIntegrationsSystemMessage": "Попередження",
"IntegrationsDescription.GlobalIntegrationsSystemMessageModalCaption": "Глобальна та проектна інтеграції не можуть працювати одночасно.",
"IntegrationsDescription.GlobalIntegrationsSystemMessageModalText": "Зверніть увагу, що глобальні інтеграції буде відключено, якщо ви створите інтеграцію проекту!",
"IntegrationsDescription.GlobalIntegrationsSystemMessageText": "Глобальні інтеграції є неактивними, оскільки ви налаштували інтеграцію проекту.",
Expand Down
3 changes: 1 addition & 2 deletions app/localization/translated/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"AddFilter.filterName": "过滤器名称",
"AddFilter.placeholderFilterName": "请输入过滤器名称",
"AddIntegrationModal.createGlobalTitle": "创建全局集成",
"AddIntegrationModal.createManualTitle": "创建手动集成",
"AddIntegrationModal.createProjectTitle": "Create Project Integration",
"AddIntegrationModal.editAuthTitle": "编辑授权",
"AddNewCaseButton.addNewRuleButton": "创建规则",
"AddUserForm.addUserTitle": "添加用户",
Expand Down Expand Up @@ -1037,7 +1037,6 @@
"IntegrationsCase.noIntegrationsDescription": "您的项目还没有任何集成",
"IntegrationsCase.noIntegrationsMessage": "无集成",
"IntegrationsDescription.ConnectionErrorMessage": "连接错误",
"IntegrationsDescription.GlobalIntegrationsSystemMessage": "警告",
"IntegrationsDescription.GlobalIntegrationsSystemMessageModalCaption": "全局集成和项目集成不能同时工作。",
"IntegrationsDescription.GlobalIntegrationsSystemMessageModalText": "请注意!如果您创建了项目集成,全局集成将被取消关联!",
"IntegrationsDescription.GlobalIntegrationsSystemMessageText": "由于您已配置项目集成,全局集成将不会生效",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export class InstancesSection extends Component {
data.name,
);

addProjectIntegration = (formData, metaData) => {
createIntegration = (formData, metaData) => {
const { isGlobal, instanceType } = this.props;
const data = {
enabled: true,
Expand Down Expand Up @@ -253,35 +253,34 @@ export class InstancesSection extends Component {
});
};

showAddProjectIntegrationModal = () => {
const { instanceType, pluginDetails, isGlobal, events } = this.props;
showAddIntegrationModal = () => {
const { instanceType, pluginDetails, isGlobal } = this.props;

this.props.showModalAction({
id: 'addIntegrationModal',
data: {
onConfirm: this.addProjectIntegration,
onConfirm: this.createIntegration,
instanceType,
isGlobal,
eventsInfo: events.saveIntegrationModalEvents(instanceType, isGlobal),
customProps: {
pluginDetails,
},
},
});
};

addProjectIntegrationClickHandler = () => {
addIntegrationClickHandler = () => {
const { instanceType, tracking, events } = this.props;

tracking.trackEvent(events.integrationAddClickEvent(instanceType));
this.showAddProjectIntegrationModal();
this.showAddIntegrationModal();
};

unlinkAndSetupManuallyClickHandler = () => {
const { instanceType, tracking } = this.props;

tracking.trackEvent(getIntegrationUnlinkGlobalEvent(instanceType));
this.showAddProjectIntegrationModal();
this.showAddIntegrationModal();
};

render() {
Expand Down Expand Up @@ -322,7 +321,7 @@ export class InstancesSection extends Component {
/>
{this.multiple && !disabled && (
<div className={cx('add-integration-button')}>
<GhostButton icon={PlusIcon} onClick={this.addProjectIntegrationClickHandler}>
<GhostButton icon={PlusIcon} onClick={this.addIntegrationClickHandler}>
{formatMessage(messages.addIntegrationButtonTitle)}
</GhostButton>
</div>
Expand Down Expand Up @@ -356,7 +355,7 @@ export class InstancesSection extends Component {
)}
{(this.multiple || !globalIntegrations.length) && !disabled && isGlobal && (
<div className={cx('add-integration-button')}>
<GhostButton icon={PlusIcon} onClick={this.addProjectIntegrationClickHandler}>
<GhostButton icon={PlusIcon} onClick={this.addIntegrationClickHandler}>
{formatMessage(messages.addIntegrationButtonTitle)}
</GhostButton>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export class ConnectionSection extends Component {
);

this.props.showModalAction({
id: 'deleteProjectIntegrationModal',
id: 'deleteIntegrationModal',
data: {
onConfirm: this.props.onRemoveIntegration,
modalTitle: `${formatMessage(COMMON_LOCALE_KEYS.DELETE)} ${data.name}`,
Expand Down
3 changes: 2 additions & 1 deletion app/src/components/integrations/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019 EPAM Systems
* Copyright 2023 EPAM Systems
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,3 +17,4 @@
export { PLUGIN_IMAGES_MAP, PLUGIN_NAME_TITLES, PLUGIN_DEFAULT_IMAGE } from './constants';
export { INTEGRATIONS_SETTINGS_COMPONENTS_MAP } from './settingsComponentsMap';
export { AddIntegrationModal } from './modals/addIntegrationModal';
export { DeleteIntegrationModal } from './modals/deleteIntegrationModal';
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,14 @@ export const JiraSettings = (props) => {
const editAuthorizationClickHandler = (testConnection) => {
const {
data: { name, integrationParameters, integrationType },
isGlobal,
} = props;

dispatch(
showModalAction({
id: 'createProjectIntegrationModal',
id: 'addIntegrationModal',
data: {
modalTitle: formatMessage(messages.editAuthTitle),
isGlobal,
onConfirm: getConfirmationFunc(testConnection),
instanceType: integrationType.name,
customProps: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,4 @@ export const messages = defineMessages({
id: 'JiraConnectionFormFields.authorizedByTitle',
defaultMessage: 'Authorized by username',
},
editAuthTitle: {
id: 'AddIntegrationModal.editAuthTitle',
defaultMessage: 'Edit authorization',
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,4 @@ export const messages = defineMessages({
id: 'RallyConnectionFormFields.accessKeyLabel',
defaultMessage: 'AccessKey',
},
editAuthTitle: {
id: 'AddIntegrationModal.editAuthTitle',
defaultMessage: 'Edit authorization',
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,14 @@ export const RallySettings = (props) => {
const editAuthorizationClickHandler = (testConnection) => {
const {
data: { name, integrationParameters, integrationType },
isGlobal,
} = props;

dispatch(
showModalAction({
id: 'createProjectIntegrationModal',
id: 'addIntegrationModal',
data: {
modalTitle: formatMessage(messages.editAuthTitle),
isGlobal,
onConfirm: getConfirmationFunc(testConnection),
instanceType: integrationType.name,
customProps: {
Expand Down
Loading

0 comments on commit 13121f8

Please sign in to comment.