From 84e9c1384abce427882949a5f7c6d612a8989295 Mon Sep 17 00:00:00 2001 From: ihor-romaniuk Date: Thu, 23 Nov 2023 10:31:45 +0200 Subject: [PATCH] fix: layout responsive --- .../AnswerWidget/AnswerOption.jsx | 6 +- .../__snapshots__/AnswerOption.test.jsx.snap | 12 ++-- .../__snapshots__/index.test.jsx.snap | 6 +- .../EditProblemView/SettingsWidget/index.jsx | 2 +- .../EditProblemView/SettingsWidget/index.scss | 4 +- .../__snapshots__/index.test.jsx.snap | 10 ++-- .../components/EditProblemView/index.jsx | 6 +- .../components/EditProblemView/index.scss | 22 ++++++++ .../__snapshots__/index.test.jsx.snap | 2 +- .../content/AdvanceTypeSelect.jsx | 4 +- .../AdvanceTypeSelect.test.jsx.snap | 56 +++++++++++++++++++ .../components/SelectTypeModal/index.jsx | 2 +- 12 files changed, 106 insertions(+), 26 deletions(-) diff --git a/src/editors/containers/ProblemEditor/components/EditProblemView/AnswerWidget/AnswerOption.jsx b/src/editors/containers/ProblemEditor/components/EditProblemView/AnswerWidget/AnswerOption.jsx index 799dc62fb..72b918243 100644 --- a/src/editors/containers/ProblemEditor/components/EditProblemView/AnswerWidget/AnswerOption.jsx +++ b/src/editors/containers/ProblemEditor/components/EditProblemView/AnswerWidget/AnswerOption.jsx @@ -54,7 +54,7 @@ export const AnswerOption = ({ return (
@@ -78,7 +78,7 @@ exports[`AnswerOption render snapshot: renders correct option with feedback 1`] exports[`AnswerOption render snapshot: renders correct option with numeric input problem 1`] = ` @@ -105,7 +105,7 @@ exports[`AnswerOption render snapshot: renders correct option with numeric input @@ -185,7 +185,7 @@ exports[`AnswerOption render snapshot: renders correct option with numeric input diff --git a/src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/__snapshots__/index.test.jsx.snap b/src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/__snapshots__/index.test.jsx.snap index ea8ae5d6f..828bc823b 100644 --- a/src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/__snapshots__/index.test.jsx.snap +++ b/src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/__snapshots__/index.test.jsx.snap @@ -2,7 +2,7 @@ exports[`SettingsWidget snapshot snapshot: renders Settings widget for Advanced Problem with correct widgets 1`] = `
+
@@ -130,7 +130,7 @@ exports[`EditorProblemView component renders simple view 1`] = ` /> )} -
+
{isAdvancedProblemType ? ( ) : ( - + )} - +
diff --git a/src/editors/containers/ProblemEditor/components/EditProblemView/index.scss b/src/editors/containers/ProblemEditor/components/EditProblemView/index.scss index 4d8bdd07d..3a4beeb3f 100644 --- a/src/editors/containers/ProblemEditor/components/EditProblemView/index.scss +++ b/src/editors/containers/ProblemEditor/components/EditProblemView/index.scss @@ -1,12 +1,34 @@ +.selectTypeContainer { + max-width: 100%; +} + .editProblemView { + .editProblemView-mainColumn { + max-width: calc(100% - 345px); + + @media (max-width: 767px) { + max-width: 100%; + } + } .editProblemView-settingsColumn { width: 320px; flex-grow: 0; flex-shrink: 0; + @media (max-width: 767px) { + width: 100%; + } } .advancedEditorTopMargin { margin-top: 40px; } + .answer-option .mce-content-body:before { + @media (max-width: 767px) { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + max-width: 90%; + } + } } .tinyMceWidget { diff --git a/src/editors/containers/ProblemEditor/components/SelectTypeModal/__snapshots__/index.test.jsx.snap b/src/editors/containers/ProblemEditor/components/SelectTypeModal/__snapshots__/index.test.jsx.snap index 51f08eada..72ded5bec 100644 --- a/src/editors/containers/ProblemEditor/components/SelectTypeModal/__snapshots__/index.test.jsx.snap +++ b/src/editors/containers/ProblemEditor/components/SelectTypeModal/__snapshots__/index.test.jsx.snap @@ -9,7 +9,7 @@ exports[`SelectTypeModal snapshot 1`] = ` className="justify-content-center" > diff --git a/src/editors/containers/ProblemEditor/components/SelectTypeModal/content/AdvanceTypeSelect.jsx b/src/editors/containers/ProblemEditor/components/SelectTypeModal/content/AdvanceTypeSelect.jsx index 486a3dfbb..3a1cb4c48 100644 --- a/src/editors/containers/ProblemEditor/components/SelectTypeModal/content/AdvanceTypeSelect.jsx +++ b/src/editors/containers/ProblemEditor/components/SelectTypeModal/content/AdvanceTypeSelect.jsx @@ -44,7 +44,7 @@ export const AdvanceTypeSelect = ({ if (data.status !== '') { return ( - + {intl.formatMessage(messages.advanceProblemTypeLabel, { problemType: data.title })} @@ -67,7 +67,7 @@ export const AdvanceTypeSelect = ({ } return ( - + {intl.formatMessage(messages.advanceProblemTypeLabel, { problemType: data.title })} diff --git a/src/editors/containers/ProblemEditor/components/SelectTypeModal/content/__snapshots__/AdvanceTypeSelect.test.jsx.snap b/src/editors/containers/ProblemEditor/components/SelectTypeModal/content/__snapshots__/AdvanceTypeSelect.test.jsx.snap index 79a799057..a4b0fb142 100644 --- a/src/editors/containers/ProblemEditor/components/SelectTypeModal/content/__snapshots__/AdvanceTypeSelect.test.jsx.snap +++ b/src/editors/containers/ProblemEditor/components/SelectTypeModal/content/__snapshots__/AdvanceTypeSelect.test.jsx.snap @@ -38,6 +38,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with default className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -49,6 +50,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with default className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -93,6 +95,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with default className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -104,6 +107,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with default className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -148,6 +152,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with default className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -192,6 +197,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with default className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -203,6 +209,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with default className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -296,6 +303,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -307,6 +315,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -351,6 +360,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -362,6 +372,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -406,6 +417,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -450,6 +462,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -461,6 +474,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -554,6 +568,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -565,6 +580,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -609,6 +625,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -620,6 +637,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -664,6 +682,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -708,6 +727,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -719,6 +739,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -812,6 +833,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -823,6 +845,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -867,6 +890,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -878,6 +902,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -922,6 +947,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -966,6 +992,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -977,6 +1004,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -1070,6 +1098,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -1081,6 +1110,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -1125,6 +1155,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -1136,6 +1167,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -1180,6 +1212,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -1224,6 +1257,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -1235,6 +1269,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -1328,6 +1363,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -1339,6 +1375,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -1383,6 +1420,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -1394,6 +1432,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -1438,6 +1477,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -1482,6 +1522,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -1493,6 +1534,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -1586,6 +1628,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -1597,6 +1640,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -1641,6 +1685,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -1652,6 +1697,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -1696,6 +1742,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -1740,6 +1787,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -1751,6 +1799,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -1844,6 +1893,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -1855,6 +1905,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -1899,6 +1950,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -1910,6 +1962,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -1954,6 +2007,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -1998,6 +2052,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > @@ -2009,6 +2064,7 @@ exports[`AdvanceTypeSelect snapshots snapshots: renders as expected with problem className="border-primary-100 border-bottom m-0 py-3 w-100" > diff --git a/src/editors/containers/ProblemEditor/components/SelectTypeModal/index.jsx b/src/editors/containers/ProblemEditor/components/SelectTypeModal/index.jsx index c74b0768c..df9ac3e4d 100644 --- a/src/editors/containers/ProblemEditor/components/SelectTypeModal/index.jsx +++ b/src/editors/containers/ProblemEditor/components/SelectTypeModal/index.jsx @@ -19,7 +19,7 @@ export const SelectTypeModal = ({ {(!Object.values(AdvanceProblemKeys).includes(selected)) ? ( - +