Unverified Commit d4b965d2 authored by Zhou (Link)  Fang's avatar Zhou (Link) Fang Committed by GitHub
Browse files

Added WG charter link (#255)

* Added WG charter link

* Updated testing WG data for React only mode

* lowercased charter
parent 92e654ae
......@@ -133,6 +133,7 @@ export const FULL_WORKING_GROUP_LIST_FOR_REACT_ONLY = [
{ description: 'Participant Member', relation: 'WGAPS' },
{ description: 'Committer Member', relation: 'WGFHA' },
],
charter: 'https://www.eclipse.org/org/workinggroups/openmobility_charter.php',
},
{
label: 'Jakarta EE Working Group',
......@@ -143,6 +144,7 @@ export const FULL_WORKING_GROUP_LIST_FOR_REACT_ONLY = [
{ description: 'Participant Member', relation: 'WGAPS' },
{ description: 'Guest Member', relation: 'WGSAP' },
],
charter: 'https://www.eclipse.org/org/workinggroups/jakarta_ee_charter.php'
},
];
......
......@@ -12,17 +12,18 @@ import DropdownMenu from '../../UIComponents/Inputs/DropdownMenu';
const ParticipationLevel = ({ name, workingGroupUserJoined, fullWorkingGroupList, formik, index }) => {
const [participationLevelOptions, setParticipationLevelOptions] = useState([]);
const [selectedWG, setSelectedWG] = useState();
const theIndex = index;
useEffect(() => {
// If have selected working group, find this working group's
// participation levels, and pass to the react-select option
if (fullWorkingGroupList) {
let temp = fullWorkingGroupList?.find((item) => workingGroupUserJoined.value === item.value);
let selectedWG = fullWorkingGroupList?.find((item) => workingGroupUserJoined.value === item.value);
setSelectedWG(selectedWG);
// extract all the participation_levels
let optionsForParticipationLevels = temp?.participation_levels
? temp?.participation_levels.map((item) => item.description || item.level)
let optionsForParticipationLevels = selectedWG?.participation_levels
? selectedWG?.participation_levels.map((item) => item.description)
: [];
// the Set will deduplicate participation_levels options
......@@ -54,6 +55,13 @@ const ParticipationLevel = ({ name, workingGroupUserJoined, fullWorkingGroupList
)}
</div>
</div>
<p>
You can find additional information about {selectedWG?.label} in the{' '}
<a target="_blank" rel="noreferrer" href={selectedWG?.charter}>
{selectedWG?.label} charter
</a>
.
</p>
</>
);
};
......
......@@ -120,9 +120,10 @@ const WorkingGroupsWrapper = ({ formik, isStartNewForm }) => {
})
.then((data) => {
let options = data.map((item) => ({
label: item.title || item.name,
value: item.title || item.name,
label: item.title,
value: item.title,
participation_levels: item.levels,
charter: item.resources.charter
}));
setFullWorkingGroupList(options);
})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment