Skip to content

Commit fe2562d

Browse files
committed
fix error reporting for local_dashboard
1 parent cd51d0c commit fe2562d

File tree

9 files changed

+53
-28
lines changed

9 files changed

+53
-28
lines changed
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
{
22
"env": {
3-
"MAILSLURP_API_KEY": "***REMOVED***"
3+
"MAILSLURP_API_KEY": "***REMOVED***",
4+
"COLLABORATOR_USER":"[email protected]",
5+
"COLLABORATOR_PASS":"[email protected]",
6+
"OWNER_PASS": "***REMOVED***",
7+
"NEW_PASS" : "***REMOVED***"
48
},
59
"defaultCommandTimeout": 120000,
610
"responseTimeout": 120000,
711
"requestTimeout": 120000,
8-
"baseUrl":"https://dashboard-dev.terminusdb.com/",
12+
"baseUrl":"http://localhost:3030/",
913
"chromeWebSecurity": false
1014
}

packages/tdb-dashboard/cypress/integration/dashboard/login.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ describe('visit dashboard dev', () => {
1010
const dashboard = "https://dashboard-dev.terminusdb.com/"
1111
let ownerPass = Cypress.env('OWNER_PASS')
1212
const newPass = Cypress.env('NEW_PASS')
13-
let emailAddressOwner = '' //"[email protected]"
14-
let inboxIdOwner = '' //"[email protected]"
13+
let emailAddressOwner = ''
14+
let inboxIdOwner = ''
1515
//const collaboratorEmail =
1616

1717
before(function () {
@@ -103,14 +103,11 @@ let teamName = "shared_team"
103103
it('check that you can create a new Team', ()=>{
104104
userLogin()
105105
teamName = `${teamName}__${Date.now()}`
106-
cy.get('#profile_menu_arrow').click()
107-
cy.get('#profile').click()
108-
cy.get('#profile_open_create_new_team_modal').click()
106+
cy.get('#team_page_open_create_new_team_modal').click()
109107
cy.get('input#team_id').type(teamName).trigger('change');
110108
cy.get('#create_new_team_button').click()
111109
cy.wait(5000)
112110
cy.get('#team_list_nenu_button').should("contain",teamName)
113-
114111
})
115112

116113

packages/tdb-dashboard/cypress/integration/dashboard/workflow.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
//emf7V3RaiDXCsx$#@%yy
88
describe('visit dashboard dev', () => {
99
const dashboard = "/"//"https://dashboard-dev.terminusdb.com/"
10-
10+
11+
let emailAddressOwner = Cypress.env('COLLABORATOR_USER')
1112
let ownerPass = Cypress.env('COLLABORATOR_USER')
12-
const newPass = Cypress.env('COLLABORATOR_PASS')
1313

1414
//const collaboratorEmail =
1515

@@ -30,6 +30,14 @@ describe('visit dashboard dev', () => {
3030
userLogin()
3131
})
3232

33+
34+
it('check that you can select a team', ()=>{
35+
cy.get('#cypress_test').click() //
36+
cy.location().should((loc) => {
37+
expect(loc.pathname).to.eq('/cypress_test')
38+
})
39+
})
40+
3341

3442
let dataProduct
3543
it('check that you can create a new dataProduct', ()=>{
@@ -84,7 +92,7 @@ describe('visit dashboard dev', () => {
8492
const squash_commit_message = "squash test"
8593
it('Check that a new branch can be added', ()=>{
8694
// check that the dataproduct is in the dataproduct list
87-
cy.get(`a#data_products`).click()
95+
cy.get(`a#HOME`).click()
8896
cy.get(`#home_show_branches`).click()
8997
cy.get('#home_open_create_new_branch_modal').click()
9098

@@ -122,7 +130,7 @@ it('Check that the new branch has 2 commits', ()=>{
122130

123131
it('check that you can get a dataProduct', ()=>{
124132
// check that the dataproduct is in the dataproduct list
125-
cy.get(`a#data_products`).click()
133+
cy.get(`a#HOME`).click()
126134
cy.get(`#${dataProduct}`).find('span').should("contain",dataProduct)
127135
})
128136

packages/tdb-dashboard/src/components/ChangeUser.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {Button} from "react-bootstrap"
33
import {RiUser3Fill} from "react-icons/ri"
44
import { LoginModal } from "./LoginModal";
55

6-
export const ChangeUser = ({css}) => {
6+
export const ChangeUser = ({css, label}) => {
77
const [showModal, setShowModal] = useState(false)
88

99
function handleNew (evt) {
@@ -12,9 +12,11 @@ export const ChangeUser = ({css}) => {
1212

1313
const extracss = css || ""
1414

15+
const labelStr = label || "Change User"
16+
1517
return <React.Fragment>
1618
<Button id="new_data_product" variant="info" className={`mr-1 ml-1 pt-2 pb-2 pr-4 pl-4 btn ${extracss}`} title="Create New Data Product" onClick={handleNew}>
17-
<RiUser3Fill className="me-2"/>Change User
19+
<RiUser3Fill className="me-2"/>{labelStr}
1820
</Button>
1921
<LoginModal setShowModal={setShowModal} showModal={showModal}/>
2022
</React.Fragment>

packages/tdb-dashboard/src/components/ServerError.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const ServerError = (props) => {
2424
}
2525
{clientUser && clientUser.connection_type ==="LOCAL" &&
2626
<div>
27-
<ChangeUser/>
27+
<ChangeUser label="Login to TerminusDB"/>
2828
</div>
2929
}
3030
</div>

packages/tdb-dashboard/src/hooks/hookUtils.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ export function getBaseUrlFeedback(){
3636

3737
export function formatErrorMessage (err){
3838
let message = err.message
39-
if(err.data && err.data["api:message"]){
39+
if(err.data && err.data["api:message"]){
40+
if( err.data["api:message"] === "Incorrect authentication information"){
41+
return "Incorrect authentication information, please enter your username and password again"
42+
}
4043
message = err.data["api:message"]
4144
}else if (message.indexOf("Network Error")>-1){
4245
message = "Network Error"

packages/tdb-dashboard/src/pages/Home.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
import React from "react"
1+
import React,{useState} from "react"
22
import { Layout } from "./Layout"
33
import {NoDataProductSelectedStyle} from "../components/constants"
44
import {WOQLClientObj} from '../init-woql-client'
55
import {Card, Row, Col, Button,Container} from "react-bootstrap"
66
import {useNavigate} from "react-router-dom"
77
import {RiTeamLine} from "react-icons/ri"
8+
import {NewTeamModal} from "../components/NewTeamModal"
9+
import {BsFillPeopleFill} from "react-icons/bs"
810

911
export const Home = () => {
10-
const {woqlClient,changeOrganization} = WOQLClientObj()
12+
const {woqlClient,changeOrganization,clientUser} = WOQLClientObj()
1113
if(!woqlClient) return ""
14+
const [showNewMemberModal, setShowNewMemberModal] = useState(false)
1215

1316
const teamList = woqlClient.userOrganizations()
1417
let navigate = useNavigate()
@@ -24,11 +27,19 @@ export const Home = () => {
2427
<Col xs={12} className="text-center d-block align-items-center justify-content-center">
2528
<h3 className="text-success mt-5 mb-4">
2629
<RiTeamLine className="mr-2"/> Select a Team
27-
</h3>
30+
{ clientUser && clientUser.connection_type !== "LOCAL" &&
31+
<React.Fragment>
32+
<Button id="team_page_open_create_new_team_modal" className="ml-4 btn-info mt-4 mb-4" onClick={()=>{setShowNewMemberModal(true)}}>
33+
<BsFillPeopleFill className="mr-2"/>Create a new Team
34+
</Button>
35+
<NewTeamModal show={showNewMemberModal} setShow={setShowNewMemberModal} />
36+
</React.Fragment>
37+
}
38+
</h3>
2839
<Row>
2940
{teamList.map((item,index) =>{
3041
return <Col md={4} className="py-2 doc-summary-card" key={`key___${index}`}>
31-
<Button className="bg-transparent border-0 p-0 w-100" onClick={(e) => changeOrganizationHandler(item.name)}>
42+
<Button id={item.name} className="bg-transparent border-0 p-0 w-100" onClick={(e) => changeOrganizationHandler(item.name)}>
3243
<Card bg="dark" style={{maxHeight: "220px", cursor: "pointer"}} >
3344
<Card.Header className="bg-transparent border-0 d-flex text-wrap">
3445
</Card.Header>

packages/tdb-react-components/package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/tdb-react-components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"react-dom": "^16.0.0"
4444
},
4545
"dependencies": {
46-
"@terminusdb/terminusdb-client": "^10.0.13",
46+
"@terminusdb/terminusdb-client": "^10.0.14",
4747
"bootstrap": "^4.5.3",
4848
"classnames": "^2.2.5",
4949
"codemirror": "^5.59.1",

0 commit comments

Comments
 (0)