Skip to content

Commit 6102f8b

Browse files
committed
feat: refactor extended profile fields implementation and remove unused components
1 parent 5e587fd commit 6102f8b

File tree

13 files changed

+28
-682
lines changed

13 files changed

+28
-682
lines changed
Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,31 @@
11
import { PluginSlot } from '@openedx/frontend-plugin-framework';
2-
import ExtendedProfileFields from '../../profile/extended-profile';
3-
4-
const ExtendedProfileFieldsSlot = () => (
5-
<PluginSlot
6-
id="org.openedx.frontend.profile.extended_profile_fields.v1"
7-
idAliases={['extended_profile_fields_plugin']}
8-
>
9-
<ExtendedProfileFields />
10-
</PluginSlot>
11-
);
2+
import { useDispatch, useSelector } from 'react-redux';
3+
4+
import { patchProfile } from '../../profile/data/services';
5+
import { fetchProfile } from '../../profile/data/actions';
6+
7+
import SwitchContent from '../../profile/forms/elements/SwitchContent';
8+
import EmptyContent from '../../profile/forms/elements/EmptyContent';
9+
import EditableItemHeader from '../../profile/forms/elements/EditableItemHeader';
10+
11+
const ExtendedProfileFieldsSlot = () => {
12+
const dispatch = useDispatch();
13+
const extendedProfileValues = useSelector((state) => state.profilePage.account.extendedProfile);
14+
15+
return (
16+
<PluginSlot
17+
id="org.openedx.frontend.profile.extended_profile_fields.v1"
18+
idAliases={['extended_profile_fields_slot']}
19+
pluginProps={{
20+
fetchProfile: (username) => dispatch(fetchProfile(username)),
21+
patchProfile,
22+
extendedProfileValues,
23+
SwitchContent,
24+
EmptyContent,
25+
EditableItemHeader,
26+
}}
27+
/>
28+
);
29+
};
1230

1331
export default ExtendedProfileFieldsSlot;

src/profile/extended-profile/ExtendedProfileContext.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/profile/extended-profile/ExtendedProfileProvider.jsx

Lines changed: 0 additions & 63 deletions
This file was deleted.

src/profile/extended-profile/constants.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/profile/extended-profile/data/service.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/profile/extended-profile/index.jsx

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/profile/extended-profile/messages.jsx

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/profile/extended-profile/profile-fields/elements/BaseField.jsx

Lines changed: 0 additions & 188 deletions
This file was deleted.

0 commit comments

Comments
 (0)