Skip to content

Commit d768bfc

Browse files
1 parent 9c997ab commit d768bfc

File tree

5 files changed

+71
-31
lines changed

5 files changed

+71
-31
lines changed

src/pages-and-resources/PagesAndResources.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const PagesAndResources = ({ courseId, intl }) => {
4747
const xpertSettings = useModel('XpertSettings', 'xpert-unit-summary');
4848
const permissonPages = [{
4949
...XpertAppInfo,
50-
enabled: xpertSettings?.enabled,
50+
enabled: xpertSettings?.enabled !== undefined,
5151
}];
5252

5353
if (loadingStatus === RequestStatus.IN_PROGRESS) {

src/pages-and-resources/xpert-unit-summary/XpertUnitSummarySettings.jsx

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React, { useCallback, useContext, useEffect } from 'react';
22
import { history } from '@edx/frontend-platform';
3-
import { Hyperlink } from '@edx/paragon';
43
import { useDispatch } from 'react-redux';
54

65
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';
@@ -27,21 +26,8 @@ const XpertUnitSummarySettings = ({ intl }) => {
2726
<SettingsModal
2827
appId="xpert-unit-summary"
2928
title={intl.formatMessage(messages.heading)}
30-
enableAppHelp={
31-
(
32-
<>
33-
{intl.formatMessage(messages.enableXpertUnitSummaryHelp)}
34-
{' '}
35-
<Hyperlink
36-
destination="https://openai.com/api-data-privacy"
37-
target="_blank"
38-
showLaunchIcon={false}
39-
>
40-
{intl.formatMessage(messages.enableXpertUnitSummaryHelpPrivacyLink)}
41-
</Hyperlink>
42-
</>
43-
)
44-
}
29+
enableAppHelp={intl.formatMessage(messages.enableXpertUnitSummaryHelp)}
30+
helpPrivacyText={intl.formatMessage(messages.enableXpertUnitSummaryHelpPrivacyLink)}
4531
enableAppLabel={intl.formatMessage(messages.enableXpertUnitSummaryLabel)}
4632
learnMoreText={intl.formatMessage(messages.enableXpertUnitSummaryLink)}
4733
allUnitsEnabledText={intl.formatMessage(messages.allUnitsEnabledByDefault)}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const ResetIcon = (props) => (
2+
<svg
3+
xmlns="http://www.w3.org/2000/svg"
4+
width="24"
5+
height="24"
6+
viewBox="0 0 24 24"
7+
fill="none"
8+
role="img"
9+
focusable="false"
10+
aria-hidden="true"
11+
transform="scale(-1,1)"
12+
{...props}
13+
>
14+
<path
15+
d="M17.65 6.35A7.958 7.958 0 0 0 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"
16+
fill="currentColor"
17+
/>
18+
</svg>
19+
);
20+
21+
export default ResetIcon;

src/pages-and-resources/xpert-unit-summary/settings-modal/SettingsModal.jsx

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
Hyperlink,
1414
} from '@edx/paragon';
1515
import {
16-
Info, CheckCircleOutline, RotateLeft, SpinnerSimple,
16+
Info, CheckCircleOutline, SpinnerSimple,
1717
} from '@edx/paragon/icons';
1818

1919
import { Formik } from 'formik';
@@ -38,6 +38,7 @@ import AppConfigFormDivider from '../../discussions/app-config-form/apps/shared/
3838
import { PagesAndResourcesContext } from '../../PagesAndResourcesProvider';
3939
import messages from './messages';
4040
import appInfo from '../appInfo';
41+
import ResetIcon from './ResetIcon';
4142

4243
const AppSettingsForm = ({
4344
formikProps, children, showForm,
@@ -150,7 +151,10 @@ const ResetUnitsButton = ({
150151
<OverlayTrigger
151152
placement="right"
152153
overlay={(
153-
<Tooltip id={`tooltip-reset-${checked}`}>
154+
<Tooltip
155+
id={`tooltip-reset-${checked}`}
156+
className="reset-tooltip"
157+
>
154158
{intl.formatMessage(messages[messageKey])}
155159
</Tooltip>
156160
)}
@@ -163,7 +167,7 @@ const ResetUnitsButton = ({
163167
finish: intl.formatMessage(messages.reset),
164168
}}
165169
icons={{
166-
default: <Icon src={RotateLeft} />,
170+
default: <Icon src={ResetIcon} />,
167171
pending: <Icon src={SpinnerSimple} className="icon-spin" />,
168172
finish: <Icon src={CheckCircleOutline} />,
169173
}}
@@ -201,6 +205,7 @@ const SettingsModal = ({
201205
enableAppLabel,
202206
enableAppHelp,
203207
learnMoreText,
208+
helpPrivacyText,
204209
enableReinitialize,
205210
allUnitsEnabledText,
206211
noUnitsEnabledText,
@@ -251,14 +256,29 @@ const SettingsModal = ({
251256
};
252257

253258
const learnMoreLink = appInfo.documentationLinks?.learnMoreConfiguration && (
254-
<Hyperlink
255-
className="text-primary-500"
256-
destination={appInfo.documentationLinks.learnMoreConfiguration}
257-
target="_blank"
258-
rel="noreferrer noopener"
259-
>
260-
{learnMoreText}
261-
</Hyperlink>
259+
<div className="py-1">
260+
<Hyperlink
261+
className="text-primary-500"
262+
destination={appInfo.documentationLinks.learnMoreConfiguration}
263+
target="_blank"
264+
rel="noreferrer noopener"
265+
>
266+
{learnMoreText}
267+
</Hyperlink>
268+
</div>
269+
);
270+
271+
const helpPrivacyLink = (
272+
<div className="py-1">
273+
<Hyperlink
274+
className="text-primary-500"
275+
destination="https://openai.com/api-data-privacy"
276+
target="_blank"
277+
rel="noreferrer noopener"
278+
>
279+
{helpPrivacyText}
280+
</Hyperlink>
281+
</div>
262282
);
263283

264284
if (loadingStatus === RequestStatus.SUCCESSFUL) {
@@ -330,7 +350,8 @@ const SettingsModal = ({
330350
helpText={(
331351
<div>
332352
<p>{enableAppHelp}</p>
333-
<span className="py-3">{learnMoreLink}</span>
353+
{helpPrivacyLink}
354+
{learnMoreLink}
334355
</div>
335356
)}
336357
/>
@@ -410,6 +431,7 @@ SettingsModal.propTypes = {
410431
enableAppLabel: PropTypes.string.isRequired,
411432
enableAppHelp: PropTypes.string.isRequired,
412433
learnMoreText: PropTypes.string.isRequired,
434+
helpPrivacyText: PropTypes.string.isRequired,
413435
allUnitsEnabledText: PropTypes.string.isRequired,
414436
noUnitsEnabledText: PropTypes.string.isRequired,
415437
configureBeforeEnable: PropTypes.bool,

src/pages-and-resources/xpert-unit-summary/settings-modal/SettingsModal.scss

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
flex: 1;
1717

1818
> label {
19-
height: 80px;
19+
min-height: 80px;
20+
flex-wrap: wrap;
21+
justify-content: space-between;
2022
}
2123
}
2224
}
@@ -27,5 +29,14 @@
2729
border-color: $border-color;
2830
border-radius: $border-radius;
2931
border-style: solid;
30-
margin-left: auto;
32+
}
33+
34+
.reset-tooltip {
35+
.arrow::before {
36+
border-right-color: #00262B;
37+
}
38+
39+
.tooltip-inner {
40+
background-color: #00262B;
41+
}
3142
}

0 commit comments

Comments
 (0)