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 Blueprint; remove obsolete hotfixes, deprecations #2773

Merged
merged 33 commits into from
Apr 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
01b6f1b
Bump minimum Blueprint version
RichDom2185 Feb 12, 2024
89bfc32
Migrate from deprecated `Tooltip2`, `Popover2`
RichDom2185 Feb 12, 2024
d4f1a2a
Migrate more components to fix deprecations
RichDom2185 Feb 12, 2024
460b268
Update test snapshots
RichDom2185 Feb 12, 2024
f392e65
Migrate remaining components to fix deprecations
RichDom2185 Feb 12, 2024
6ab55aa
Remove deprecated package from `requireProvider`
RichDom2185 Feb 12, 2024
491a5aa
Remove `@blueprintjs/popover2` package completely
RichDom2185 Feb 12, 2024
4005d89
Fix format
RichDom2185 Feb 12, 2024
2ea1e44
Merge branch 'master' of https://github.com/source-academy/frontend i…
RichDom2185 Feb 13, 2024
936d6b7
Merge branch 'master' into bump-deps-bp
RichDom2185 Feb 13, 2024
d678f6a
Merge branch 'master' into bump-deps-bp
RichDom2185 Feb 14, 2024
8050c18
Merge branch 'master' into bump-deps-bp
RichDom2185 Feb 18, 2024
e2cb8bf
Merge branch 'master' into bump-deps-bp
RichDom2185 Feb 20, 2024
a2ae81f
Merge branch 'master' of https://github.com/source-academy/frontend i…
RichDom2185 Feb 22, 2024
b1210ef
Merge branch 'master' of https://github.com/source-academy/frontend i…
RichDom2185 Feb 23, 2024
590dc66
Fix format
RichDom2185 Feb 23, 2024
f346e01
Merge branch 'master' of https://github.com/source-academy/frontend i…
RichDom2185 Feb 23, 2024
9ca289d
Merge branch 'master' into bump-deps-bp
RichDom2185 Feb 23, 2024
18af182
Merge branch 'master' of https://github.com/source-academy/frontend i…
RichDom2185 Feb 26, 2024
86d82ec
Merge branch 'master' of https://github.com/source-academy/frontend i…
RichDom2185 Mar 12, 2024
8aa701d
Merge branch 'master' of https://github.com/source-academy/frontend i…
RichDom2185 Mar 17, 2024
60ddb04
Merge branch 'master' of https://github.com/source-academy/frontend i…
RichDom2185 Mar 17, 2024
968bf27
Merge branch 'master' of https://github.com/source-academy/frontend i…
RichDom2185 Mar 24, 2024
11cdf0c
Reformat files post-merge
RichDom2185 Mar 24, 2024
8f0b078
Bump Blueprint version
RichDom2185 Mar 24, 2024
597b8a2
Merge branch 'master' into bump-deps-bp
RichDom2185 Mar 24, 2024
0052a6f
Merge branch 'master' into bump-deps-bp
RichDom2185 Mar 26, 2024
83e28b6
Merge branch 'master' of https://github.com/source-academy/frontend i…
RichDom2185 Apr 13, 2024
f9db64e
Use BP `Classes` utility instead of raw strings
RichDom2185 Apr 13, 2024
53cf720
Merge branch 'master' of https://github.com/source-academy/frontend i…
RichDom2185 Apr 13, 2024
d140c9c
Fix lint
RichDom2185 Apr 13, 2024
a0e036c
Migrate to new notifications API
RichDom2185 Apr 13, 2024
1e11d48
Merge branch 'master' into bump-deps-bp
RichDom2185 Apr 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@
"prepare": "husky"
},
"dependencies": {
"@blueprintjs/core": "^5.7.0",
"@blueprintjs/datetime2": "^2.2.7",
"@blueprintjs/icons": "^5.5.0",
"@blueprintjs/popover2": "^2.0.0",
"@blueprintjs/select": "^5.0.0",
"@blueprintjs/core": "^5.10.1",
"@blueprintjs/datetime2": "^2.3.3",
"@blueprintjs/icons": "^5.9.0",
"@blueprintjs/select": "^5.1.3",
"@mantine/hooks": "^7.7.0",
"@octokit/rest": "^20.0.0",
"@reduxjs/toolkit": "^1.9.7",
Expand Down
9 changes: 4 additions & 5 deletions src/commons/SimpleDropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { Button, Menu, MenuItem } from '@blueprintjs/core';
import { Popover2 } from '@blueprintjs/popover2';
import { Button, Menu, MenuItem, Popover } from '@blueprintjs/core';

type OptionType = { value: any; label: string };
type Props<T extends OptionType> = {
options: T[];
selectedValue?: T['value'];
onClick?: (v: T['value']) => void;
buttonProps?: Partial<React.ComponentProps<typeof Button> & { 'data-testid': string }>;
popoverProps?: Partial<React.ComponentProps<typeof Popover2>>;
popoverProps?: Partial<React.ComponentProps<typeof Popover>>;
};

const SimpleDropdown = <T extends OptionType>({
Expand All @@ -27,7 +26,7 @@ const SimpleDropdown = <T extends OptionType>({
};

return (
<Popover2
<Popover
{...popoverProps}
interactionKind="click"
content={
Expand All @@ -39,7 +38,7 @@ const SimpleDropdown = <T extends OptionType>({
}
>
<Button {...buttonProps}>{buttonLabel()}</Button>
</Popover2>
</Popover>
);
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Button, Checkbox, Dialog, EditableText } from '@blueprintjs/core';
import { Button, Checkbox, Dialog, EditableText, Tooltip } from '@blueprintjs/core';
import { IconNames } from '@blueprintjs/icons';
import { Tooltip2 } from '@blueprintjs/popover2';
import React, { useState } from 'react';
import { AchievementItem } from 'src/features/achievement/AchievementTypes';

Expand Down Expand Up @@ -33,9 +32,9 @@ const AchievementSettings: React.FC<Props> = ({

return (
<>
<Tooltip2 content="More Settings">
<Tooltip content="More Settings">
<Button icon={IconNames.WRENCH} onClick={toggleOpen} />
</Tooltip2>
</Tooltip>

<Dialog title="More Settings" icon={IconNames.WRENCH} isOpen={isOpen} onClose={toggleOpen}>
<div style={{ padding: '0 0.5em' }}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Button } from '@blueprintjs/core';
import { Button, Tooltip } from '@blueprintjs/core';
import { IconNames } from '@blueprintjs/icons';
import { Tooltip2 } from '@blueprintjs/popover2';
import React from 'react';
import { showSuccessMessage } from 'src/commons/utils/notifications/NotificationsHelper';

Expand All @@ -16,9 +15,9 @@ const AchievmenetUuidCopier: React.FC<Props> = ({ uuid }) => {
};

return (
<Tooltip2 content={hoverText}>
<Tooltip content={hoverText}>
<Button icon={IconNames.CLIPBOARD} onClick={copy} />
</Tooltip2>
</Tooltip>
);
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { EditableText, NumericInput } from '@blueprintjs/core';
import { EditableText, NumericInput, Tooltip } from '@blueprintjs/core';
import { IconNames } from '@blueprintjs/icons';
import { Tooltip2 } from '@blueprintjs/popover2';
import { cloneDeep } from 'lodash';
import React, { useContext, useMemo, useReducer, useState } from 'react';

Expand Down Expand Up @@ -225,7 +224,7 @@ const EditableCard: React.FC<Props> = ({
<EditableText onChange={changeTitle} placeholder="Enter your title here" value={title} />
</h3>
<div className="xp">
<Tooltip2 content="XP">
<Tooltip content="XP">
<NumericInput
value={xp}
min={0}
Expand All @@ -234,7 +233,7 @@ const EditableCard: React.FC<Props> = ({
placeholder="XP"
onValueChange={changeXp}
/>
</Tooltip2>
</Tooltip>
</div>
<div className="details">
<EditableDate changeDate={changeRelease} date={release} type="Release" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Button, Dialog } from '@blueprintjs/core';
import { Button, Dialog, Tooltip } from '@blueprintjs/core';
import { DatePicker } from '@blueprintjs/datetime';
import { Tooltip2 } from '@blueprintjs/popover2';
import React, { useState } from 'react';
import { prettifyDate } from 'src/commons/achievement/utils/DateHelper';

Expand All @@ -18,9 +17,9 @@ const EditableDate: React.FC<Props> = ({ type, date, changeDate }) => {

return (
<>
<Tooltip2 content={hoverText}>
<Tooltip content={hoverText}>
<Button minimal={true} onClick={toggleOpen} outlined={true}>{`${type}`}</Button>
</Tooltip2>
</Tooltip>
<Dialog
isCloseButtonShown={false}
isOpen={isOpen}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Button, Dialog, EditableText } from '@blueprintjs/core';
import { Button, Dialog, EditableText, Tooltip } from '@blueprintjs/core';
import { IconNames } from '@blueprintjs/icons';
import { Tooltip2 } from '@blueprintjs/popover2';
import React, { useState } from 'react';
import { AchievementView } from 'src/features/achievement/AchievementTypes';

Expand All @@ -25,9 +24,9 @@ const EditableView: React.FC<Props> = ({ changeView, view }) => {

return (
<>
<Tooltip2 content="Edit View">
<Tooltip content="Edit View">
<Button icon={IconNames.WIDGET_HEADER} onClick={toggleOpen} />
</Tooltip2>
</Tooltip>

<Dialog title="Edit View" icon={IconNames.WIDGET_HEADER} isOpen={isOpen} onClose={toggleOpen}>
<div style={{ padding: '0 0.5em' }}>
Expand Down
7 changes: 3 additions & 4 deletions src/commons/achievement/control/common/ItemDeleter.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Button } from '@blueprintjs/core';
import { Button, Tooltip } from '@blueprintjs/core';
import { IconNames } from '@blueprintjs/icons';
import { Tooltip2 } from '@blueprintjs/popover2';
import React from 'react';
import { showSimpleConfirmDialog } from 'src/commons/utils/DialogHelper';

Expand All @@ -23,9 +22,9 @@ const ItemDeleter: React.FC<Props> = ({ deleteItem, item }) => {
};

return (
<Tooltip2 content="Delete">
<Tooltip content="Delete">
<Button icon={IconNames.TRASH} intent="danger" onClick={confirmDelete} />
</Tooltip2>
</Tooltip>
);
};

Expand Down
11 changes: 5 additions & 6 deletions src/commons/achievement/control/common/ItemSaver.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Button } from '@blueprintjs/core';
import { Button, Tooltip } from '@blueprintjs/core';
import { IconNames } from '@blueprintjs/icons';
import { Tooltip2 } from '@blueprintjs/popover2';
import React from 'react';
import {
showSuccessMessage,
Expand All @@ -25,13 +24,13 @@ const ItemSaver: React.FC<Props> = ({ discardChanges, saveChanges }) => {

return (
<>
<Tooltip2 content="Save Changes">
<Tooltip content="Save Changes">
<Button icon={IconNames.FLOPPY_DISK} intent="primary" onClick={handleSaveChanges} />
</Tooltip2>
</Tooltip>

<Tooltip2 content="Discard Changes">
<Tooltip content="Discard Changes">
<Button icon={IconNames.CROSS} intent="danger" onClick={handleDiscardChanges} />
</Tooltip2>
</Tooltip>
</>
);
};
Expand Down
7 changes: 3 additions & 4 deletions src/commons/achievement/control/goalEditor/EditableDate.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Button, Dialog } from '@blueprintjs/core';
import { Button, Dialog, Tooltip } from '@blueprintjs/core';
import { DatePicker } from '@blueprintjs/datetime';
import { Tooltip2 } from '@blueprintjs/popover2';
import React, { useState } from 'react';
import { prettifyDate } from 'src/commons/achievement/utils/DateHelper';

Expand All @@ -18,9 +17,9 @@ const EditableDate: React.FC<Props> = ({ type, date, changeDate }) => {

return (
<>
<Tooltip2 content={hoverText}>
<Tooltip content={hoverText}>
<Button minimal={true} onClick={toggleOpen} outlined={true}>{`${type}`}</Button>
</Tooltip2>
</Tooltip>
<Dialog
isCloseButtonShown={false}
isOpen={isOpen}
Expand Down
7 changes: 3 additions & 4 deletions src/commons/achievement/control/goalEditor/EditableMeta.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Button, MenuItem } from '@blueprintjs/core';
import { Tooltip2 } from '@blueprintjs/popover2';
import { Button, MenuItem, Tooltip } from '@blueprintjs/core';
import { ItemRenderer, Select } from '@blueprintjs/select';
import React from 'react';
import {
Expand Down Expand Up @@ -51,7 +50,7 @@ const EditableMeta: React.FC<Props> = ({ changeMeta, meta }) => {

return (
<>
<Tooltip2 content="Change Goal Type">
<Tooltip content="Change Goal Type">
<TypeSelect
filterable={false}
itemRenderer={typeRenderer}
Expand All @@ -60,7 +59,7 @@ const EditableMeta: React.FC<Props> = ({ changeMeta, meta }) => {
>
<Button minimal={true} outlined={true} text={type} />
</TypeSelect>
</Tooltip2>
</Tooltip>
{editableMetaDetails(type)}
</>
);
Expand Down
7 changes: 3 additions & 4 deletions src/commons/achievement/control/goalEditor/EditableTime.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Button, Dialog } from '@blueprintjs/core';
import { Button, Dialog, Tooltip } from '@blueprintjs/core';
import { TimePicker } from '@blueprintjs/datetime';
import { Tooltip2 } from '@blueprintjs/popover2';
import React, { useState } from 'react';
import { prettifyTime } from 'src/commons/achievement/utils/DateHelper';

Expand All @@ -18,9 +17,9 @@ const EditableTime: React.FC<Props> = ({ type, time, changeTime }) => {

return (
<>
<Tooltip2 content={hoverText}>
<Tooltip content={hoverText}>
<Button minimal={true} onClick={toggleOpen} outlined={true}>{`${type}`}</Button>
</Tooltip2>
</Tooltip>
<Dialog
isCloseButtonShown={false}
isOpen={isOpen}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { NumericInput } from '@blueprintjs/core';
import { Tooltip2 } from '@blueprintjs/popover2';
import { NumericInput, Tooltip } from '@blueprintjs/core';
import React from 'react';
import { AssessmentMeta, GoalMeta } from 'src/features/achievement/AchievementTypes';

Expand All @@ -21,15 +20,15 @@ const EditableAssessmentMeta: React.FC<Props> = ({ assessmentMeta, changeMeta })

return (
<>
<Tooltip2 content="Assessment Number">
<Tooltip content="Assessment Number">
<NumericInput
allowNumericCharactersOnly={true}
onValueChange={changeAssessmentNumber}
placeholder="Enter assessment number here"
value={assessmentNumber}
/>
</Tooltip2>
<Tooltip2 content="Required Completion Percentage">
</Tooltip>
<Tooltip content="Required Completion Percentage">
<NumericInput
allowNumericCharactersOnly={true}
max={100}
Expand All @@ -39,7 +38,7 @@ const EditableAssessmentMeta: React.FC<Props> = ({ assessmentMeta, changeMeta })
rightElement={<p>%</p>}
value={requiredCompletionFrac * 100}
/>
</Tooltip2>
</Tooltip>
</>
);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Button, EditableText, MenuItem, NumericInput } from '@blueprintjs/core';
import { Button, EditableText, MenuItem, NumericInput, Tooltip } from '@blueprintjs/core';
import { IconNames } from '@blueprintjs/icons';
import { Tooltip2 } from '@blueprintjs/popover2';
import { ItemRenderer, Select } from '@blueprintjs/select';
import React from 'react';
import { BinaryMeta, GoalMeta } from 'src/features/achievement/AchievementTypes';
Expand Down Expand Up @@ -113,26 +112,26 @@ const EditableBinaryMeta: React.FC<Props> = ({ binaryMeta, changeMeta }) => {
idx % 2 === 0 ? (
// the text to change the condition
<>
<Tooltip2 content="Condition">
<Tooltip content="Condition">
<EditableText
onChange={value => changeConditionArray(value, idx / 2)}
multiline={true}
placeholder="Enter condition here"
value={op}
/>
</Tooltip2>
</Tooltip>
{
// should only be deleteable if not the only condition
conditions.length > 1 && (
<Tooltip2 content="Delete Condition">
<Tooltip content="Delete Condition">
<Button intent="danger" icon="trash" onClick={() => deleteCondition(idx)} />
</Tooltip2>
</Tooltip>
)
}
</>
) : (
// the button to choose the joiner to use
<Tooltip2 content="And/Or">
<Tooltip content="And/Or">
<JoinerSelect
filterable={false}
itemRenderer={joinerRenderer}
Expand All @@ -141,7 +140,7 @@ const EditableBinaryMeta: React.FC<Props> = ({ binaryMeta, changeMeta }) => {
>
<Button minimal={true} outlined={true} text={op} />
</JoinerSelect>
</Tooltip2>
</Tooltip>
)
}
</div>
Expand All @@ -150,7 +149,7 @@ const EditableBinaryMeta: React.FC<Props> = ({ binaryMeta, changeMeta }) => {

return (
<>
<Tooltip2 content="Target Count">
<Tooltip content="Target Count">
<NumericInput
allowNumericCharactersOnly={true}
leftIcon={IconNames.BANK_ACCOUNT}
Expand All @@ -159,7 +158,7 @@ const EditableBinaryMeta: React.FC<Props> = ({ binaryMeta, changeMeta }) => {
placeholder="Enter target count here"
value={targetCount}
/>
</Tooltip2>
</Tooltip>
{generateConditions()}
<br />
<Button minimal={true} outlined={true} text="Add Condition" onClick={addCondition} />
Expand Down
Loading
Loading