Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EPMRPP-90325] || Implementation of organization Projects page #3855

Merged
9 changes: 7 additions & 2 deletions app/localization/translated/be.json
Original file line number Diff line number Diff line change
Expand Up @@ -1492,6 +1492,12 @@
"NotificationsEnableForm.toggleNotificationsNote": "Адпраўляць апавяшчэнні па электроннай пошце аб заканчэнні запуску",
"NotificationsEnableForm.typeDescription": "Выберыце {type} спіс атрымальнікаў для кожнага правіла, каб адпраўляць апавяшчэнні аб запуску ",
"NotificationsTab.updateProjectNotificationsConfigurationSuccess": "Налады апавяшчэнняў былі паспяхова абноўлены!",
"OrganizationProjectsPage.allOrganizations": "Усе арганізацыі",
"OrganizationProjectsPage.createProject": "Стварыць праект",
"OrganizationProjectsPage.noProjectsListWithPermission": "Стварыце новы праект, каб пачаць сваё падарожжа ReportPortal",
"OrganizationProjectsPage.noProjectsListWithoutPermission": "Спіс даступных вам праектаў зараз пусты. <br />Звярніцеся да кіраўніка вашай арганізацыі для атрымання падрабязнай інфармацыі.",
"OrganizationProjectsPage.noProjectsWithPermission": "Праектаў пакуль няма",
"OrganizationProjectsPage.noProjectsWithoutPermission": "Праектаў пакуль няма",
"OrganizationsControl.organization": "Арганізацыя",
"OrganizationsItem.open": "адкрыць",
"OrganizationsPopover.allOrganizations": "Усе арганізацыі",
Expand Down Expand Up @@ -1790,15 +1796,14 @@
"ServiceModal.companyNamePlaceholder": "Увядзіце назву кампаніі",
"ServiceModal.consentToProcessing": "Я даю згоду на апрацоўку маёй асабістай інфармацыі кампаніяй EPAM Systems, Inc. (“EPAM”) у адпаведнасці з <a>Палітыкай прыватнасці</a>",
"ServiceModal.emailLabel": "Email",
"ServiceModal.emailPlaceholder": "[email protected]",
"ServiceModal.firstNameLabel": "Імя",
"ServiceModal.firstNamePlaceholder": "Увядзіце сваё імя",
"ServiceModal.lastNameLabel": "Прозвішча",
"ServiceModal.lastNamePlaceholder": "Увядзіце сваё прозвішча",
"ServiceModal.requestSent": "Запыт адпраўлены",
"ServiceModal.requestSentFail": "Запыт не быў адпраўлены",
"ServiceModal.sendRequest": "Адправіць запыт",
"ServiceModal.subscribeToNews": "Падпісвайцеся на навіны ReportPortal",
"ServiceModal.validEmailHint": "Калі ласка, увядзіце сапраўдны адрас электроннай пошты",
"ServiceVersionItem.newVersion": "Даступны новыя версіі: {newVersion}",
"ServiceVersionsBlock.currentVersion": "Бягучая версія",
"ServiceVersionsBlock.deprecatedVersion": "Даступна новая версія",
Expand Down
9 changes: 7 additions & 2 deletions app/localization/translated/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -1492,6 +1492,12 @@
"NotificationsEnableForm.toggleNotificationsNote": "Отправлять уведомления по электронной почте о завершении запуска",
"NotificationsEnableForm.typeDescription": "Выберите список получателей {type} для каждого правила для отправки уведомлений, связанных с запуском.",
"NotificationsTab.updateProjectNotificationsConfigurationSuccess": "Настройки уведомлений были успешно обновлены!",
"OrganizationProjectsPage.allOrganizations": "Все организации",
"OrganizationProjectsPage.createProject": "Создать проект",
"OrganizationProjectsPage.noProjectsListWithPermission": "Создайте новый проект, чтобы начать путешествие по ReportPortal.",
"OrganizationProjectsPage.noProjectsListWithoutPermission": "Список доступных вам проектов на данный момент пуст. <br />За подробностями обращайтесь к менеджеру вашей организации.",
"OrganizationProjectsPage.noProjectsWithPermission": "Пока нет проектов",
"OrganizationProjectsPage.noProjectsWithoutPermission": "Пока нет доступных проектов",
"OrganizationsControl.organization": "Организация",
"OrganizationsItem.open": "открыть",
"OrganizationsPopover.allOrganizations": "Все организации",
Expand Down Expand Up @@ -1790,15 +1796,14 @@
"ServiceModal.companyNamePlaceholder": "Введите название компании",
"ServiceModal.consentToProcessing": "Я даю согласие на обработку моей личной информации компанией EPAM Systems, Inc. («EPAM») в соответствии с <a>Политикой конфиденциальности</a>.",
"ServiceModal.emailLabel": "Email",
"ServiceModal.emailPlaceholder": "[email protected]",
"ServiceModal.firstNameLabel": "Имя",
"ServiceModal.firstNamePlaceholder": "Введите свое имя",
"ServiceModal.lastNameLabel": "Фамилия",
"ServiceModal.lastNamePlaceholder": "Введите свою фамилию",
"ServiceModal.requestSent": "Запрос был отправлен",
"ServiceModal.requestSentFail": "Не удалось отправить запрос",
"ServiceModal.sendRequest": "Послать запрос",
"ServiceModal.subscribeToNews": "Подпишитесь на новости ReportPortal",
"ServiceModal.validEmailHint": "Пожалуйста, введите действительный адрес электронной почты",
"ServiceVersionItem.newVersion": "Доступна новая версия: {newVersion}",
"ServiceVersionsBlock.currentVersion": "Текущая версия",
"ServiceVersionsBlock.deprecatedVersion": "Доступна новая версия",
Expand Down
9 changes: 7 additions & 2 deletions app/localization/translated/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -1492,6 +1492,12 @@
"NotificationsEnableForm.toggleNotificationsNote": "Надсилайте сповіщення електронною поштою про завершення запуску",
"NotificationsEnableForm.typeDescription": "Виберіть {type} список одержувачів для кожного правила, щоб надсилати сповіщення про запуск ",
"NotificationsTab.updateProjectNotificationsConfigurationSuccess": "Налаштування сповіщень були успішно оновлені!",
"OrganizationProjectsPage.allOrganizations": "Всі організації",
"OrganizationProjectsPage.createProject": "Створити проект",
"OrganizationProjectsPage.noProjectsListWithPermission": "Створіть новий проект, щоб почати свою подорож ReportPortal",
"OrganizationProjectsPage.noProjectsListWithoutPermission": "Список доступних вам проектів наразі порожній. <br />Зверніться до менеджера вашої організації для отримання деталей.",
"OrganizationProjectsPage.noProjectsWithPermission": "Проектів ще немає",
"OrganizationProjectsPage.noProjectsWithoutPermission": "Ще немає доступних проектів",
"OrganizationsControl.organization": "Організація",
"OrganizationsItem.open": "відкрити",
"OrganizationsPopover.allOrganizations": "Всі організації",
Expand Down Expand Up @@ -1790,15 +1796,14 @@
"ServiceModal.companyNamePlaceholder": "Введіть назву компанії",
"ServiceModal.consentToProcessing": "Я даю згоду на обробку моєї особистої інформації EPAM Systems, Inc. («EPAM»), як зазначено в <a>Політиці конфіденційності</a>",
"ServiceModal.emailLabel": "Email",
"ServiceModal.emailPlaceholder": "[email protected]",
"ServiceModal.firstNameLabel": "Ім'я",
"ServiceModal.firstNamePlaceholder": "Введіть своє ім'я",
"ServiceModal.lastNameLabel": "Прізвище",
"ServiceModal.lastNamePlaceholder": "Введіть своє прізвище",
"ServiceModal.requestSent": "Запит надіслано",
"ServiceModal.requestSentFail": "Запит не відправлено",
"ServiceModal.sendRequest": "Відправляти запит",
"ServiceModal.subscribeToNews": "Підпишіться на новини ReportPortal",
"ServiceModal.validEmailHint": "Введіть дійсну адресу електронної пошти",
"ServiceVersionItem.newVersion": "Доступна новая версия: {newVersion}",
"ServiceVersionsBlock.currentVersion": "Поточна версія",
"ServiceVersionsBlock.deprecatedVersion": "Доступна нова версія",
Expand Down
9 changes: 7 additions & 2 deletions app/localization/translated/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -1492,6 +1492,12 @@
"NotificationsEnableForm.toggleNotificationsNote": "在启测试任务成时发送电子邮件通知",
"NotificationsEnableForm.typeDescription": "为每个规则选择 {type} 收件人列表以发送启动相关通知",
"NotificationsTab.updateProjectNotificationsConfigurationSuccess": "通知设置已更新!",
"OrganizationProjectsPage.allOrganizations": "所有组织",
"OrganizationProjectsPage.createProject": "创建项目",
"OrganizationProjectsPage.noProjectsListWithPermission": "创建新项目以开始您的 ReportPortal 之旅",
"OrganizationProjectsPage.noProjectsListWithoutPermission": "您可用的项目列表目前为空。<br />请联系您组织的经理了解详情。",
"OrganizationProjectsPage.noProjectsWithPermission": "尚无项目",
"OrganizationProjectsPage.noProjectsWithoutPermission": "尚无可用项目",
"OrganizationsControl.organization": "组织",
"OrganizationsItem.open": "open",
"OrganizationsPopover.allOrganizations": "All organizations",
Expand Down Expand Up @@ -1790,15 +1796,14 @@
"ServiceModal.companyNamePlaceholder": "输入公司名称",
"ServiceModal.consentToProcessing": "我同意 EPAM Systems, Inc.(“EPAM”)按照<a>隐私政策</a>中的规定处理我的个人信息",
"ServiceModal.emailLabel": "Email",
"ServiceModal.emailPlaceholder": "[email protected]",
"ServiceModal.firstNameLabel": "名",
"ServiceModal.firstNamePlaceholder": "输入您的名字",
"ServiceModal.lastNameLabel": "姓",
"ServiceModal.lastNamePlaceholder": "输入您的姓氏",
"ServiceModal.requestSent": "请求已发送",
"ServiceModal.requestSentFail": "请求发送失败",
"ServiceModal.sendRequest": "发送请求",
"ServiceModal.subscribeToNews": "订阅 ReportPortal 新闻",
"ServiceModal.validEmailHint": "请输入有效的电子邮件",
"ServiceVersionItem.newVersion": "新版本可用:{newVersion}",
"ServiceVersionsBlock.currentVersion": "当前版本",
"ServiceVersionsBlock.deprecatedVersion": "有新版本可用。",
Expand Down
3 changes: 3 additions & 0 deletions app/src/common/img/newIcons/filters-outline-inline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions app/src/common/img/newIcons/search-outline-inline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions app/src/common/urls.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,10 @@ export const URLS = {
apiKeys: (userId) => `${urlCommonBase}users/${userId}/api-keys`,
apiKeyById: (userId, apiKeyId) => `${urlCommonBase}users/${userId}/api-keys/${apiKeyId}`,

organizationList: (name) => `${urlBase}organizations${getQueryParams({ name })}`,
organizationById: (organizationId) => `${urlBase}organizations/${organizationId}`,
organizationList: (name) => `${urlCommonBase}organizations${getQueryParams({ name })}`,
organizationById: (organizationId) => `${urlCommonBase}organizations/${organizationId}`,
organizationProjects: (organizationId) =>
`${urlCommonBase}organizations/${organizationId}/projects`,

projectByName: (projectKey) => `${urlBase}project/${projectKey}`,
project: (ids = []) => `${urlBase}project?ids=${ids.join(',')}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,21 @@
overflow: hidden;
font-size: 13px;
font-family: $FONT-REGULAR;
color: $COLOR--e-300;
color: $COLOR--e-400;
text-decoration: none;
user-select: none;
-webkit-user-select: none;
}

.breadcrumb:last-child {
.breadcrumb-text {
color: $COLOR--e-200;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}

.link .breadcrumb-text {
&:hover {
color: $COLOR--topaz-hover-2;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright 2024 EPAM Systems
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { FETCH_ORGANIZATION_PROJECTS } from './constants';

export const fetchOrganizationProjectsAction = (payload) => ({
type: FETCH_ORGANIZATION_PROJECTS,
payload,
});
21 changes: 21 additions & 0 deletions app/src/controllers/organizations/organization/constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright 2024 EPAM Systems
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

export const PROJECTS_NAMESPACE = 'projects';

export const ACTIVE_ORGANIZATION_NAMESPACE = 'activeOrganization';

export const FETCH_ORGANIZATION_PROJECTS = 'fetchOrganizationProjects';
20 changes: 20 additions & 0 deletions app/src/controllers/organizations/organization/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright 2024 EPAM Systems
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

export { fetchOrganizationProjectsAction } from './actionCreators';
export { organizationReducer } from './reducer';
export { organizationProjectsSelector, activeOrganizationSelector } from './selectors';
export { organizationSagas } from './sagas';
27 changes: 27 additions & 0 deletions app/src/controllers/organizations/organization/reducer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright 2024 EPAM Systems
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { combineReducers } from 'redux';
import { fetchReducer } from 'controllers/fetch';
import { ACTIVE_ORGANIZATION_NAMESPACE, PROJECTS_NAMESPACE } from './constants';

export const activeOrganizationReducer = (state, { type = '', payload = {} }) => {
return type === ACTIVE_ORGANIZATION_NAMESPACE ? payload : null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use action here.

};
export const organizationReducer = combineReducers({
projects: fetchReducer(PROJECTS_NAMESPACE, { contentPath: 'content' }),
activeOrganization: activeOrganizationReducer,
});
58 changes: 58 additions & 0 deletions app/src/controllers/organizations/organization/sagas.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Copyright 2024 EPAM Systems
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { takeEvery, all, put, select, take } from 'redux-saga/effects';
import { createFetchPredicate } from 'controllers/fetch';
import { redirect } from 'redux-first-router';
import { PROJECTS_PAGE } from 'controllers/pages';
import { organizationsListSelector } from '../selectors';
import { fetchOrganizationsAction } from '../actionCreators';
import { FETCH_ORGANIZATION_PROJECTS, ACTIVE_ORGANIZATION_NAMESPACE } from './constants';
import { activeOrganizationSelector } from './selectors';
import { NAMESPACE } from '../constants';

function* fetchOrganizationProjects({ payload: { organizationSlug } }) {
yield put(fetchOrganizationsAction());
yield take(createFetchPredicate(NAMESPACE));
const organizations = yield select(organizationsListSelector);
const activeOrganization = yield select(activeOrganizationSelector);
try {
if (!activeOrganization) {
const organization = organizations.find((org) => org.slug === organizationSlug);
if (!organization) {
throw new Error('Organization not found');
}
yield put({ type: ACTIVE_ORGANIZATION_NAMESPACE, payload: organization });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use actionCreator instead.

}

// TODO: Uncomment this line after implementation of the organizationProjects in backend
// yield put(fetchDataAction(PROJECTS_NAMESPACE)(URLS.organizationProjects(orgsSlug)));
} catch (error) {
yield put(
redirect({
type: PROJECTS_PAGE,
}),
);
}
}

function* watchFetchOrganizationProjects() {
yield takeEvery(FETCH_ORGANIZATION_PROJECTS, fetchOrganizationProjects);
}

export function* organizationSagas() {
yield all([watchFetchOrganizationProjects()]);
}
Loading
Loading