Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions packages/tdb-dashboard/src/components/NewDatabaseModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {BiPlus} from "react-icons/bi"
import {TERMINUS_DANGER} from "./constants"
import {Alerts} from "./Alerts"
import {useNavigate,useParams} from "react-router-dom"
import { UTILS } from "@terminusdb/terminusdb-client"
import {UTILS} from "@terminusdb/terminusdb-client"
import {Loading} from "../components/Loading"
import { ManageDatabase } from "../hooks/ManageDatabase"
export const NewDatabaseModal = ({showModal, setShowModal, dbDetails = null}) => {
Expand All @@ -26,7 +26,7 @@ export const NewDatabaseModal = ({showModal, setShowModal, dbDetails = null}) =>
const startlabel = dbDetails && dbDetails.label ? dbDetails.label : ''
const startComment = dbDetails && dbDetails.comment ? dbDetails.comment : ''
const title = startid ? `Update the Dataproduct ${startid} details` : 'New Data Product'
const loadingMessage = startid ? `Updating ${startid}` : `Creating ${label}`
const loadingMessage = startid ? `Updating ${startid}` : `Creating ${startid}`
const defValueId = startid ? {style:{display:"none"}} : {}
const action = startid ? {onClick:handleUpdate} : {onClick:handleCreate}
const buttonLabel = startid ? "Update Dataproduct" : CREATE_NEW_DATA_PRODUCT_BUTTON.label
Expand All @@ -37,8 +37,6 @@ export const NewDatabaseModal = ({showModal, setShowModal, dbDetails = null}) =>

let navigate = useNavigate();



async function handleCreate () {
const result = await createDatabase(id,label,description)
if(result){
Expand Down
5 changes: 5 additions & 0 deletions packages/tdb-dashboard/src/hooks/hookUtils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { localSettings } from "../../localSettings";
import { getCRConflictError } from "../components/utils"
import React from "react"
export function getOptions(token){

const options = {
Expand Down Expand Up @@ -40,6 +41,10 @@ export function formatErrorMessage (err){
let message = err.message
if (message.indexOf("Network Error")>-1){
message = "Network Error"
if(localSettings.connection_type === "LOCAL"){
message =`Network Error the ${localSettings.server} is not running.
You need to use docker compose to use the dashboard`
}
}else if(err.data){
if( err.data["api:message"] === "Incorrect authentication information"){
message = "Incorrect authentication information, wrong username or password"
Expand Down
2 changes: 1 addition & 1 deletion packages/tdb-dashboard/src/pages/GraphqlHandlerbarsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export function GraphqlHandlerbarsPage({}) {
const getDocumentClassesList=()=>{
return <Form.Select aria-label="Default select example" onChange={setData}>
<option value={""}>Select a document</option>
{documentClasses && documentClasses.map(item=>{
{Array.isArray(documentClasses) && documentClasses.map(item=>{
return <option key={item['@id']} value={item['@id']}>{item['@id']}</option>
})}
</Form.Select>
Expand Down