larxius commited on
Commit
7201337
·
verified ·
1 Parent(s): 035676d

Update frontend/src/pages/SuperAdminPanel.jsx

Browse files
frontend/src/pages/SuperAdminPanel.jsx CHANGED
@@ -436,7 +436,7 @@ const SuperAdminPanel = () => {
436
  };
437
 
438
  const handleProvisionTenant = () => {
439
- setPromptValues({ tier: 'free', name: '' });
440
  setPromptModal({
441
  isOpen: true,
442
  title: 'Add New Organization',
@@ -448,11 +448,9 @@ const SuperAdminPanel = () => {
448
  label: 'Subscription Tier',
449
  type: 'select',
450
  options: [
451
- { label: 'Free', value: 'free' },
452
  { label: 'Quick', value: 'quick' },
453
- { label: 'Standard', value: 'standard' },
454
  { label: 'Advanced', value: 'advanced' },
455
- { label: 'Enterprise', value: 'enterprise' },
456
  { label: 'Enterprise(Custom)', value: 'Enterprise(Custom)' }
457
  ]
458
  }
@@ -543,11 +541,17 @@ const SuperAdminPanel = () => {
543
  };
544
 
545
  const handleEditTenant = (org) => {
546
- const rawTier = (org.tier || org.subscription_tier || 'free');
547
- const isCustom = rawTier.toLowerCase().includes('custom');
 
 
 
 
 
 
548
  setPromptValues({
549
  name: org.name,
550
- tier: isCustom ? 'Enterprise(Custom)' : rawTier.toLowerCase()
551
  });
552
  setPromptModal({
553
  isOpen: true,
@@ -560,11 +564,9 @@ const SuperAdminPanel = () => {
560
  label: 'Subscription Tier',
561
  type: 'select',
562
  options: [
563
- { label: 'Free', value: 'free' },
564
  { label: 'Quick', value: 'quick' },
565
- { label: 'Standard', value: 'standard' },
566
  { label: 'Advanced', value: 'advanced' },
567
- { label: 'Enterprise', value: 'enterprise' },
568
  { label: 'Enterprise(Custom)', value: 'Enterprise(Custom)' }
569
  ]
570
  }
 
436
  };
437
 
438
  const handleProvisionTenant = () => {
439
+ setPromptValues({ tier: 'quick', name: '' });
440
  setPromptModal({
441
  isOpen: true,
442
  title: 'Add New Organization',
 
448
  label: 'Subscription Tier',
449
  type: 'select',
450
  options: [
 
451
  { label: 'Quick', value: 'quick' },
 
452
  { label: 'Advanced', value: 'advanced' },
453
+ { label: 'Deep', value: 'deep' },
454
  { label: 'Enterprise(Custom)', value: 'Enterprise(Custom)' }
455
  ]
456
  }
 
541
  };
542
 
543
  const handleEditTenant = (org) => {
544
+ const rawTier = (org.tier || org.subscription_tier || 'quick');
545
+ const isCustom = rawTier.toLowerCase().includes('custom') || rawTier.toLowerCase().includes('enterprise');
546
+ const initialTier = isCustom
547
+ ? 'Enterprise(Custom)'
548
+ : ['quick', 'advanced', 'deep'].includes(rawTier.toLowerCase())
549
+ ? rawTier.toLowerCase()
550
+ : 'quick';
551
+
552
  setPromptValues({
553
  name: org.name,
554
+ tier: initialTier
555
  });
556
  setPromptModal({
557
  isOpen: true,
 
564
  label: 'Subscription Tier',
565
  type: 'select',
566
  options: [
 
567
  { label: 'Quick', value: 'quick' },
 
568
  { label: 'Advanced', value: 'advanced' },
569
+ { label: 'Deep', value: 'deep' },
570
  { label: 'Enterprise(Custom)', value: 'Enterprise(Custom)' }
571
  ]
572
  }