Skip to content

Commit 222a5be

Browse files
Merge branch 'main' into add-change-request-optional
2 parents f017110 + b03e5ce commit 222a5be

File tree

10 files changed

+42
-12
lines changed

10 files changed

+42
-12
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export const MessageComponent = ({setKey}) => {
6060
let id=extractID(currentCRObject["@id"])
6161
// this call return the changeRequestObj Updated
6262
let res=await addNewMessage(comment,id)
63+
6364
// we'll see if add need rebase check every time
6465
res.needRebase = currentCRObject.needRebase
6566
setCurrentCRObject(res)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ export function ChangeRequest(){
133133
errorMessage,
134134
changeRequestList,
135135
createChangeRequest,
136+
addNewMessage,
136137
getChangeRequestList,
137138
updateChangeRequestStatus,
138139
getChangeRequestByID,

packages/tdb-documents-ui-template/src/components/ViewDocumentHistory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ const DisplayHistory = ({ history, setDiffCommitObject, diffObject, frames, type
173173
placement={"left"}
174174
overlay={
175175
<Tooltip id={`tooltip-${"left"}`}>
176-
{historyItem.message}
176+
<label className="text-light">{historyItem.message}</label>
177177
</Tooltip>
178178
}
179179
>

packages/tdb-documents-ui-template/src/hook/hookUtility.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function extractDocuments(documentResultsArr) {
2323
// if it is an array this is set type, I can have more than 1 result for row
2424
//?? I can pust the count
2525
if (Array.isArray(item[key])) {
26-
newJson[key] = `${(item[key].length)}`
26+
newJson[key] = `Item Count ${(item[key].length)}`
2727
}
2828
else if (item[key] && typeof item[key] === "object") {
2929
//key

packages/tdb-documents-ui/src/Viewer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const SelectedLanguage = ({ language }) => {
1515
}
1616

1717

18+
1819
export const Viewer = ({ display, message, mode, type, onSubmit, readOnly, data, setData, documentation, language }) => {
1920

2021
return <div className="tdb__frame__viewer ">

packages/tdb-documents-ui/src/components/DescriptionComponent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import { AiOutlineLink } from "react-icons/ai"
44

55
// description field for document links
66
// shows to which document a property is linked
7-
export function getLinkedDescription (linked) {
7+
export function getLinkedDescription (linked, type) {
88
return <Stack direction="horizontal" gap={2} className="fw-bold">
99
<AiOutlineLink className="text-warning h6 mt-1"/>
1010
<small className="fst-italic text-muted">
11-
{`Linked to document: `}
11+
{`Linked to ${type ? type : "document"}: `}
1212
<span className="text-warning fw-bold">{linked}</span>
1313
</small>
1414
</Stack>

packages/tdb-documents-ui/src/documentationTemplates.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export function DisplayPropertyNameAndComment ({ comment }){
6767
placement={'right'}
6868
overlay={
6969
<Tooltip id={`tooltip-right`}>
70-
<small className="text-gray">{comment}</small>
70+
<small className="text-light">{comment}</small>
7171
</Tooltip>
7272
}
7373
>

packages/tdb-documents-ui/src/widgets/inputWidgets.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export const TDBInput = ({ id, name, value, required, isKey, hideFieldLabel, mod
6060
onChange={ (event) => onChange(event.target.value, name) } />}
6161
{/** only allow numbers */}
6262
{NUMBER_ARRAY.includes(placeholder) && <input type="number"
63+
step="any"
6364
id={id}
6465
name={id}
6566
pattern="[0-9]*"

packages/tdb-documents-ui/src/widgets/subDocumentWidget.js

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { DisplayDocumentation } from "../templates"
1010
import { AiOutlineUp, AiOutlineRight } from "react-icons/ai"
1111
import { displayInternalProperties } from "../helpers/documentHelpers"
1212
import { HiddenSubDocumentWidgets } from "./hiddenWidgets"
13+
import { getLinkedDescription } from "../components/DescriptionComponent"
1314

1415
const CollapseMessage = ({ message, name, icon }) => {
1516
return <>
@@ -115,7 +116,7 @@ function getExpanded(expanded, linked_to, frame) {
115116
}
116117

117118
export const TDBSubDocument = ({ extracted, expanded, order_by, comment, props, index, hideFieldLabel, linked_to, propertyDocumentation, id, label, reference, subDocumentData, setSubDocumentData, args }) => {
118-
const [open, setOpen] = useState(args.mode === CONST.VIEW ? getExpanded(expanded, linked_to, args.fullFrame) : expanded);
119+
const [open, setOpen] = useState(args.mode === CONST.VIEW ? getExpanded(expanded, linked_to, args.fullFrame) : true);
119120
//const [open, setOpen] = useState(true);
120121
let uiFrame = args.uiFrame, mode = args.mode
121122

@@ -145,7 +146,7 @@ export const TDBSubDocument = ({ extracted, expanded, order_by, comment, props,
145146
className="tdb__label__width"
146147
hideFieldLabel={hideFieldLabel}/>
147148
<Card bg="secondary" className={`tdb__subdocument__input ${util.getBorder(uiFrame, props.name, index)} w-100`} key={id}>
148-
<Button variant={"secondary"}
149+
{mode === CONST.VIEW && <><Button variant={"secondary"}
149150
className={`text-start p-4`}
150151
data-testid={`root_subdocument_${props.name}_button`}
151152
name={`root_subdocument_${props.name}_button`}
@@ -154,8 +155,8 @@ export const TDBSubDocument = ({ extracted, expanded, order_by, comment, props,
154155
aria-expanded={open}
155156
>
156157
{/*<TDBLabel name={props.name} required={props.required} comment={comment}/>*/}
157-
{!open && <CollapseMessage message={`Click here to expand SubDocument`} name={props.name} icon={<AiOutlineRight className="text-muted"/>}/>}
158-
{open && <CollapseMessage message={`Click here to collapse SubDocument`} name={props.name} icon={<AiOutlineUp className="text-muted"/>}/>}
158+
{!open && <CollapseMessage message={`Click here to expand SubDocument`} name={linked_to} icon={<AiOutlineRight className="text-muted"/>}/>}
159+
{open && <CollapseMessage message={`Click here to collapse SubDocument`} name={linked_to} icon={<AiOutlineUp className="text-muted"/>}/>}
159160
</Button>
160161
<Collapse in={open}>
161162
<div id={`root_subdocument_${props.name}`}>
@@ -176,7 +177,30 @@ export const TDBSubDocument = ({ extracted, expanded, order_by, comment, props,
176177
linked_to={linked_to}
177178
args={args}/>}
178179
</div>
179-
</Collapse>
180+
</Collapse></>}
181+
{mode !== CONST.VIEW && <>
182+
<Card.Header>
183+
{getLinkedDescription (linked_to, `SubDocument`)}
184+
</Card.Header>
185+
<div id={`root_subdocument_${props.name}`}>
186+
{subDocumentData && linked_to === subDocumentData[CONST.TYPE] && <SubDocumentProperties properties={extracted.properties}
187+
//required={extracted.required}
188+
required={props.required}
189+
//formData={props.formData}
190+
id={id}
191+
index={index}
192+
reference={reference}
193+
order_by={order_by}
194+
props={props}
195+
subDocumentPropertyName={props.name}
196+
propertyDocumentation={propertyDocumentation}
197+
onChange={props.onChange}
198+
subDocumentData={subDocumentData}
199+
setSubDocumentData={setSubDocumentData}
200+
linked_to={linked_to}
201+
args={args}/>}
202+
</div>
203+
</>}
180204
</Card>
181205
</Stack>
182206
}

packages/tdb-react-components/src/treeGraphComponent/MainGraphObject.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -687,8 +687,10 @@ export const MainGraphObject = (mainGraphDataProvider,dbName)=>{
687687
}
688688
else {
689689
// initialize metadata & render as for propertyObj
690-
_currentNode.schema["@metadata"]["render_as"] = {
691-
[currentpropertyID]: "markdown"
690+
_currentNode.schema["@metadata"] = {
691+
"render_as": {
692+
[currentpropertyID]: "markdown"
693+
}
692694
}
693695
}
694696
}

0 commit comments

Comments
 (0)