-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EPMRPP-96659 || Update the veiw of selected project in the header (#4120
- Loading branch information
Showing
17 changed files
with
205 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...on/membersPage/membersPageHeader/userPageLocationLevel/img/sub-level-inline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions
4
.../common/membersPage/membersPageHeader/userPageLocationLevel/img/tree-inline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions
17
...rc/pages/organization/common/membersPage/membersPageHeader/userPageLocationLevel/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/*! | ||
* 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 { UserPageLocationLevel } from './userPageLocationLevel'; |
76 changes: 76 additions & 0 deletions
76
...tion/common/membersPage/membersPageHeader/userPageLocationLevel/userPageLocationLevel.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/*! | ||
* 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 { useState } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { useIntl } from 'react-intl'; | ||
import Parser from 'html-react-parser'; | ||
import classNames from 'classnames/bind'; | ||
import { BaseIconButton, Popover } from '@reportportal/ui-kit'; | ||
import TreeIcon from './img/tree-inline.svg'; | ||
import SubLevelIcon from './img/sub-level-inline.svg'; | ||
import { messages } from '../messages'; | ||
import styles from './userPageLocationLevel.scss'; | ||
|
||
const cx = classNames.bind(styles); | ||
|
||
export const UserPageLocationLevel = ({ organizationName, projectName }) => { | ||
const { formatMessage } = useIntl(); | ||
const [isOpen, setIsOpen] = useState(false); | ||
|
||
const getContent = () => ( | ||
<div className={cx('members-page-header-container')}> | ||
<div>{formatMessage(messages.allOrganizations)}</div> | ||
<div className={cx('organization-name', { active: !projectName })}> | ||
{Parser(SubLevelIcon)} | ||
{organizationName} | ||
</div> | ||
{projectName && ( | ||
<div className={cx('project-name')}> | ||
{Parser(SubLevelIcon)} | ||
{projectName} | ||
</div> | ||
)} | ||
</div> | ||
); | ||
|
||
return ( | ||
<div className={cx('user-page-location-level')}> | ||
<Popover | ||
content={getContent()} | ||
placement="bottom-start" | ||
className={cx('popover')} | ||
isOpened={isOpen} | ||
setIsOpened={setIsOpen} | ||
fallbackPlacements={[]} | ||
> | ||
<BaseIconButton className={cx('tree-button', { open: isOpen })}> | ||
{Parser(TreeIcon)} | ||
</BaseIconButton> | ||
</Popover> | ||
<div className={cx('name')}>{projectName || organizationName}</div> | ||
</div> | ||
); | ||
}; | ||
|
||
UserPageLocationLevel.propTypes = { | ||
organizationName: PropTypes.string.isRequired, | ||
projectName: PropTypes.string, | ||
}; | ||
|
||
UserPageLocationLevel.defaultProps = { | ||
projectName: null, | ||
}; |
74 changes: 74 additions & 0 deletions
74
...ion/common/membersPage/membersPageHeader/userPageLocationLevel/userPageLocationLevel.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/*! | ||
* 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. | ||
*/ | ||
|
||
.user-page-location-level { | ||
display: flex; | ||
align-items: center; | ||
gap: 16px; | ||
color: $COLOR--e-300; | ||
font-size: 13px; | ||
margin-bottom: 12px; | ||
|
||
svg { | ||
width: 16px; | ||
height: 16px; | ||
} | ||
} | ||
|
||
.tree-button { | ||
width: 16px; | ||
height: 16px; | ||
} | ||
|
||
.name { | ||
font-size: 13px; | ||
line-height: 20px; | ||
} | ||
|
||
.open { | ||
svg path { | ||
fill: $COLOR--topaz-pressed; | ||
} | ||
|
||
&:hover:not(.disabled) { | ||
svg path { | ||
fill: $COLOR--topaz-2; | ||
} | ||
} | ||
} | ||
|
||
.popover { | ||
font-size: 13px; | ||
line-height: 20px; | ||
min-width: 175px; | ||
} | ||
|
||
.project-name, | ||
.organization-name { | ||
display: flex; | ||
align-items: center; | ||
gap: 4px; | ||
margin-top: 8px; | ||
} | ||
|
||
.project-name { | ||
color: $COLOR--topaz-2; | ||
margin-left: 16px; | ||
} | ||
|
||
.active { | ||
color: $COLOR--topaz-2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters