Skip to content

Commit

Permalink
EPMRPP-95096 || Improve project assignment for Manager and Admin (#4035)
Browse files Browse the repository at this point in the history
* EPMRPP-95096 || Improve project assignment for Manager and Admin

* EPMRPP-95096 || fix border style

* EPMRPP-95096 || Code Review fix - 1
  • Loading branch information
BlazarQSO authored and maria-hambardzumian committed Oct 15, 2024
1 parent 5a9c18c commit 52942a7
Show file tree
Hide file tree
Showing 16 changed files with 139 additions and 63 deletions.
3 changes: 3 additions & 0 deletions app/localization/translated/be.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@
"Common.friday": "Пятніца",
"Common.generate": "Генераваць",
"Common.invite": "Запрасіць",
"Common.inviteAndAssign": "Запрасіць і прызначыць",
"Common.january": "Студзень",
"Common.july": "Ліпень",
"Common.june": "Чэрвень",
Expand Down Expand Up @@ -1073,9 +1074,11 @@
"InviteUserModal.description": "Калі ласка, звярніце ўвагу, што новыя карыстальнікі далучацца да арганізацыі з роляй “Удзельнік”, а існуючыя карыстальнікі захаваюць сваю бягучую арганізацыйную ролю.",
"InviteUserModal.emailLabel": "Электронная пошта",
"InviteUserModal.canEditProject": "Можна рэдагаваць праект",
"InviteUserModal.canEditTooltip": "Абраны карыстальнік мае ролю мэнэджэра ў арганізацыі і па змаўчанні будзе мець права ‘Mожа рэдагаваць’ у праекце",
"InviteUserModal.headerInviteUserModal": "Запрасіць карыстальніка ў",
"InviteUserModal.hintMessage": "Па змаўчанні запрошаныя карыстальнікі атрымліваюць правы 'Толькі прагляд'. Карыстальнікі з правамі 'Mожа рэдагаваць' могуць змяняць праект і ўсе яго дадзеныя (ствараць справаздачы аб запусках, змяняць тыпы дэфектаў і г.д.).",
"InviteUserModal.inputPlaceholder": "Увядзіце поўнае імя або адрас электроннай пошты (напр. example@mail.com)",
"InviteUserModal.inviteAdmin": "Майце на ўвазе, што абраны карыстальнік, як адміністратар, мае поўны доступ да ўсіх арганізацыям і праектах у рамках асобніка, незалежна ад названай ролі і дазволаў.",
"InviteUserModal.inviteExternalMember": "Запрашэнне ўдзельніка было паспяхова зарэгістравана. Якая пацвярджае інфармацыя будзе адпраўлена на прадстаўлены электронны адрас. Тэрмін дзеяння: 1 дзень.",
"InviteUserModal.nameOrEmailLabel": "Імя або адрас электроннай пошты",
"InviteUserModal.memberWasInvited": "Удзельнік '<b>{name}</b>' прызначаны на праект",
Expand Down
3 changes: 3 additions & 0 deletions app/localization/translated/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@
"Common.friday": "Viernes",
"Common.generate": "Generar",
"Common.invite": "Invitar",
"Common.inviteAndAssign": "Invite & assign",
"Common.january": "Enero",
"Common.july": "Julio",
"Common.june": "Junio",
Expand Down Expand Up @@ -1071,10 +1072,12 @@
"InvestigatedPercentageOfLaunchesControls.ItemsValidationError": "El número de elementos debe estar entre '1' y '600'",
"InviteUserModal.description": "Please note, users new to the organization will join it with “Member” role, whereas existing users will maintain their current organizational role.",
"InviteUserModal.canEditProject": "Can edit the Project",
"InviteUserModal.canEditTooltip": "The selected user has the Manager role in organization and will have ‘Can edit’ permissions in the project by default",
"InviteUserModal.emailLabel": "Correo electrónico",
"InviteUserModal.headerInviteUserModal": "Invite user to",
"InviteUserModal.hintMessage": "By default, invited users receive 'View only' permissions. Users with 'Can edit' permissions can modify the project and all its data (report launches, change defect types, etc.).",
"InviteUserModal.inputPlaceholder": "Enter full name or email (e.g. example@mail.com)",
"InviteUserModal.inviteAdmin": "Be aware that the selected user, as an Admin, has full access to all organizations and projects within the instance, regardless of specified role and permissions.",
"InviteUserModal.inviteExternalMember": "La invitación del miembro se ha registrado correctamente. La información de confirmación será enviada a la dirección de correo electrónico proporcionada. Validez: 1 día.",
"InviteUserModal.nameOrEmailLabel": "Name or email",
"InviteUserModal.memberWasInvited": "El miembro '<b>{name}</b>' ha sido asignado al proyecto",
Expand Down
3 changes: 3 additions & 0 deletions app/localization/translated/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@
"Common.friday": "Пятница",
"Common.generate": "Сгенерировать",
"Common.invite": "Пригласить",
"Common.inviteAndAssign": "Пригласить и назначить",
"Common.january": "Январь",
"Common.july": "Июль",
"Common.june": "Июнь",
Expand Down Expand Up @@ -1072,10 +1073,12 @@
"InvestigatedPercentageOfLaunchesControls.ItemsValidationError": "Количество элементов принимает значения от '1' до '600'",
"InviteUserModal.description": "Пожалуйста, обратите внимание, что новые пользователи присоединятся к организации с ролью “Участник”, в то время как существующие пользователи сохранят свою текущую организационную роль.",
"InviteUserModal.canEditProject": "Может редактировать проект",
"InviteUserModal.canEditTooltip": "Выбранный пользователь имеет роль менеджера в организации и по умолчанию будет иметь права ‘Может редактировать’ в проекте",
"InviteUserModal.emailLabel": "Электронная почта",
"InviteUserModal.headerInviteUserModal": "Пригласить пользователя в",
"InviteUserModal.hintMessage": "По умолчанию приглашенные пользователи получают права 'Только просмотр'. Пользователи с правами 'Может редактировать' могут изменять проект и все его данные (создавать отчеты о запусках, изменять типы дефектов и т.д.).",
"InviteUserModal.inputPlaceholder": "Введите полное имя или адрес электронной почты (напр. example@mail.com)",
"InviteUserModal.inviteAdmin": "Имейте в виду, что выбранный пользователь, как администратор, имеет полный доступ ко всем организациям и проектам в рамках экземпляра, независимо от указанной роли и разрешений.",
"InviteUserModal.inviteExternalMember": "Приглашение участника было успешно зарегистрировано. Подтверждающая информация будет отправлена на предоставленный электронный адрес. Срок действия: 1 день.",
"InviteUserModal.nameOrEmailLabel": "Имя или адрес электронной почты",
"InviteUserModal.memberWasInvited": "Участник '<b>{name}</b>' назначен на проект",
Expand Down
3 changes: 3 additions & 0 deletions app/localization/translated/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@
"Common.friday": "П’ятниця",
"Common.generate": "Генерувати",
"Common.invite": "Запросити",
"Common.inviteAndAssign": "Запросити і призначити",
"Common.january": "Січень",
"Common.july": "Липень",
"Common.june": "Червень",
Expand Down Expand Up @@ -1072,10 +1073,12 @@
"InvestigatedPercentageOfLaunchesControls.ItemsValidationError": "Кількість елементів приймає значення від '1' до '600'",
"InviteUserModal.description": "Будь ласка, зверніть увагу, що нові користувачі приєднаються до організації з роллю “Учасник”, в той час як існуючі користувачі збережуть свою поточну організаційну роль.",
"InviteUserModal.canEditProject": "Можна редагувати проект",
"InviteUserModal.canEditTooltip": "Обраний користувач має роль менеджера в організації і за замовчуванням матиме права ‘Може редагувати’ в проекті",
"InviteUserModal.emailLabel": "Адреса електронної пошти",
"InviteUserModal.headerInviteUserModal": "Запросити користувача в",
"InviteUserModal.hintMessage": "За замовчуванням запрошені користувачі отримують права 'Тільки перегляд'. Користувачі з правами 'Може редагувати' можуть змінювати проект і всі його дані (створювати звіти про запуски, змінювати типи дефектів і т.д.).",
"InviteUserModal.inputPlaceholder": "Введіть повне ім'я або адресу електронної пошти (напр. example@mail.com)",
"InviteUserModal.inviteAdmin": "Майте на увазі, що обраний Користувач, як адміністратор, має повний доступ до всіх організацій і проектів в рамках екземпляра, незалежно від зазначеної ролі і дозволів.",
"InviteUserModal.inviteExternalMember": "Запрошення учасника було успішно зареєстровано. Підтверджуюча інформація буде відправлена на наданий електронну адресу. Термін дії: 1 день.",
"InviteUserModal.nameOrEmailLabel": "Ім'я або адреса електронної пошти",
"InviteUserModal.memberWasInvited": "Участник '<b>{name}</b>' назначен на проект",
Expand Down
3 changes: 3 additions & 0 deletions app/localization/translated/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@
"Common.friday": "星期五",
"Common.generate": "Generate",
"Common.invite": "邀请",
"Common.inviteAndAssign": "Invite & assign",
"Common.january": "一月",
"Common.july": "七月",
"Common.june": "六月",
Expand Down Expand Up @@ -1072,10 +1073,12 @@
"InvestigatedPercentageOfLaunchesControls.ItemsValidationError": "测试项的数量应为1到600个",
"InviteUserModal.description": "Please note, users new to the organization will join it with “Member” role, whereas existing users will maintain their current organizational role.",
"InviteUserModal.canEditProject": "Can edit the Project",
"InviteUserModal.canEditTooltip": "The selected user has the Manager role in organization and will have ‘Can edit’ permissions in the project by default",
"InviteUserModal.emailLabel": "邮箱",
"InviteUserModal.headerInviteUserModal": "Invite user to",
"InviteUserModal.hintMessage": "By default, invited users receive 'View only' permissions. Users with 'Can edit' permissions can modify the project and all its data (report launches, change defect types, etc.).",
"InviteUserModal.inputPlaceholder": "Enter full name or email (e.g. example@mail.com)",
"InviteUserModal.inviteAdmin": "Be aware that the selected user, as an Admin, has full access to all organizations and projects within the instance, regardless of specified role and permissions.",
"InviteUserModal.inviteExternalMember": "会员邀请已登记。确认信息将通过提供的电子邮件发送。有效期:1天。",
"InviteUserModal.nameOrEmailLabel": "Name or email",
"InviteUserModal.memberWasInvited": "成员“<b>{name}</b>”已分配至此项目",
Expand Down
4 changes: 4 additions & 0 deletions app/src/common/constants/localization.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ export const COMMON_LOCALE_KEYS = defineMessages({
id: 'Common.invite',
defaultMessage: 'Invite',
},
INVITE_AND_ASSIGN: {
id: 'Common.inviteAndAssign',
defaultMessage: 'Invite & assign',
},
OK: {
id: 'Common.ok',
defaultMessage: 'Ok',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

import React, { Component } from 'react';
import Downshift from 'downshift';
import Parser from 'html-react-parser';
import CrossIcon from 'common/img/cross-icon-inline.svg';
import { ClearIcon } from '@reportportal/ui-kit';
import PropTypes from 'prop-types';
import classNames from 'classnames/bind';
import { Manager, Reference, Popper } from 'react-popper';
Expand Down Expand Up @@ -161,7 +160,9 @@ export class SingleAutocomplete extends Component {
className={cx('input-control-btn', { 'mobile-disabled': mobileDisabled })}
onClick={clearSelection}
>
<i className={cx('cross-icon')}>{Parser(CrossIcon)}</i>
<i className={cx('clear-icon')}>
<ClearIcon />
</i>
</button>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
top: 0;
right: 0;
cursor: pointer;
width: 25px;
width: 32px;
display: flex;
flex-direction: column;
height: 100%;
height: 36px;
justify-content: center;
align-items: center;
outline: 0;
Expand All @@ -35,21 +35,22 @@
}
}

.cross-icon {
.clear-icon {
display: inline-block;
position: relative;
box-sizing: border-box;
margin: auto;
width: 12px;
height: 12px;
width: 16px;
height: 16px;
}

.input {
position: relative;
display: inline-block;
height: 30px;
border-radius: 3px;
height: 36px;
width: 100%;
padding: 6px 22px 6px 10px;
padding: 10px 22px 10px 10px;
margin: 0;
box-sizing: border-box;
outline: none;
Expand All @@ -58,7 +59,7 @@
font-family: $FONT-REGULAR;
font-size: 13px;
line-height: 13px;
color: $COLOR--charcoal-grey;
color: $COLOR--almost-black;
box-shadow: none;
flex-grow: 1;
transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
Expand All @@ -68,13 +69,11 @@
}
&:focus {
background-color: inherit;
border-color: $COLOR--topaz;
box-shadow: 0 0 2px 0 rgba($COLOR--topaz, 0.7);
border: 2px solid $COLOR--topaz-focused;
}

&.error.touched {
border-color: $COLOR--orange-red;
box-shadow: 0 0 2px 0 rgba($COLOR--orange-red, 0.7);
border: 1px solid $COLOR--red-failed-2;
}
&.disabled {
background-color: $COLOR--gray-91;
Expand Down
2 changes: 2 additions & 0 deletions app/src/components/inputs/inputUserSearch/inputUserSearch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ export const makeOptions = (isAdmin, projectKey, projectSlug) => ({ content: opt
isAssigned: isAdmin ? !!option.assignedProjects[projectSlug] : false,
userAvatar: URLS.dataUserPhoto(projectKey, isAdmin ? option.userId : option.login, true),
assignedProjects: option.assignedProjects || {},
assignedOrganizations: option.assignedOrganizations || {},
userRole: option.userRole,
}));

const parseValueToString = (option) => (option ? option.userLogin : '');
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ export const InviteNewUserItem = ({ option, itemProps }) => (
<div className={cx('invite-new-user', { active: itemProps.isActive })}>
<div className={cx('msg-icon')} />
<div className={cx('invite-info')}>
<p className={cx('user-info')}>
<p className={cx('action-info')}>
<FormattedMessage
id={'InputUserSearch.inviteNewUser'}
defaultMessage={'Invite {userEmail}'}
values={{ userEmail: option.userLogin }}
id={'InputUserSearch.inviteNewUserInfo'}
defaultMessage={'Send new invite via email'}
/>
</p>
<p className={cx('action-info')}>
<p className={cx('user-info')}>
<FormattedMessage
id={'InputUserSearch.inviteNewUserInfo'}
defaultMessage={'Send invite via e-mail'}
id={'InputUserSearch.inviteNewUser'}
defaultMessage={'{userEmail}'}
values={{ userEmail: option.userLogin }}
/>
</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
text-overflow: ellipsis;
}
.action-info {
font-family: $FONT-ROBOTO-MEDIUM;
margin: -1px 0 0 20px;
font-size: 13px;
padding-right: 20px;
Expand All @@ -51,12 +52,12 @@
white-space: nowrap;
}
.user-info {
font-family: $FONT-ROBOTO-REGULAR;
margin: -1px 0 0 20px;
font-size: 13px;
padding-right: 20px;
position: relative;
color: $COLOR--charcoal-grey;
font-weight: 600;
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const Label = ({ label, labelWidth, alignLeft, noMinHeight, labelTip }) => (
})}
style={{ width: labelWidth || 'unset' }}
>
<span>{label}</span>
<span className={cx('asterisk')}>{label}</span>
{labelTip && (
<div className={cx('modal-field-label-icon')} title={labelTip}>
{Parser(InfoIcon)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,13 @@
align-items: center;
}
}

.asterisk {
&:after {
content: '*';
position: absolute;
color: $COLOR--e-300;
margin-left: 4px;
margin-top: -4px;
}
}
Loading

0 comments on commit 52942a7

Please sign in to comment.