Skip to content

Commit

Permalink
Add migration data functionality (#785)
Browse files Browse the repository at this point in the history
* Fix handle empty url in profile deletion

* Add migration data functionality

* Change BackgroundCurved zIndex so migration link is clickable on dashboard

Add migration data functionality

---------

Co-authored-by: llunaCreixent <elesmp@protonmail.com>
  • Loading branch information
mikozet and llunaCreixent authored Jul 3, 2024
1 parent efb3a4e commit f217f31
Show file tree
Hide file tree
Showing 17 changed files with 388 additions and 10 deletions.
19 changes: 18 additions & 1 deletion locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,23 @@
"headingLogin": "Login",
"inputPlaceholder": "Start typing...",
"linkSupport": "Send an email",
"successWelcome": "Successfully connected to account. Welcome!"
"successWelcome": "Successfully connected to account. Welcome!",
"migrationText1": "Circles Garden profile data is being migrated. You can read about this here:",
"migrationText2": "Please login and visit the 'profile-migrate' page to confirm your preference",
"migrationText3": "Please visit the 'profile-migrate' page to confirm your preference"
},
"MigrateYourProfile": {
"title": "Migrate Your Profile",
"body1": "If you accept the migration of your user profile, this will mean that your data will be transferred to the new Circles team (Gnosis Chain).",
"body2": "At the end of the migration period, all the data that is not transferred will be deleted from current databases.",
"body3": "Your wallet, seed phrase, and CRC will not be deleted regardless of your choice and you will still be able to access to your wallet via circles.garden.",
"body4": "You can read about this here:",
"labelForm": "Do you consent to the migration of your profile data to the new Circles team?",
"option1": "Yes",
"option2": "no",
"buttonSubmit": "Submit",
"confirmationMsg": "You have successfully updated your migration data status",
"errorMsg": "Sorry, there was a problem with saving changes."
},
"MyProfile": {
"buttonCreateOrganization": "Create Shared Wallet",
Expand All @@ -218,6 +234,7 @@
"buttonDoublePeople": "Trust People",
"buttonSendCircles": "Send Circles",
"buttonOrganization": "Create Shared Wallet",
"buttonMigration": "Migrate Your Profile",
"linkAbout": "About",
"linkBugReporting": "Report Bugs",
"linkFAQ": "FAQ",
Expand Down
37 changes: 33 additions & 4 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"webpack-dev-server": "^3.11.3"
},
"dependencies": {
"@circles/core": "^4.9.1",
"@circles/core": "^4.10.0",
"@circles/timecircles": "^1.0.6",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
Expand Down
4 changes: 4 additions & 0 deletions src/components/Navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { generatePath } from 'react-router-dom';

import {
ACTIVITIES_PATH,
MIGRATION_PATH,
MY_PROFILE_PATH,
ORGANIZATION_PATH,
SEARCH_PATH,
Expand Down Expand Up @@ -151,6 +152,9 @@ const NavigationMain = ({ onClick }) => {
<NavigationLink to={SETTINGS_PATH} onClick={onClick}>
{translate('Navigation.buttonSettings')}
</NavigationLink>
<NavigationLink to={MIGRATION_PATH} onClick={onClick}>
{translate('Navigation.buttonMigration')}
</NavigationLink>
</Box>
);
};
Expand Down
6 changes: 6 additions & 0 deletions src/components/NavigationFloating.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Link } from 'react-router-dom';

import {
EDIT_PROFILE_PATH,
MIGRATION_PATH,
MY_PROFILE_PATH,
ORGANIZATION_MEMBERS_PATH,
} from '~/routes';
Expand Down Expand Up @@ -187,6 +188,11 @@ export default function NavigationFloating(props) {
}}
onClose={handleClose}
>
<MenuItem onClick={handleClose}>
<Link to={MIGRATION_PATH}>
<Button isOutline>{translate('Navigation.buttonMigration')}</Button>
</Link>
</MenuItem>
{props.isAddMembersLink && (
<MenuItem onClick={handleClose}>
<Link to={ORGANIZATION_MEMBERS_PATH}>
Expand Down
7 changes: 7 additions & 0 deletions src/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import DashboardOrganization from '~/views/DashboardOrganization';
import EditProfile from '~/views/EditProfile';
import Error from '~/views/Error';
import Login from '~/views/Login';
import MigrateYourProfile from '~/views/MigrateYourProfile';
import NotFound from '~/views/NotFound';
import Onboarding from '~/views/Onboarding';
import OnboardingOrganization from '~/views/OnboardingOrganization';
Expand Down Expand Up @@ -37,6 +38,7 @@ export const ACTIVITIES_PATH = '/activities';
export const DASHBOARD_PATH = '/';
export const EDIT_PROFILE_PATH = '/edit';
export const LOGIN_PATH = '/welcome/login';
export const MIGRATION_PATH = '/profile-migrate';
export const ONBOARDING_PATH = '/welcome/onboarding';
export const ORGANIZATION_MEMBERS_ADD_PATH = '/sharedwallet/members/add';
export const ORGANIZATION_MEMBERS_PATH = '/sharedwallet/members';
Expand Down Expand Up @@ -264,6 +266,11 @@ const Routes = () => {
<TrustedRoute component={Share} exact path={SHARE_PATH} />
<TrustedRoute component={Profile} exact path={PROFILE_PATH} />
<TrustedRoute component={Activities} exact path={ACTIVITIES_PATH} />
<TrustedRoute
component={MigrateYourProfile}
exact
path={MIGRATION_PATH}
/>
<TrustedRoute component={EditProfile} exact path={EDIT_PROFILE_PATH} />
<TrustedRoute component={QRGenerator} exact path={QR_GENERATOR_PATH} />
<TrustedRoute component={Search} exact path={SEARCH_PATH} />
Expand Down
16 changes: 16 additions & 0 deletions src/services/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,22 @@ const user = {
safeAddress,
});
},

updateProfileMigrationConsent: async (
safeAddress,
profileMigrationConsent,
) => {
return await requestCore('user', 'updateProfileMigrationConsent', {
safeAddress,
profileMigrationConsent,
});
},

getProfileMigrationConsent: async (safeAddress) => {
return await requestCore('user', 'getProfileMigrationConsent', {
safeAddress,
});
},
};

const avatar = {
Expand Down
Loading

0 comments on commit f217f31

Please sign in to comment.