- {RADIO4000_APP_NAME_MINI} Migration Tool
+ Radio4000 migration (v1 → v2)
{/* {!session && Login} */}
{session && (
<>
diff --git a/src/index.css b/src/index.css
index 0dab685..d1ed1ce 100644
--- a/src/index.css
+++ b/src/index.css
@@ -12,6 +12,3 @@
@import url("./styles/command-menu.css");
@import url("./styles/tracks.css");
@import url("./styles/tags.css");
-
-/* plugin overwrites */
-@import url("./styles/firebaseui.css");
diff --git a/src/pages/auth/login.js b/src/pages/auth/login.js
index 69dc22e..237d0df 100644
--- a/src/pages/auth/login.js
+++ b/src/pages/auth/login.js
@@ -34,16 +34,17 @@ export default function PageLogin(props) {
{/* Log in to Radio4000 */}
{/* */}
{/*
*/}
-
-
- Don't have one yet? Create one on beta.radio4000.com
+
+ {/* */}
+ Migration of a v1 radio4000 channel, requires a v2 user account.
+ If you don't have one yet,create it then come back here
>
- ) : (
+ ) : (
<>
You are logged in.
- >
- )
+ >
+ )
}
function LoginInfo({onResetPassword}) {
diff --git a/src/pages/auth/logout.js b/src/pages/auth/logout.js
index f9e3b86..6dc696a 100644
--- a/src/pages/auth/logout.js
+++ b/src/pages/auth/logout.js
@@ -8,7 +8,7 @@ export default function PageLogout({
useEffect(() => {
if (session) {
signOut().finally(() => {
- navigate('/login', { replace: true })
+ navigate('/', { replace: true })
})
}
navigate('/login', { replace: true })
diff --git a/src/pages/create/channel/import.js b/src/pages/create/channel/import.js
index dbf96b4..b72f3de 100644
--- a/src/pages/create/channel/import.js
+++ b/src/pages/create/channel/import.js
@@ -1,6 +1,7 @@
import React, {useState} from 'react'
import {Link} from 'react-router-dom'
import FirebaseAuth from 'components/firebase-ui/auth'
+import AuthForm from 'components/auth-form'
import ErrorDisplay from 'components/error-display'
// import LoginRequired from 'components/login-required'
@@ -11,7 +12,7 @@ import useUserChannelFirebase from 'hooks/use-user-channel-firebase'
// This is not how to do it (?), but we can delay figuring it out until we need Firebase in a second place.
startFirebase()
-export default function PageNewChannelImport({dbSession: {radio4000ApiUrl, session}}) {
+export default function PageNewChannelImport({dbSession: {radio4000ApiUrl, session, signIn}}) {
const [loading, setLoading] = useState(false)
const [error, setError] = useState(false)
const [migrationResult, setMigrationResult] = useState(false)
@@ -22,6 +23,18 @@ export default function PageNewChannelImport({dbSession: {radio4000ApiUrl, sessi
const tokenSupabase = session?.access_token
const tokenFirebase = sessionFirebase?.accessToken
+ const handleSignIn = async (data) => {
+ let res
+ try {
+ res = await signIn(data)
+ if (!res.error) {
+ }
+ } catch (error) {
+ console.log('Error login-in', error)
+ }
+ return res
+ }
+
const startMigration = async () => {
setLoading(true)
try {
@@ -64,40 +77,54 @@ export default function PageNewChannelImport({dbSession: {radio4000ApiUrl, sessi
return (
<>
- This tool will help you migrate your old Radio4000 channel to the new system.
-
- You will need an account for each. You can not use your old Radio4000 account to sign in to
- the new.
-
-
- {/* LOGIN STUFF */}
-
- Old account
- {sessionFirebase?.email ? (
-
- ✔ {sessionFirebase.email}{' '}
-
-
- ) : (
-
- )}
-
- New account
- {session?.user?.email ? (
-
- ✔ {session?.user.email} Log out
-
- ) : (
-
- Sign in to your NEW Radio4000 account
-
- )}
-
- {/* MIGRATE STUFF */}
- {sessionFirebase?.email && session?.user?.email && (
- <>
+ Radio channel migration from v1.radio4000.com to v2.radio4000.com
+
+ -
+ Requires 2 existing accounts: a v1 and a v2 account
+
+ -
+ Log in v1 and v2 accounts
+
+ -
+ Click "import", wait a few seconds, visit your new radio page!
+
+ -
+ After migration, log out the 2 account here, and optionally delete your v1 account.
+
+
+
+ {/* LOGIN STUFF */}
+
+
+
+ Login v1 account
+ {sessionFirebase?.email ? (
+
+ ✔ {sessionFirebase.email}{' '}
+
+
+ ) : (
+
+ )}
+
+
+
+ Login v2 account
+ {session?.user?.email ? (
+
+ ✔ {session?.user.email} Log out
+
+ ) : (
+
+ )}
+
+
+
+ {/* MIGRATE STUFF */}
+ {sessionFirebase?.email && session?.user?.email ? (
+ <>
{!migrationResult && !userChannelFirebase ? (
This old Radio4000 account has no channel to migrate.
@@ -108,9 +135,11 @@ export default function PageNewChannelImport({dbSession: {radio4000ApiUrl, sessi
) : (
- Ready to import the radio channel @{userChannelFirebase.slug} into
- the new Radio4000 system.
+ Start channel migration
+
+ Import channel @{userChannelFirebase.slug} into radio4000 v2.
+
+
>
)
}
diff --git a/src/styles/defaults.css b/src/styles/defaults.css
index ccddf8f..e16fe03 100644
--- a/src/styles/defaults.css
+++ b/src/styles/defaults.css
@@ -45,9 +45,6 @@ h3 select {
max-width: 10em;
margin-left: 0.5rem;
}
-h1, h2, h3, h4, h5, h6 {
- margin-top: 0;
-}
/* 48, 36, 24, 19, 16*/
h1 {
font-size: 1.5em;
diff --git a/src/styles/firebaseui.css b/src/styles/firebaseui.css
deleted file mode 100644
index ad4153f..0000000
--- a/src/styles/firebaseui.css
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- firebaseui-react-web
-*/
-
-#firebaseui_container {
- max-width: 20em;
- margin: 0 0 1em;
- padding: 1em;
- border-radius: 0.1em;
- border: 1px dashed var(--theme);
-}
-
-#firebaseui_container::after {
- content: 'What did you use to sign in to your radio channel?';
- text-align: center;
- font-size: 0.8em;
- font-style: italic;
- color: var(--theme);
- display: flex;
- padding: 1em;
-}
-
-.firebaseui-container,
-.firebaseui-idp-list,
-.firebaseui-tenant-list {
- max-width: none !important;
-}
-
-.firebaseui-card-content {
- padding: 0 !important;
-}
-.firebaseui-idp-list > .firebaseui-list-item,
-.firebaseui-tenant-list > .firebaseui-list-item {
- text-align: left !important;
-}
diff --git a/src/styles/layout-themes.css b/src/styles/layout-themes.css
index a201ac8..5378274 100644
--- a/src/styles/layout-themes.css
+++ b/src/styles/layout-themes.css
@@ -40,6 +40,7 @@ body,
flex-direction: column;
flex-grow: 1;
min-height: 100%;
+ align-items: center;
}
/* Themes */
@@ -55,7 +56,6 @@ html,
scroll-behavior: smooth;
padding: 1em 1.5em 0;
width: 100%;
- background-color: var(--bg-color);
color: var(--text-color);
transition: background-color ease-in-out 100ms, color ease-in-out 100ms;
}
@@ -82,3 +82,26 @@ html,
border-top: 1px solid var(--darkgray);
background: var(--bg-color);
}
+
+
+.Layout ol {
+ text-align: left;
+}
+
+/* migration only */
+r4-migration-step {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+ background-color: var(--bg-color);
+ border-radius: 0.3rem;
+ padding: 1rem;
+ margin: 0.5rem;
+
+}
+r4-migration-step h3 {
+ padding: 1rem;
+}
+r4-migration-step p {
+ margin-bottom: 0;
+}
diff --git a/src/utils/commands.js b/src/utils/commands.js
index 5599cef..31db707 100644
--- a/src/utils/commands.js
+++ b/src/utils/commands.js
@@ -9,36 +9,36 @@ export default function createCommands({isSignedIn, navigate, userChannel}) {
},
})
- commands.push({
- label: 'Go to channels',
- action: () => {
- navigate('/channels')
- },
- })
+ /* commands.push({
+ label: 'Go to channels',
+ action: () => {
+ navigate('/channels')
+ },
+ }) */
// Has a channel
if (userChannel) {
- commands.push({
- label: `Go to your channel: ${userChannel.name}`,
- keys: 'g c',
- action: () => navigate(`/${userChannel.slug}`),
- })
- commands.push({
- label: `Create track`,
- keys: 'c c',
- action: () => navigate('/create/track'),
- })
- commands.push({
- label: `Edit your channel`,
- keys: 'g e',
- action: () => navigate(`/${userChannel.slug}/edit`),
- })
+ /* commands.push({
+ label: `Go to your channel: ${userChannel.name}`,
+ keys: 'g c',
+ action: () => navigate(`/${userChannel.slug}`),
+ }) */
+ /* commands.push({
+ label: `Create track`,
+ keys: 'c c',
+ action: () => navigate('/create/track'),
+ }) */
+ /* commands.push({
+ label: `Edit your channel`,
+ keys: 'g e',
+ action: () => navigate(`/${userChannel.slug}/edit`),
+ }) */
// Does not have a channel
} else {
- commands.push({
- label: `Create new channel`,
- action: () => navigate(`/create/channel`),
- })
+ /* commands.push({
+ label: `Create new channel`,
+ action: () => navigate(`/create/channel`),
+ }) */
commands.push({
label: `Import channel`,
action: () => navigate(`/create/channel/import`),