Update environment configuration and enhance user management features
- Changed VITE_SUPABASE_URL in .env.example for deployment consistency. - Added new user management functionality to reset user passwords in UserManagement component. - Updated supabase.ts to include first and last name fields in user profiles and added password reset functionality. - Enhanced DashboardLayout to include a user profile view and improved user display in TopNavbar. - Updated seed.sql to create additional users with roles for testing purposes.
This commit is contained in:
@@ -47,8 +47,8 @@ INSERT INTO auth.users (
|
||||
);
|
||||
|
||||
-- Create user profile
|
||||
INSERT INTO public.user_profiles (id, email, status)
|
||||
SELECT id, email, 'active'
|
||||
INSERT INTO public.user_profiles (id, email, first_name, last_name, status)
|
||||
SELECT id, email, 'Alireza', 'Vaezi', 'active'
|
||||
FROM auth.users
|
||||
WHERE email = 's.alireza.v@gmail.com'
|
||||
;
|
||||
@@ -66,7 +66,443 @@ AND r.name = 'admin'
|
||||
;
|
||||
|
||||
-- =============================================
|
||||
-- 3. CREATE EXPERIMENT PHASES
|
||||
-- 3. CREATE ADDITIONAL USERS
|
||||
-- =============================================
|
||||
|
||||
-- Create Claire Floyd (Conductor & Data Recorder)
|
||||
INSERT INTO auth.users (
|
||||
instance_id,
|
||||
id,
|
||||
aud,
|
||||
role,
|
||||
email,
|
||||
encrypted_password,
|
||||
email_confirmed_at,
|
||||
created_at,
|
||||
updated_at,
|
||||
confirmation_token,
|
||||
email_change,
|
||||
email_change_token_new,
|
||||
recovery_token
|
||||
) VALUES (
|
||||
'00000000-0000-0000-0000-000000000000',
|
||||
uuid_generate_v4(),
|
||||
'authenticated',
|
||||
'authenticated',
|
||||
'Ashlyn.Floyd@uga.edu',
|
||||
crypt('password123', gen_salt('bf')),
|
||||
NOW(),
|
||||
NOW(),
|
||||
NOW(),
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
''
|
||||
);
|
||||
|
||||
INSERT INTO public.user_profiles (id, email, first_name, last_name, status)
|
||||
SELECT id, email, 'Claire', 'Floyd', 'active'
|
||||
FROM auth.users
|
||||
WHERE email = 'Ashlyn.Floyd@uga.edu'
|
||||
;
|
||||
|
||||
INSERT INTO public.user_roles (user_id, role_id, assigned_by)
|
||||
SELECT
|
||||
up.id,
|
||||
r.id,
|
||||
(SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')
|
||||
FROM public.user_profiles up
|
||||
CROSS JOIN public.roles r
|
||||
WHERE up.email = 'Ashlyn.Floyd@uga.edu'
|
||||
AND r.name IN ('conductor', 'data recorder')
|
||||
;
|
||||
|
||||
-- Create Bruna Dos-Santos (Conductor & Data Recorder)
|
||||
INSERT INTO auth.users (
|
||||
instance_id,
|
||||
id,
|
||||
aud,
|
||||
role,
|
||||
email,
|
||||
encrypted_password,
|
||||
email_confirmed_at,
|
||||
created_at,
|
||||
updated_at,
|
||||
confirmation_token,
|
||||
email_change,
|
||||
email_change_token_new,
|
||||
recovery_token
|
||||
) VALUES (
|
||||
'00000000-0000-0000-0000-000000000000',
|
||||
uuid_generate_v4(),
|
||||
'authenticated',
|
||||
'authenticated',
|
||||
'bkvsantos@uga.edu',
|
||||
crypt('password123', gen_salt('bf')),
|
||||
NOW(),
|
||||
NOW(),
|
||||
NOW(),
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
''
|
||||
);
|
||||
|
||||
INSERT INTO public.user_profiles (id, email, first_name, last_name, status)
|
||||
SELECT id, email, 'Bruna', 'Dos-Santos', 'active'
|
||||
FROM auth.users
|
||||
WHERE email = 'bkvsantos@uga.edu'
|
||||
;
|
||||
|
||||
INSERT INTO public.user_roles (user_id, role_id, assigned_by)
|
||||
SELECT
|
||||
up.id,
|
||||
r.id,
|
||||
(SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')
|
||||
FROM public.user_profiles up
|
||||
CROSS JOIN public.roles r
|
||||
WHERE up.email = 'bkvsantos@uga.edu'
|
||||
AND r.name IN ('conductor', 'data recorder')
|
||||
;
|
||||
|
||||
-- Create Beni Rodriguez (Conductor & Data Recorder)
|
||||
INSERT INTO auth.users (
|
||||
instance_id,
|
||||
id,
|
||||
aud,
|
||||
role,
|
||||
email,
|
||||
encrypted_password,
|
||||
email_confirmed_at,
|
||||
created_at,
|
||||
updated_at,
|
||||
confirmation_token,
|
||||
email_change,
|
||||
email_change_token_new,
|
||||
recovery_token
|
||||
) VALUES (
|
||||
'00000000-0000-0000-0000-000000000000',
|
||||
uuid_generate_v4(),
|
||||
'authenticated',
|
||||
'authenticated',
|
||||
'Beni.Rodriguez@uga.edu',
|
||||
crypt('password123', gen_salt('bf')),
|
||||
NOW(),
|
||||
NOW(),
|
||||
NOW(),
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
''
|
||||
);
|
||||
|
||||
INSERT INTO public.user_profiles (id, email, first_name, last_name, status)
|
||||
SELECT id, email, 'Beni', 'Rodriguez', 'active'
|
||||
FROM auth.users
|
||||
WHERE email = 'Beni.Rodriguez@uga.edu'
|
||||
;
|
||||
|
||||
INSERT INTO public.user_roles (user_id, role_id, assigned_by)
|
||||
SELECT
|
||||
up.id,
|
||||
r.id,
|
||||
(SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')
|
||||
FROM public.user_profiles up
|
||||
CROSS JOIN public.roles r
|
||||
WHERE up.email = 'Beni.Rodriguez@uga.edu'
|
||||
AND r.name IN ('conductor', 'data recorder')
|
||||
;
|
||||
|
||||
-- Create Brendan Surio (Data Recorder)
|
||||
INSERT INTO auth.users (
|
||||
instance_id,
|
||||
id,
|
||||
aud,
|
||||
role,
|
||||
email,
|
||||
encrypted_password,
|
||||
email_confirmed_at,
|
||||
created_at,
|
||||
updated_at,
|
||||
confirmation_token,
|
||||
email_change,
|
||||
email_change_token_new,
|
||||
recovery_token
|
||||
) VALUES (
|
||||
'00000000-0000-0000-0000-000000000000',
|
||||
uuid_generate_v4(),
|
||||
'authenticated',
|
||||
'authenticated',
|
||||
'Brendan.Surio@uga.edu',
|
||||
crypt('password123', gen_salt('bf')),
|
||||
NOW(),
|
||||
NOW(),
|
||||
NOW(),
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
''
|
||||
);
|
||||
|
||||
INSERT INTO public.user_profiles (id, email, first_name, last_name, status)
|
||||
SELECT id, email, 'Brendan', 'Surio', 'active'
|
||||
FROM auth.users
|
||||
WHERE email = 'Brendan.Surio@uga.edu'
|
||||
;
|
||||
|
||||
INSERT INTO public.user_roles (user_id, role_id, assigned_by)
|
||||
SELECT
|
||||
up.id,
|
||||
r.id,
|
||||
(SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')
|
||||
FROM public.user_profiles up
|
||||
CROSS JOIN public.roles r
|
||||
WHERE up.email = 'Brendan.Surio@uga.edu'
|
||||
AND r.name = 'data recorder'
|
||||
;
|
||||
|
||||
-- Create William Mcconnell (Data Recorder)
|
||||
INSERT INTO auth.users (
|
||||
instance_id,
|
||||
id,
|
||||
aud,
|
||||
role,
|
||||
email,
|
||||
encrypted_password,
|
||||
email_confirmed_at,
|
||||
created_at,
|
||||
updated_at,
|
||||
confirmation_token,
|
||||
email_change,
|
||||
email_change_token_new,
|
||||
recovery_token
|
||||
) VALUES (
|
||||
'00000000-0000-0000-0000-000000000000',
|
||||
uuid_generate_v4(),
|
||||
'authenticated',
|
||||
'authenticated',
|
||||
'William.McConnell@uga.edu',
|
||||
crypt('password123', gen_salt('bf')),
|
||||
NOW(),
|
||||
NOW(),
|
||||
NOW(),
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
''
|
||||
);
|
||||
|
||||
INSERT INTO public.user_profiles (id, email, first_name, last_name, status)
|
||||
SELECT id, email, 'William', 'Mcconnell', 'active'
|
||||
FROM auth.users
|
||||
WHERE email = 'William.McConnell@uga.edu'
|
||||
;
|
||||
|
||||
INSERT INTO public.user_roles (user_id, role_id, assigned_by)
|
||||
SELECT
|
||||
up.id,
|
||||
r.id,
|
||||
(SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')
|
||||
FROM public.user_profiles up
|
||||
CROSS JOIN public.roles r
|
||||
WHERE up.email = 'William.McConnell@uga.edu'
|
||||
AND r.name = 'data recorder'
|
||||
;
|
||||
|
||||
-- Create Camille Deguzman (Data Recorder)
|
||||
INSERT INTO auth.users (
|
||||
instance_id,
|
||||
id,
|
||||
aud,
|
||||
role,
|
||||
email,
|
||||
encrypted_password,
|
||||
email_confirmed_at,
|
||||
created_at,
|
||||
updated_at,
|
||||
confirmation_token,
|
||||
email_change,
|
||||
email_change_token_new,
|
||||
recovery_token
|
||||
) VALUES (
|
||||
'00000000-0000-0000-0000-000000000000',
|
||||
uuid_generate_v4(),
|
||||
'authenticated',
|
||||
'authenticated',
|
||||
'cpd08598@uga.edu',
|
||||
crypt('password123', gen_salt('bf')),
|
||||
NOW(),
|
||||
NOW(),
|
||||
NOW(),
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
''
|
||||
);
|
||||
|
||||
INSERT INTO public.user_profiles (id, email, first_name, last_name, status)
|
||||
SELECT id, email, 'Camille', 'Deguzman', 'active'
|
||||
FROM auth.users
|
||||
WHERE email = 'cpd08598@uga.edu'
|
||||
;
|
||||
|
||||
INSERT INTO public.user_roles (user_id, role_id, assigned_by)
|
||||
SELECT
|
||||
up.id,
|
||||
r.id,
|
||||
(SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')
|
||||
FROM public.user_profiles up
|
||||
CROSS JOIN public.roles r
|
||||
WHERE up.email = 'cpd08598@uga.edu'
|
||||
AND r.name = 'data recorder'
|
||||
;
|
||||
|
||||
-- Create Justin Hetzler (Data Recorder)
|
||||
INSERT INTO auth.users (
|
||||
instance_id,
|
||||
id,
|
||||
aud,
|
||||
role,
|
||||
email,
|
||||
encrypted_password,
|
||||
email_confirmed_at,
|
||||
created_at,
|
||||
updated_at,
|
||||
confirmation_token,
|
||||
email_change,
|
||||
email_change_token_new,
|
||||
recovery_token
|
||||
) VALUES (
|
||||
'00000000-0000-0000-0000-000000000000',
|
||||
uuid_generate_v4(),
|
||||
'authenticated',
|
||||
'authenticated',
|
||||
'Justin.Hetzler@uga.edu',
|
||||
crypt('password123', gen_salt('bf')),
|
||||
NOW(),
|
||||
NOW(),
|
||||
NOW(),
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
''
|
||||
);
|
||||
|
||||
INSERT INTO public.user_profiles (id, email, first_name, last_name, status)
|
||||
SELECT id, email, 'Justin', 'Hetzler', 'active'
|
||||
FROM auth.users
|
||||
WHERE email = 'Justin.Hetzler@uga.edu'
|
||||
;
|
||||
|
||||
INSERT INTO public.user_roles (user_id, role_id, assigned_by)
|
||||
SELECT
|
||||
up.id,
|
||||
r.id,
|
||||
(SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')
|
||||
FROM public.user_profiles up
|
||||
CROSS JOIN public.roles r
|
||||
WHERE up.email = 'Justin.Hetzler@uga.edu'
|
||||
AND r.name = 'data recorder'
|
||||
;
|
||||
|
||||
-- Create Joshua Wilson (Data Recorder)
|
||||
INSERT INTO auth.users (
|
||||
instance_id,
|
||||
id,
|
||||
aud,
|
||||
role,
|
||||
email,
|
||||
encrypted_password,
|
||||
email_confirmed_at,
|
||||
created_at,
|
||||
updated_at,
|
||||
confirmation_token,
|
||||
email_change,
|
||||
email_change_token_new,
|
||||
recovery_token
|
||||
) VALUES (
|
||||
'00000000-0000-0000-0000-000000000000',
|
||||
uuid_generate_v4(),
|
||||
'authenticated',
|
||||
'authenticated',
|
||||
'jdw58940@uga.edu',
|
||||
crypt('password123', gen_salt('bf')),
|
||||
NOW(),
|
||||
NOW(),
|
||||
NOW(),
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
''
|
||||
);
|
||||
|
||||
INSERT INTO public.user_profiles (id, email, first_name, last_name, status)
|
||||
SELECT id, email, 'Joshua', 'Wilson', 'active'
|
||||
FROM auth.users
|
||||
WHERE email = 'jdw58940@uga.edu'
|
||||
;
|
||||
|
||||
INSERT INTO public.user_roles (user_id, role_id, assigned_by)
|
||||
SELECT
|
||||
up.id,
|
||||
r.id,
|
||||
(SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')
|
||||
FROM public.user_profiles up
|
||||
CROSS JOIN public.roles r
|
||||
WHERE up.email = 'jdw58940@uga.edu'
|
||||
AND r.name = 'data recorder'
|
||||
;
|
||||
|
||||
-- Create Sydney Orlofsky (Data Recorder)
|
||||
INSERT INTO auth.users (
|
||||
instance_id,
|
||||
id,
|
||||
aud,
|
||||
role,
|
||||
email,
|
||||
encrypted_password,
|
||||
email_confirmed_at,
|
||||
created_at,
|
||||
updated_at,
|
||||
confirmation_token,
|
||||
email_change,
|
||||
email_change_token_new,
|
||||
recovery_token
|
||||
) VALUES (
|
||||
'00000000-0000-0000-0000-000000000000',
|
||||
uuid_generate_v4(),
|
||||
'authenticated',
|
||||
'authenticated',
|
||||
'Sydney.Orlofsky@uga.edu',
|
||||
crypt('password123', gen_salt('bf')),
|
||||
NOW(),
|
||||
NOW(),
|
||||
NOW(),
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
''
|
||||
);
|
||||
|
||||
INSERT INTO public.user_profiles (id, email, first_name, last_name, status)
|
||||
SELECT id, email, 'Sydney', 'Orlofsky', 'active'
|
||||
FROM auth.users
|
||||
WHERE email = 'Sydney.Orlofsky@uga.edu'
|
||||
;
|
||||
|
||||
INSERT INTO public.user_roles (user_id, role_id, assigned_by)
|
||||
SELECT
|
||||
up.id,
|
||||
r.id,
|
||||
(SELECT id FROM public.user_profiles WHERE email = 's.alireza.v@gmail.com')
|
||||
FROM public.user_profiles up
|
||||
CROSS JOIN public.roles r
|
||||
WHERE up.email = 'Sydney.Orlofsky@uga.edu'
|
||||
AND r.name = 'data recorder'
|
||||
;
|
||||
|
||||
-- =============================================
|
||||
-- 4. CREATE EXPERIMENT PHASES
|
||||
-- =============================================
|
||||
|
||||
-- Create "Phase 2 of JC Experiments" phase
|
||||
@@ -80,7 +516,7 @@ WHERE up.email = 's.alireza.v@gmail.com'
|
||||
;
|
||||
|
||||
-- =============================================
|
||||
-- 4. INSERT EXPERIMENTS (First 10 as example)
|
||||
-- 5. INSERT EXPERIMENTS (First 10 as example)
|
||||
-- =============================================
|
||||
|
||||
INSERT INTO public.experiments (
|
||||
@@ -130,7 +566,7 @@ INSERT INTO public.experiments (
|
||||
;
|
||||
|
||||
-- =============================================
|
||||
-- 5. CREATE SAMPLE EXPERIMENT REPETITIONS
|
||||
-- 6. CREATE SAMPLE EXPERIMENT REPETITIONS
|
||||
-- =============================================
|
||||
|
||||
-- Create repetitions for first 5 experiments as examples
|
||||
|
||||
Reference in New Issue
Block a user