Compare commits
No commits in common. "feat/env-toggle-module-repo-sync" and "main" have entirely different histories.
feat/env-t
...
main
|
|
@ -99,7 +99,6 @@ export const ModuleBuilderTabContent: React.FC = () => {
|
|||
const [creatingModule, setCreatingModule] = useState(false);
|
||||
const [exportingZip, setExportingZip] = useState(false);
|
||||
const [syncingRepo, setSyncingRepo] = useState(false);
|
||||
const [syncRepoEnabled, setSyncRepoEnabled] = useState(false);
|
||||
const [showExportMenu, setShowExportMenu] = useState(false);
|
||||
|
||||
const [categories, setCategories] = useState<BuilderCategorySummary[]>([]);
|
||||
|
|
@ -158,10 +157,6 @@ export const ModuleBuilderTabContent: React.FC = () => {
|
|||
|
||||
useEffect(() => {
|
||||
fetchModules();
|
||||
moduleBuilderService
|
||||
.getConfig()
|
||||
.then((cfg) => setSyncRepoEnabled(Boolean(cfg?.sync_repo_enabled)))
|
||||
.catch(() => setSyncRepoEnabled(false));
|
||||
}, []);
|
||||
|
||||
// Compute active module object
|
||||
|
|
@ -1278,27 +1273,25 @@ export const ModuleBuilderTabContent: React.FC = () => {
|
|||
</div>
|
||||
</button>
|
||||
|
||||
{syncRepoEnabled && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
setShowExportMenu(false);
|
||||
handleSyncContentRepo();
|
||||
}}
|
||||
disabled={syncingRepo}
|
||||
className="w-full text-left px-3.5 py-2.5 hover:bg-emerald-50/50 flex items-start gap-2.5 transition-colors group"
|
||||
>
|
||||
<UploadCloud className="h-4 w-4 text-emerald-600 mt-0.5 shrink-0" />
|
||||
<div>
|
||||
<div className="text-xs font-bold text-slate-800 group-hover:text-emerald-600">
|
||||
Sync to Server Repository
|
||||
</div>
|
||||
<div className="text-[10px] text-slate-400">
|
||||
Compile and write directly to server content repository
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
setShowExportMenu(false);
|
||||
handleSyncContentRepo();
|
||||
}}
|
||||
disabled={syncingRepo}
|
||||
className="w-full text-left px-3.5 py-2.5 hover:bg-emerald-50/50 flex items-start gap-2.5 transition-colors group"
|
||||
>
|
||||
<UploadCloud className="h-4 w-4 text-emerald-600 mt-0.5 shrink-0" />
|
||||
<div>
|
||||
<div className="text-xs font-bold text-slate-800 group-hover:text-emerald-600">
|
||||
Sync to Server Repository
|
||||
</div>
|
||||
</button>
|
||||
)}
|
||||
<div className="text-[10px] text-slate-400">
|
||||
Compile and write directly to server content repository
|
||||
</div>
|
||||
</div>
|
||||
</button>
|
||||
|
||||
<div className="my-1 border-t border-slate-100" />
|
||||
|
||||
|
|
|
|||
|
|
@ -219,12 +219,6 @@ export const moduleBuilderService = {
|
|||
return res.data;
|
||||
},
|
||||
|
||||
// Feature config
|
||||
async getConfig(): Promise<{ sync_repo_enabled: boolean }> {
|
||||
const res = await api.get('/api/admin/module-builder/config');
|
||||
return res.data;
|
||||
},
|
||||
|
||||
// Import JSON
|
||||
async importModuleJson(moduleCode: string, contents: any[]): Promise<any> {
|
||||
const res = await api.post(`/api/admin/module-builder/${moduleCode}/import-json`, { contents });
|
||||
|
|
|
|||
Loading…
Reference in New Issue