Removed settings page mock data and replaced with api calls
This commit is contained in:
@@ -195,7 +195,7 @@ export const RulesSection: React.FC<RulesSectionProps> = ({
|
||||
programmeId: Number(rule.programmeId),
|
||||
name: rule.name || '',
|
||||
description: rule.description || '',
|
||||
version: Number(rule.version) || 1,
|
||||
version: Number(rule.version) > 0 ? Number(rule.version) : 1,
|
||||
status: Number(rule.status),
|
||||
});
|
||||
setIsModalOpen(true);
|
||||
@@ -577,19 +577,26 @@ export const RulesSection: React.FC<RulesSectionProps> = ({
|
||||
{/* Version & Status */}
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
||||
<div>
|
||||
<div className="flex items-center gap-1 mb-1">
|
||||
<label className="block text-xs font-semibold text-slate-300">Rule Version</label>
|
||||
<HelpTooltip
|
||||
title="Rule Version"
|
||||
content="Integer version tracking revisions of this statutory rule."
|
||||
size="sm"
|
||||
/>
|
||||
<div className="flex items-center justify-between mb-1">
|
||||
<div className="flex items-center gap-1">
|
||||
<label className="block text-xs font-semibold text-slate-300">Rule Version</label>
|
||||
<HelpTooltip
|
||||
title="Rule Version"
|
||||
content="System-managed version number tracking revisions of this statutory rule (read-only)."
|
||||
size="sm"
|
||||
/>
|
||||
</div>
|
||||
<span className="text-[10px] font-mono uppercase tracking-wider text-slate-500 bg-slate-800/60 px-1.5 py-0.5 rounded border border-slate-700/50">
|
||||
Read-Only
|
||||
</span>
|
||||
</div>
|
||||
<input
|
||||
type="number"
|
||||
min="1"
|
||||
readOnly
|
||||
tabIndex={-1}
|
||||
{...ruleForm.register('version')}
|
||||
className="w-full px-3 py-2 text-xs bg-[#090d16] border border-slate-700 rounded-xl text-slate-200 focus:outline-none focus:ring-1 focus:ring-blue-500 font-mono"
|
||||
className="w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/70 rounded-xl text-slate-400 font-mono cursor-not-allowed select-none focus:outline-none focus:ring-0 focus:border-slate-700/70"
|
||||
/>
|
||||
{ruleForm.formState.errors.version && (
|
||||
<p className="text-red-400 text-[11px] mt-1">
|
||||
|
||||
Reference in New Issue
Block a user