generated from openedx/frontend-template-application
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: APER-2852 - fit and finish categorizinator
- Loading branch information
1 parent
6a13827
commit 7665126
Showing
36 changed files
with
351 additions
and
165 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import React, { useState, useContext } from 'react'; | ||
import { | ||
Container, Stack, Form, Button, | ||
} from '@edx/paragon'; | ||
import { VisibilityFlagsContext } from './visibility-flags-context'; | ||
import { setAllFlags } from './visibility-flags-context/data/actions'; | ||
|
||
const ProductTool = () => { | ||
/* | ||
This component renders a tool that contains a checkbox for each feature flag. | ||
Setting each checkbox and then clicking the "Configure" button will trigger a rerender of the UI. | ||
*/ | ||
const { state: visibilityFlagsState, dispatch } = useContext(VisibilityFlagsContext); | ||
const [checkboxState, setCheckboxState] = useState(visibilityFlagsState); | ||
|
||
// click handle for the "Configure" button | ||
const handleClick = () => { | ||
// sets all flags to whatever is being held in state | ||
dispatch(setAllFlags(checkboxState)); | ||
}; | ||
|
||
const onCheckboxChange = (e) => { | ||
// extract `checked` (boolean) and `value` (string) from the target (checkbox) | ||
const { checked, value } = e.target; | ||
setCheckboxState(prev => ({ | ||
...prev, | ||
// set the key for this flag to whatever `checked` is | ||
[value]: checked, | ||
})); | ||
}; | ||
|
||
return ( | ||
<Container className="py-4.5 border-top"> | ||
<Stack direction="horizontal" className="justify-content-around"> | ||
<Form.CheckboxSet | ||
name="visibility-flags" | ||
onChange={onCheckboxChange} | ||
defaultValue={Object.keys(checkboxState).filter(item => checkboxState[item])} | ||
> | ||
{Object.keys(visibilityFlagsState).map((item, idx) => ( | ||
// eslint-disable-next-line react/no-array-index-key | ||
<Form.Checkbox key={idx} value={item}>{item}</Form.Checkbox> | ||
))} | ||
</Form.CheckboxSet> | ||
<Button onClick={handleClick}>Configure</Button> | ||
</Stack> | ||
</Container> | ||
); | ||
}; | ||
|
||
export default ProductTool; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react'; | ||
import { SkillsBuilderProvider } from './skills-builder-context'; | ||
import { VisibilityFlagsProvider } from './visibility-flags-context'; | ||
import SkillsBuilder from './SkillsBuilder'; | ||
|
||
const SkillsBuilderContextWrapper = () => ( | ||
<SkillsBuilderProvider> | ||
<VisibilityFlagsProvider> | ||
<SkillsBuilder /> | ||
</VisibilityFlagsProvider> | ||
</SkillsBuilderProvider> | ||
); | ||
|
||
export default SkillsBuilderContextWrapper; |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
// eslint-disable-next-line import/prefer-default-export | ||
export { default as SkillsBuilder } from './SkillsBuilder'; | ||
export { default as SkillsBuilder } from './SkillsBuilderContextWrapper'; |
2 changes: 1 addition & 1 deletion
2
src/skills-builder/skills-builder-context/SkillsBuilderProvider.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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
27 changes: 15 additions & 12 deletions
27
src/skills-builder/skills-builder-header/SkillsBuilderHeader.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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Stepper keys | ||
export const STEP1 = 'select-your-preferences'; | ||
export const STEP2 = 'review-your-results'; |
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
8 changes: 4 additions & 4 deletions
8
src/skills-builder/skills-builder-steps/select-preferences/SelectPreferences.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
9 changes: 9 additions & 0 deletions
9
src/skills-builder/skills-builder-steps/select-preferences/data/constants.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,9 @@ | ||
// eslint-disable-next-line import/prefer-default-export | ||
export const FORM_VALUES = { | ||
Coding: '', | ||
Business: '', | ||
ProductManagement: '', | ||
Data: '', | ||
ArtificialIntelligence: '', | ||
Communications: '', | ||
}; |
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 |
---|---|---|
|
@@ -22,3 +22,7 @@ $breakpoint-medium: 992px; | |
overflow: scroll; | ||
} | ||
} | ||
|
||
.select-width { | ||
width: 20rem; | ||
} |
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
Oops, something went wrong.