Skip to content

Commit 514c279

Browse files
committed
review change request
2 parents c5cda9f + 5ecf422 commit 514c279

25 files changed

+625
-728
lines changed

packages/tdb-dashboard/cypress/e2e/dashboard/login.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ it('check that you can create a new Team', ()=>{
107107
cy.get('input#team_id').type(teamName).trigger('change');
108108
cy.get('#create_new_team_button').click()
109109
cy.wait(5000)
110-
cy.get('#team_list_nenu_button').should("contain",teamName)
110+
cy.get('#team_list_menu_button').should("contain",teamName)
111111

112112
})
113113

packages/tdb-dashboard/src/App.css

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,6 +1140,10 @@ pre.CodeMirror-line > span > span.cm-string {
11401140
min-width: 22px;
11411141
}
11421142

1143+
.form-check-input {
1144+
min-height: 0 !important;
1145+
}
1146+
11431147

11441148
.table__columns__component > .form-check-label{
11451149
margin-left: 10px;
@@ -1178,4 +1182,44 @@ pre.CodeMirror-line > span > span.cm-string {
11781182
right: 0;
11791183
left: auto !important;
11801184
margin-top: var(--bs-dropdown-spacer);
1185+
}
1186+
1187+
/** subscription */
1188+
.subscription_icons {
1189+
font-size: 55px;
1190+
border-radius: 50%;
1191+
/*ßwidth: 130px;*/
1192+
line-height: 130px;
1193+
height: 130px;
1194+
padding: 1.5rem;
1195+
width: 100px;
1196+
height: 100px;
1197+
}
1198+
1199+
.free_button_text_color {
1200+
color: #664d03 !important;
1201+
}
1202+
1203+
.free {
1204+
border: 1px solid rgb(254, 216, 147);
1205+
color: rgb(254, 216, 147);
1206+
}
1207+
1208+
.professional {
1209+
border: 1px solid rgb(232, 124, 214);
1210+
color: rgb(232, 124, 214);
1211+
}
1212+
1213+
.scale {
1214+
border: 1px solid rgb(134, 89, 250);
1215+
color: rgb(134, 89, 250);
1216+
}
1217+
1218+
.enterprise {
1219+
border: 1px solid rgb(52, 80, 220);
1220+
color: rgb(52, 80, 220);
1221+
}
1222+
1223+
.verify__email {
1224+
background : linear-gradient(122deg,#fed893 0,#e87cd6 48%,#4058d0 100%);
11811225
}

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

Lines changed: 0 additions & 59 deletions
This file was deleted.
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
import React, {useState, useEffect} from 'react'
2+
import {Container, Row, Col, Card} from "react-bootstrap"
3+
import {useParams} from 'react-router-dom'
4+
import {GetDiffList} from "../hooks/DocumentHook"
5+
import {WOQLClientObj} from "../init-woql-client"
6+
import {DiffView} from "../components/DiffView"
7+
import Badge from 'react-bootstrap/Badge'
8+
import {BiGitBranch} from "react-icons/bi"
9+
import Tab from 'react-bootstrap/Tab'
10+
import Tabs from 'react-bootstrap/Tabs'
11+
import Stack from 'react-bootstrap/Stack'
12+
import {ChangeRequest} from "../hooks/ChangeRequest"
13+
import {Loading} from "../components/Loading"
14+
import Alert from 'react-bootstrap/Alert'
15+
import {
16+
DIFFS,
17+
MERGED,
18+
MESSAGES,
19+
TRACKING_BRANCH
20+
} from "../components/constants"
21+
import {Messages} from "../components/Messages"
22+
import {ReviewComponent} from "../components/ReviewComponent"
23+
24+
const DocumentModifiedCount = ({documentModifiedCount}) => {
25+
if(documentModifiedCount > 1) return <h6 className="fw-bold mt-2 text-warning font-italic">
26+
{`${documentModifiedCount} documents`}
27+
</h6>
28+
29+
if(documentModifiedCount === 1) return <h6 className="fw-bold mt-2 text-warning font-italic">
30+
{`${documentModifiedCount} document`}
31+
</h6>
32+
}
33+
34+
const BranchCRMessage = ({css, branch}) => {
35+
return <React.Fragment>
36+
<Badge bg={css} className="fw-bold mr-2 text-dark">
37+
<BiGitBranch className=" mr-1"/>{branch}
38+
</Badge>
39+
</React.Fragment>
40+
}
41+
42+
const DisplayHeader = ({author, documentModifiedCount, tracking_branch}) => {
43+
return <>
44+
<h6 className="mt-2">{`${author} wants to merge `}</h6>
45+
<DocumentModifiedCount documentModifiedCount={documentModifiedCount}/>
46+
<h6 className="mt-2">{` into `}</h6>
47+
<BranchCRMessage branch={"main"} css={"success"}/>
48+
<h6 className="mt-2">{`from `}</h6>
49+
<BranchCRMessage branch={tracking_branch} css={"primary"}/>
50+
</>
51+
}
52+
53+
54+
export const ChangeDiffComponent = () => {
55+
56+
const {
57+
woqlClient:client,
58+
currentCRObject
59+
} = WOQLClientObj()
60+
61+
/*const {
62+
getChangeRequestByID,
63+
} = ChangeRequest()*/
64+
65+
const {id} = useParams()
66+
67+
const [key, setKey] = useState(DIFFS)
68+
const [action, setAction]=useState(false)
69+
const [loading, setLoading]=useState(true)
70+
const [errorMsg, setErrorMsg]=useState(false)
71+
72+
/* useEffect(() => {
73+
async function getCRID() {
74+
await getChangeRequestByID(id,true)
75+
}
76+
if(id, client) getCRID()
77+
}, [id, client])*/
78+
79+
//let changeRequestID=localStorage.getItem("TERMINUSCMS_CHANGE_REQUEST_ID")
80+
const result = GetDiffList(client, id, setLoading, setErrorMsg)
81+
//const result = GetDiffList(client, currentCRObject["@id"])
82+
83+
useEffect(() => {
84+
if(key === DIFFS) setAction(false)
85+
}, [key])
86+
87+
if(!client) return <div/>
88+
89+
let documentModifiedCount = result ? result.length : 0
90+
91+
let author= currentCRObject&&currentCRObject.hasOwnProperty("creator") ? currentCRObject["creator"] : "user"
92+
93+
return <Tabs
94+
id="change_request_tabs"
95+
activeKey={key}
96+
onSelect={(k) => setKey(k)}
97+
className="mb-3">
98+
<Tab eventKey={DIFFS} title={DIFFS}>
99+
{loading && <Loading message={`Loading Diffs ...`}/>}
100+
{errorMsg && <Alert variant={"danger"} className="mr-3">
101+
{errorMsg}
102+
</Alert>}
103+
{!documentModifiedCount && <h6 className="text-muted fw-bold mt-3 mb-3">
104+
{`No documents `}
105+
</h6>}
106+
<Card bg="transparent" className="border-secondary mt-5 mb-5">
107+
<Card.Header>
108+
<Stack direction="horizontal" gap={2} className="mt-1">
109+
<DisplayHeader author={author}
110+
tracking_branch={currentCRObject.tracking_branch}
111+
documentModifiedCount={documentModifiedCount}/>
112+
</Stack>
113+
</Card.Header>
114+
<Card.Body>
115+
116+
{currentCRObject.status !== MERGED && <ReviewComponent setKey={setKey} action={action} setAction={setAction}/> }
117+
<DiffView diffs={result} CRObject={currentCRObject}/>
118+
</Card.Body>
119+
</Card>
120+
</Tab>
121+
<Tab eventKey={MESSAGES} title={MESSAGES}>
122+
<Messages/>
123+
</Tab>
124+
</Tabs>
125+
}
126+
127+
/*<small className="fw-bold mr-2 h6">You are in change request mode</small>
128+
<span className="float-right fw-bold mr-2 text-dark badge bg-primary mb-1">
129+
{currentCRObject[TRACKING_BRANCH]}
130+
</span>*/
131+
132+
/**
133+
*
134+
<Row className="w-100 mt-5">
135+
<Col md={6}>
136+
{result && <DocumentModifiedCount documentModifiedCount={documentModifiedCount}/>}
137+
</Col>
138+
<Col md={6}>
139+
<BranchCRMessage trackingBranch={currentCRObject.tracking_branch} originBranch={"main"}/>
140+
</Col>
141+
</Row>
142+
*/

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

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
 (0)