{
- if (hasMetadata) {
- return handleMetadataClick(row.original.fullResource);
- }
- if (isAdmin) {
- return handleMetadataClick(row.original.fullResource);
+ if (hasMetadata || isAdmin) {
+ handleMetadataClick(row.original.fullResource);
}
}}
title={
@@ -551,38 +964,38 @@ const ISL = () => {
}),
...(isAdmin
? [
- columnHelper.display({
- id: "actions",
- header: "Actions",
- cell: ({ row }) => (
-
-
-
-
-
- ),
- }),
- ]
+ columnHelper.display({
+ id: "actions",
+ header: "Actions",
+ cell: ({ row }) => (
+
+
+
+
+
+ ),
+ }),
+ ]
: []),
],
- [data, isAdmin, isEditor]
+ [data, isAdmin, isEditor],
) as ColumnDef
[];
return (
diff --git a/frontend/src/utils/api.ts b/frontend/src/utils/api.ts
index 123827f..119d55f 100644
--- a/frontend/src/utils/api.ts
+++ b/frontend/src/utils/api.ts
@@ -446,6 +446,35 @@ export const deleteISLBibles = async (
return res.data;
};
+export const getISLVerseMarker = async (isl_bible_id: number) => {
+ const res = await API.get(`/isl-verse-markers`, {
+ params: { isl_bible_id },
+ });
+ return res.data;
+};
+
+export const uploadISLVerseMarkers = async (
+ payload: Record
+) => {
+ const res = await API.post(`/isl-verse-markers`, payload);
+ return res.data;
+};
+
+export const updateISLVerseMarker = async (
+ isl_bible_id: number,
+ markers: { verse: number | string; time: string }[]
+) => {
+ const res = await API.put(`/isl-verse-markers/${isl_bible_id}`, { markers });
+ return res.data;
+};
+
+export const deleteISLVerseMarkers = async (isl_bible_ids: number[]) => {
+ const res = await API.delete(`/isl-verse-markers/bulk-delete`, {
+ data: { isl_bible_ids },
+ });
+ return res.data;
+};
+
export const getCommentaries = async (resource_id: number) => {
const res = await API.get(`/commentary/${resource_id}`);
return res.data;
diff --git a/frontend/src/utils/types.ts b/frontend/src/utils/types.ts
index 8d8267f..127877d 100644
--- a/frontend/src/utils/types.ts
+++ b/frontend/src/utils/types.ts
@@ -329,6 +329,8 @@ export interface ContentTypeActionProps {
identityKey: string;
normalizeApiRow?: (row: any) => E;
remoteTestConfig?: RemoteTestConfig;
+ viewOnlyColumns?: ColumnDef[];
+ extraViewActions?: React.ReactNode;
}
export interface DuplicateCsvDialogProps {
@@ -360,6 +362,8 @@ export interface UploadOrViewDialogProps {
normalizeApiRow?: (row: any) => any;
clearPreview?: () => void;
remoteTestConfig?: RemoteTestConfig;
+ viewOnlyColumns?: ColumnDef[];
+ extraViewActions?: React.ReactNode;
}
// dictionaries
diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts
index 326b90b..559c00a 100644
--- a/frontend/vite.config.ts
+++ b/frontend/vite.config.ts
@@ -1,14 +1,17 @@
-import path from "path"
-import { defineConfig } from 'vite'
-import tailwindcss from "@tailwindcss/vite"
-import react from '@vitejs/plugin-react'
+import path from "path";
+import { defineConfig } from "vite";
+import tailwindcss from "@tailwindcss/vite";
+import react from "@vitejs/plugin-react";
// https://vite.dev/config/
export default defineConfig({
plugins: [react(), tailwindcss()],
+ server: {
+ allowedHosts: ["admin.vachanengine.org"],
+ },
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
-})
+});