Compare commits
1 Commits
main
...
feat/env-t
| Author | SHA1 | Date |
|---|---|---|
|
|
98e6f11395 |
|
|
@ -99,6 +99,7 @@ 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[]>([]);
|
||||
|
|
@ -157,6 +158,10 @@ export const ModuleBuilderTabContent: React.FC = () => {
|
|||
|
||||
useEffect(() => {
|
||||
fetchModules();
|
||||
moduleBuilderService
|
||||
.getConfig()
|
||||
.then((cfg) => setSyncRepoEnabled(Boolean(cfg?.sync_repo_enabled)))
|
||||
.catch(() => setSyncRepoEnabled(false));
|
||||
}, []);
|
||||
|
||||
// Compute active module object
|
||||
|
|
@ -1273,6 +1278,7 @@ export const ModuleBuilderTabContent: React.FC = () => {
|
|||
</div>
|
||||
</button>
|
||||
|
||||
{syncRepoEnabled && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
|
|
@ -1292,6 +1298,7 @@ export const ModuleBuilderTabContent: React.FC = () => {
|
|||
</div>
|
||||
</div>
|
||||
</button>
|
||||
)}
|
||||
|
||||
<div className="my-1 border-t border-slate-100" />
|
||||
|
||||
|
|
|
|||
|
|
@ -219,6 +219,12 @@ 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