-
Notifications
You must be signed in to change notification settings - Fork 122
Update provenance links in browser #6071
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
a158924
39213a1
28faebc
15adc1e
1058106
965e851
bdd87ce
8c46f5d
82d8678
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,7 +67,7 @@ export function shouldIgnoreProperty(property: string): boolean { | |
|
|
||
| interface OutArcSectionPropType { | ||
| dcid: string; | ||
| provDomain: { [key: string]: URL }; | ||
| provenanceNames: { [key: string]: string }; | ||
| nodeTypes: string[]; | ||
| showAllProperties: boolean; | ||
| } | ||
|
|
@@ -121,21 +121,25 @@ export class OutArcSection extends React.Component< | |
| } | ||
| const predicates = Object.keys(this.state.data); | ||
| predicates.sort(this.predicateComparator); | ||
| const isProvenanceNode = this.props.nodeTypes.includes("Provenance"); | ||
| return ( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure where the best place to put this comment is, but I just thought of another consideration. We really should not show the Provenance column at all when the node is of type Provenance itself. It doesn't make sense to show a link that just links back to the same page (i.e. goes nowhere). Could we add some logic to check if the subject node is of type Provenance and then show a 2-column table consisting of property and value only?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done! |
||
| <div className={`card p-0 ${ASYNC_ELEMENT_CLASS}`}> | ||
| <table className="node-table"> | ||
| <tbody> | ||
| <tr key="header"> | ||
| <th className="property-column">Property</th> | ||
| <th>Value</th> | ||
| <th>Provenance</th> | ||
| {!isProvenanceNode && ( | ||
| <th className="provenance-column">Provenance</th> | ||
| )} | ||
| </tr> | ||
| <ArcTableRow | ||
| key={DCID_PREDICATE} | ||
| propertyLabel={DCID_PREDICATE} | ||
| values={[{ text: this.props.dcid }]} | ||
| provenanceId={""} | ||
| src={null} | ||
| provenanceName={null} | ||
| hideProvenanceColumn={isProvenanceNode} | ||
| /> | ||
| {predicates.map((predicate) => { | ||
| const valuesByProvenance = this.state.data[predicate]; | ||
|
|
@@ -147,12 +151,11 @@ export class OutArcSection extends React.Component< | |
| propertyLabel={predicate} | ||
| values={valuesByProvenance[provenanceId]} | ||
| provenanceId={provenanceId} | ||
| src={ | ||
| this.props.provDomain[provenanceId] | ||
| ? this.props.provDomain[provenanceId] | ||
| : null | ||
| provenanceName={ | ||
| this.props.provenanceNames[provenanceId] || null | ||
| } | ||
| propIndex={index} | ||
| hideProvenanceColumn={isProvenanceNode} | ||
| /> | ||
| ); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does "original string" mean? Is it the DCID?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry - that was unclear! The original string is the provenance name given by the API. It would only ever be a DCID if there isn't a name (although as you verified, there should always be a name).
I'll update the comment.