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

fix: Manage members layout is broken #3058

Merged
merged 2 commits into from
Dec 5, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions frontend/web/components/pages/OrganisationSettingsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import PageTitle from 'components/PageTitle'
import { getStore } from 'common/store'
import { getRoles } from 'common/services/useRole'

const widths = [450, 150, 100]
const widths = [450, 150, 100, 250, 235, 255]
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd quite like to understand why we define these widths here rather than just directly in the style objects below.

It also would make sense to my somewhat picky brain if these were ordered, either smallest to largest or largest to smallest, I'm not that fussy!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems that initially this array was used to give sizes to the panelSearch component, as I worked on that component I added those values ​​to the array.

Re-ordered.

const rolesWidths = [250, 600, 100]
const OrganisationSettingsPage = class extends Component {
static contextTypes = {
Expand Down Expand Up @@ -955,11 +955,16 @@ const OrganisationSettingsPage = class extends Component {
<Flex className='table-column px-3'>
User
</Flex>
<Flex className='table-column'>
<Flex
className='table-column'
style={{
minWidth: widths[5],
}}
>
Role
</Flex>
<div
style={{ width: widths[0] }}
style={{ width: widths[3] }}
className='table-column'
>
Action
Expand Down Expand Up @@ -1021,7 +1026,11 @@ const OrganisationSettingsPage = class extends Component {
</Flex>

<Flex className='table-column'>
<div>
<div
style={{
minWidth: widths[4],
}}
>
{organisation.role ===
'ADMIN' &&
id !==
Expand Down Expand Up @@ -1095,7 +1104,7 @@ const OrganisationSettingsPage = class extends Component {
{role !== 'ADMIN' ? (
<div
style={{
width: widths[0],
width: widths[3],
}}
onClick={onEditClick}
className='table-column'
Expand All @@ -1115,7 +1124,7 @@ const OrganisationSettingsPage = class extends Component {
) : (
<div
style={{
width: widths[0],
width: widths[3],
}}
></div>
)}
Expand Down