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

Reorganize Delegate panel links #10651

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 0 additions & 2 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,6 @@ def self.panel_pages
:leaderForms,
:groupsManager,
:importantLinks,
:delegateHandbook,
:seniorDelegatesList,
:leadersAdmin,
:boardEditor,
Expand Down Expand Up @@ -682,7 +681,6 @@ def self.panel_list
name: 'Delegate panel',
pages: [
panel_pages[:importantLinks],
panel_pages[:delegateHandbook],
panel_pages[:bannedCompetitors],
],
},
Expand Down
7 changes: 2 additions & 5 deletions app/webpacker/components/Panel/PanelPages.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ import ApprovePictures from './pages/ApprovePictures';
import EditPersonRequestsPage from './pages/EditPersonRequestsPage';
import AnonymizationScriptPage from './pages/AnonymizationScriptPage';

const DELEGATE_HANDBOOK_LINK = 'https://documents.worldcubeassociation.org/edudoc/delegate-handbook/delegate-handbook.pdf';
const DELEGATE_HANDBOOK_LINK =
'https://documents.worldcubeassociation.org/edudoc/delegate-handbook/delegate-handbook.pdf';
Comment on lines +43 to +44
Copy link
Member

Choose a reason for hiding this comment

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

Where is this constant being used. if you're deleting the delegateHandbook panel page further down?
(Sorry if this question is obvious, I just can't see it from the way GitHub renders the diff of this particular PR)


export default {
[PANEL_PAGES.postingDashboard]: {
Expand Down Expand Up @@ -115,10 +116,6 @@ export default {
name: 'Important Links',
component: ImportantLinks,
},
[PANEL_PAGES.delegateHandbook]: {
name: 'Delegate Handbook',
link: DELEGATE_HANDBOOK_LINK,
},
[PANEL_PAGES.seniorDelegatesList]: {
name: 'Senior Delegates List',
component: SeniorDelegatesList,
Expand Down
92 changes: 52 additions & 40 deletions app/webpacker/components/Panel/pages/ImportantLinks/index.jsx
Original file line number Diff line number Diff line change
@@ -1,63 +1,75 @@
import React from 'react';
import { Header, List } from 'semantic-ui-react';
import { allDelegatePageUrl, countryBandsUrl } from '../../../../lib/requests/routes.js.erb';

const IMPORTANT_LINKS = [
{
title: 'Guidelines for Disciplinary Incidents',
link: 'https://documents.worldcubeassociation.org/edudoc/guidelines-for-disciplinary-incidents/guidelines-for-disciplinary-incidents.pdf',
section: 'Guides',
links: [
{
title: 'Delegate Handbook',
link: 'https://documents.worldcubeassociation.org/edudoc/delegate-handbook/delegate-handbook.pdf',
},
{
title: 'Guidelines for Disciplinary Incidents',
link: 'https://documents.worldcubeassociation.org/edudoc/guidelines-for-disciplinary-incidents/guidelines-for-disciplinary-incidents.pdf',
},
{
title: 'Visual Guide for Regulation 3j',
link: 'https://drive.google.com/file/d/1m6THsA8fXRN7QFM4ApJbm6eVODKGbMLx/view',
},
{
title: 'Visual Guide for Regulation 5b5f',
link: 'https://drive.google.com/file/d/15XszaCGNvy3Dk6X6qERzZWZaDH1RH04z/view',
},
],
},
{
title: 'All Delegates',
link: allDelegatePageUrl,
},
{
title: 'WR Submission Form',
link: 'https://docs.google.com/forms/d/e/1FAIpQLSeLrkLhFnIy1QNGoWoZT4jsOIibNJ_xc9qTd_YKBpcuMIq-LA/viewform',
},
{
title: 'Gear Order Form',
link: 'https://forms.gle/owX3ppZahYkoq9s48',
},
{
title: 'Travel Reimbursement Form',
link: 'https://docs.google.com/forms/d/12tz2I_EeBORm14kQO6ZB5TOp321YbXkIXvrxUNIHxN0/viewform',
},
{
title: 'Equipment Funding Form',
link: 'https://docs.google.com/forms/d/e/1FAIpQLSebkWMyG2kRzR3cDm3jXFVMFCwd5u4XI6Yt35givu0SOidpHg/viewform',
},
{
title: 'Bands for WCA Dues',
link: countryBandsUrl,
},
{
title: 'Visual Guide for Regulation 3j',
link: 'https://drive.google.com/file/d/1m6THsA8fXRN7QFM4ApJbm6eVODKGbMLx/view',
},
{
title: 'Visual Guide for Regulation 5b5f',
link: 'https://drive.google.com/file/d/15XszaCGNvy3Dk6X6qERzZWZaDH1RH04z/view',
section: 'Forms',
links: [
{
title: 'Gear Order Form',
link: 'https://forms.gle/owX3ppZahYkoq9s48',
},
{
title: 'Equipment Funding Form',
link: 'https://docs.google.com/forms/d/e/1FAIpQLSebkWMyG2kRzR3cDm3jXFVMFCwd5u4XI6Yt35givu0SOidpHg/viewform',
},
{
title: 'Travel Reimbursement Form',
link: 'https://docs.google.com/forms/d/12tz2I_EeBORm14kQO6ZB5TOp321YbXkIXvrxUNIHxN0/viewform',
},
{
title: 'WR Submission Form',
link: 'https://docs.google.com/forms/d/e/1FAIpQLSeLrkLhFnIy1QNGoWoZT4jsOIibNJ_xc9qTd_YKBpcuMIq-LA/viewform',
},
],
},
];

function ListItemLink({ title, link }) {
return (
<List.Item>
<a href={link} target="_blank" rel="noreferrer">{title}</a>
<a href={link} target='_blank' rel='noreferrer'>
{title}
</a>
</List.Item>
);
}

export default function ImportantLinks() {
return (
<>
<Header as="h2">Important Links</Header>
<List>
{IMPORTANT_LINKS.map(({ title, link }) => (
<ListItemLink key={link} title={title} link={link} />
))}
</List>
<Header as='h2'>Important Links</Header>
{IMPORTANT_LINKS.map(({ section, links }) => (
<div key={section}>
<Header as='h3'>{section}</Header>
<List>
{links.map(({ title, link }) => (
<ListItemLink key={link} title={title} link={link} />
))}
</List>
</div>
Comment on lines +64 to +71
Copy link
Member

Choose a reason for hiding this comment

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

Not too fond of "wild" divs appearing in our codebase. Lists in Semantic UI can do sub-lists, have you considered that?

Copy link
Member

Choose a reason for hiding this comment

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

Otherwise, React.Fragment should do as a last resort.

))}
</>
);
}
Loading