forked from baron/baron-sso
feat: remove auto-selection of affiliate by email domain and clean up UI
This commit is contained in:
@@ -45,7 +45,6 @@ class _SignupScreenState extends State<SignupScreen> {
|
||||
bool _isPhoneVerified = false;
|
||||
String _affiliationType = 'GENERAL';
|
||||
String? _companyCode;
|
||||
bool _isAffiliateEmail = false; // 가족사 이메일 여부
|
||||
bool _termsAccepted = false;
|
||||
bool _privacyAccepted = false;
|
||||
bool _isLoading = false;
|
||||
@@ -56,7 +55,6 @@ class _SignupScreenState extends State<SignupScreen> {
|
||||
|
||||
// Dynamic Tenants
|
||||
List<Map<String, dynamic>> _tenants = [];
|
||||
final Map<String, String> _affiliateDomains = {};
|
||||
|
||||
// Inline Errors
|
||||
String? _emailError;
|
||||
@@ -83,14 +81,6 @@ class _SignupScreenState extends State<SignupScreen> {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_tenants = tenants;
|
||||
_affiliateDomains.clear();
|
||||
for (var t in tenants) {
|
||||
if (t['domains'] != null) {
|
||||
for (var d in (t['domains'] as List)) {
|
||||
_affiliateDomains[d.toString().toLowerCase()] = t['slug'];
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
@@ -125,35 +115,11 @@ class _SignupScreenState extends State<SignupScreen> {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
// 이메일 입력 시 도메인 체크 로직
|
||||
// 이메일 입력 시 도메인 체크 로직 (자동 선택 제거)
|
||||
void _checkEmailAffiliation(String email) {
|
||||
if (!email.contains('@')) {
|
||||
if (_isAffiliateEmail) {
|
||||
setState(() {
|
||||
_isAffiliateEmail = false;
|
||||
_affiliationType = 'GENERAL';
|
||||
_companyCode = null;
|
||||
});
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
final domain = email.split('@').last.toLowerCase();
|
||||
if (_affiliateDomains.containsKey(domain)) {
|
||||
setState(() {
|
||||
_isAffiliateEmail = true;
|
||||
_affiliationType = 'AFFILIATE';
|
||||
_companyCode = _affiliateDomains[domain];
|
||||
});
|
||||
} else {
|
||||
if (_isAffiliateEmail) {
|
||||
setState(() {
|
||||
_isAffiliateEmail = false;
|
||||
_affiliationType = 'GENERAL';
|
||||
_companyCode = null;
|
||||
});
|
||||
}
|
||||
}
|
||||
// Note: We no longer auto-set _companyCode or _affiliationType based on domain
|
||||
// as per user requirement (same domain can belong to different affiliates).
|
||||
return;
|
||||
}
|
||||
|
||||
void _startTimer(String type) {
|
||||
@@ -1450,55 +1416,46 @@ class _SignupScreenState extends State<SignupScreen> {
|
||||
const SizedBox(height: 18),
|
||||
_buildProfileFieldGroup(
|
||||
title: tr('ui.userfront.signup.profile.affiliation_type'),
|
||||
description: _isAffiliateEmail
|
||||
? tr('msg.userfront.signup.profile.affiliate_hint')
|
||||
: '소속 유형과 회사 정보를 입력합니다.',
|
||||
description: '소속 유형과 회사 정보를 입력합니다.',
|
||||
isDesktop: isDesktop,
|
||||
trailing: _isAffiliateEmail
|
||||
? _buildAutoDetectedBadge()
|
||||
: null,
|
||||
trailing: null,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
AbsorbPointer(
|
||||
absorbing: _isAffiliateEmail,
|
||||
child: Opacity(
|
||||
opacity: _isAffiliateEmail ? 0.7 : 1.0,
|
||||
child: DropdownButtonFormField<String>(
|
||||
key: ValueKey(_affiliationType),
|
||||
initialValue: _affiliationType,
|
||||
decoration: InputDecoration(
|
||||
labelText: tr(
|
||||
'ui.userfront.signup.profile.affiliation_type',
|
||||
),
|
||||
border: const OutlineInputBorder(),
|
||||
),
|
||||
items: [
|
||||
DropdownMenuItem(
|
||||
value: 'GENERAL',
|
||||
child: Text(
|
||||
tr('domain.affiliation.general'),
|
||||
),
|
||||
),
|
||||
DropdownMenuItem(
|
||||
value: 'AFFILIATE',
|
||||
child: Text(
|
||||
tr('domain.affiliation.affiliate'),
|
||||
),
|
||||
),
|
||||
],
|
||||
onChanged: _isAffiliateEmail
|
||||
? null
|
||||
: (val) {
|
||||
if (val == null) {
|
||||
return;
|
||||
}
|
||||
setState(() {
|
||||
_affiliationType = val;
|
||||
});
|
||||
},
|
||||
DropdownButtonFormField<String>(
|
||||
key: ValueKey(_affiliationType),
|
||||
initialValue: _affiliationType,
|
||||
decoration: InputDecoration(
|
||||
labelText: tr(
|
||||
'ui.userfront.signup.profile.affiliation_type',
|
||||
),
|
||||
border: const OutlineInputBorder(),
|
||||
),
|
||||
items: [
|
||||
DropdownMenuItem(
|
||||
value: 'GENERAL',
|
||||
child: Text(
|
||||
tr('domain.affiliation.general'),
|
||||
),
|
||||
),
|
||||
DropdownMenuItem(
|
||||
value: 'AFFILIATE',
|
||||
child: Text(
|
||||
tr('domain.affiliation.affiliate'),
|
||||
),
|
||||
),
|
||||
],
|
||||
onChanged: (val) {
|
||||
if (val == null) {
|
||||
return;
|
||||
}
|
||||
setState(() {
|
||||
_affiliationType = val;
|
||||
if (_affiliationType == 'GENERAL') {
|
||||
_companyCode = null;
|
||||
}
|
||||
});
|
||||
},
|
||||
),
|
||||
AnimatedSize(
|
||||
duration: const Duration(milliseconds: 180),
|
||||
@@ -1508,31 +1465,23 @@ class _SignupScreenState extends State<SignupScreen> {
|
||||
children: [
|
||||
if (_affiliationType == 'AFFILIATE') ...[
|
||||
const SizedBox(height: 14),
|
||||
AbsorbPointer(
|
||||
absorbing: _isAffiliateEmail,
|
||||
child: Opacity(
|
||||
opacity: _isAffiliateEmail ? 0.7 : 1.0,
|
||||
child: DropdownButtonFormField<String>(
|
||||
key: ValueKey(_companyCode ?? 'none'),
|
||||
initialValue: _companyCode,
|
||||
decoration: InputDecoration(
|
||||
labelText: tr(
|
||||
'ui.userfront.signup.profile.company',
|
||||
),
|
||||
border: const OutlineInputBorder(),
|
||||
),
|
||||
items: _tenants.map((t) {
|
||||
return DropdownMenuItem<String>(
|
||||
value: t['slug'],
|
||||
child: Text(t['name'] ?? t['slug']),
|
||||
);
|
||||
}).toList(),
|
||||
onChanged: _isAffiliateEmail
|
||||
? null
|
||||
: (val) => setState(
|
||||
() => _companyCode = val,
|
||||
),
|
||||
DropdownButtonFormField<String>(
|
||||
key: ValueKey(_companyCode ?? 'none'),
|
||||
initialValue: _companyCode,
|
||||
decoration: InputDecoration(
|
||||
labelText: tr(
|
||||
'ui.userfront.signup.profile.company',
|
||||
),
|
||||
border: const OutlineInputBorder(),
|
||||
),
|
||||
items: _tenants.map((t) {
|
||||
return DropdownMenuItem<String>(
|
||||
value: t['slug'],
|
||||
child: Text(t['name'] ?? t['slug']),
|
||||
);
|
||||
}).toList(),
|
||||
onChanged: (val) => setState(
|
||||
() => _companyCode = val,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -1577,9 +1526,7 @@ class _SignupScreenState extends State<SignupScreen> {
|
||||
}
|
||||
|
||||
Widget _buildProfileInfoNoticeCard({required bool isDesktop}) {
|
||||
final description = _isAffiliateEmail
|
||||
? '가족사 이메일이 확인되어 소속 유형이 자동으로 고정됩니다.'
|
||||
: '회원가입 후 사용할 기본 소속 정보를 입력합니다.';
|
||||
const description = '회원가입 후 사용할 기본 소속 정보를 입력합니다.';
|
||||
|
||||
return DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
@@ -1679,23 +1626,6 @@ class _SignupScreenState extends State<SignupScreen> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildAutoDetectedBadge() {
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 6),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFEEF2FF),
|
||||
borderRadius: BorderRadius.circular(999),
|
||||
border: Border.all(color: const Color(0xFFC7D2FE)),
|
||||
),
|
||||
child: const Text(
|
||||
'자동 선택',
|
||||
style: TextStyle(
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: Color(0xFF4338CA),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
String _buildPolicyDescription() {
|
||||
|
||||
Reference in New Issue
Block a user