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

Bump bootstrap from 4.6.2 to 5.0.0 #352

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
165 changes: 88 additions & 77 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@kbss-cvut/tsort": "0.0.2",
"@triply/yasgui": "^4.2.14",
"babel-runtime": "^6.26.0",
"bootstrap": "^4.6.0",
"bootstrap": "^5.0.0",
"classnames": "^2.2.6",
"core-js": "^3.6.5",
"date-fns": "^2.13.0",
Expand All @@ -60,7 +60,7 @@
"jsonld-utils": "https://kbss.felk.cvut.cz/dist/jsonld-utils-0.1.3.tgz",
"npm-packlist": "^7.0.2",
"prop-types": "^15.7.2",
"react-bootstrap": "1.0.1",
"react-bootstrap": "^2.10.5",
"react-datepicker": "^4.14.1",
"react-intl": "^6.5.1",
"react-loader-spinner": "^5.3.4",
Expand Down
9 changes: 5 additions & 4 deletions src/components/DefaultInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export default class DefaultInput extends React.Component {
<Form.Group
size="small"
controlId={Math.floor(Math.random() * Number.MAX_SAFE_INTEGER)}
className="mb-3"
>
<Form.Check
type="checkbox"
Expand All @@ -85,7 +86,7 @@ export default class DefaultInput extends React.Component {

_renderRadio() {
return (
<FormGroup size="small">
<FormGroup size="small" className="mb-3">
<Form.Check
type="radio"
ref={(c) => (this.input = c)}
Expand All @@ -100,7 +101,7 @@ export default class DefaultInput extends React.Component {

_renderSelect() {
return (
<FormGroup size="small">
<FormGroup size="small" className="mb-3">
{this._renderLabel()}
<FormControl
as="select"
Expand All @@ -124,7 +125,7 @@ export default class DefaultInput extends React.Component {
_renderTextArea() {
// TODO validation
return (
<FormGroup size="small">
<FormGroup size="small" className="mb-3">
{this._renderLabel()}
<FormControl
ref={(c) => (this.input = c)}
Expand All @@ -140,7 +141,7 @@ export default class DefaultInput extends React.Component {

_renderInput() {
return (
<FormGroup size="small">
<FormGroup size="small" className="mb-3">
{this._renderLabel()}
<FormControl
className={this.props.validation.classname}
Expand Down
52 changes: 27 additions & 25 deletions src/components/Question.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,31 +215,30 @@ export default class Question extends React.Component {
return (
<>
<Accordion
defaultActiveKey={!this.state.expanded ? label : undefined}
activeKey={this.state.expanded ? label : undefined}
className="mb-3"
>
<Card className="mb-3">
<Accordion.Toggle
as={Card.Header}
onClick={this._toggleCollapse}
className={this._getHeaderClassName()}
onMouseEnter={this._onMouseEnterHandler}
onMouseLeave={this._onMouseLeaveHandler}
>
<h6 className="d-inline" id={question["@id"]}>
{collapsible &&
!FormUtils.isWizardStep(question) &&
this._renderCollapseToggle()}
{label}
</h6>
{this.renderQuestionIcons()}
{this.props.children}
</Accordion.Toggle>
{collapsible ? (
<Accordion.Collapse>{cardBody}</Accordion.Collapse>
) : (
<>{cardBody}</>
)}
</Card>
<Accordion.Item eventKey={label}>
<Card className="">
<Accordion.Button
as={Card.Header}
onClick={this._toggleCollapse}
className={this._getHeaderClassName()}
onMouseEnter={this._onMouseEnterHandler}
onMouseLeave={this._onMouseLeaveHandler}
>
<div className="d-inline" id={question["@id"]}>
{collapsible &&
!FormUtils.isWizardStep(question) &&
this._renderCollapseToggle()}
{label}
</div>
</Accordion.Button>
<Accordion.Body className="p-0">
{collapsible ? cardBody : <>{cardBody}</>}
</Accordion.Body>
</Card>
</Accordion.Item>
</Accordion>
</>
);
Expand Down Expand Up @@ -286,6 +285,9 @@ export default class Question extends React.Component {
{this.renderSubQuestions(classname)}
</Card.Body>
);
const answerableSectionStyles = this._getHeaderClassName();

if (this.state.expanded) answerableSectionStyles.push("text-primary");

return (
<Accordion
Expand All @@ -295,7 +297,7 @@ export default class Question extends React.Component {
<Card className="mb-3">
<Card.Header
onClick={this._toggleCollapse}
className={this._getHeaderClassName()}
className={answerableSectionStyles}
>
{this.renderAnswers()}
</Card.Header>
Expand Down
Loading