Skip to content

Commit

Permalink
Merge pull request #155 from lucyjemutai/subdomainConcepts
Browse files Browse the repository at this point in the history
Remove 'Concept Class','Version' and UUID' fields when they are null
  • Loading branch information
lucyjemutai authored Dec 2, 2024
2 parents 5ad29ff + 25b36e9 commit 6968ef2
Showing 1 changed file with 56 additions and 47 deletions.
103 changes: 56 additions & 47 deletions pages/orgs/[org]/domains/[domain]/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -531,64 +531,67 @@ function OrgDomainsList() {
>
Display Name
</TableCell>
{currentConcepts.some((concept) => concept.concept_class) && (
<TableCell
sx={{
fontWeight: "bold",
textTransform: "uppercase",
padding: "12px",
}}
>
Concept Class
</TableCell>
sx={{
fontWeight: "bold",
textTransform: "uppercase",
padding: "12px",
}}
>
Concept Class
</TableCell>
)}
{currentConcepts.some((concept) => concept.version) && (
<TableCell
sx={{
fontWeight: "bold",
textTransform: "uppercase",
padding: "12px",
}}
>
Version
</TableCell>
sx={{
fontWeight: "bold",
textTransform: "uppercase",
padding: "12px",
}}
>
Version
</TableCell>
)}
{currentConcepts.some((concept) => concept.uuid) && (
<TableCell
sx={{
fontWeight: "bold",
textTransform: "uppercase",
padding: "12px",
}}
>
UUID
</TableCell>
sx={{
fontWeight: "bold",
textTransform: "uppercase",
padding: "12px",
}}
>
UUID
</TableCell>
)}
</TableRow>
</TableHead>
<TableBody>
{currentConcepts
?.filter((c) => c.type === "Concept")
?.map((concept, index) => (
<TableRow
{currentConcepts?.map((concept, index) => (
<TableRow
key={concept.id}
sx={{
":hover": {
backgroundColor: "#f5f5f5",
cursor: "pointer",
},
transition:
"background-color 0.3s ease",
}}
onClick={() => {
router.push(concept.url);
}}
>
<TableCell
sx={{
padding: "12px",
fontWeight: 500,
}}
>
{/* Added conditional numbering */}
{page > 1
? (page - 1) * rowsPerPage +
(index + 1)
: index + 1}
transition:
"background-color 0.3s ease",
}}
onClick={() => {
router.push(concept.url);
}}
>
<TableCell
sx={{
padding: "12px",
fontWeight: 500,
}}
>
{/* Added conditional numbering */}
{page > 1
? (page - 1) * rowsPerPage + (index + 1)
: index + 1}
</TableCell>
<TableCell
sx={{
Expand All @@ -606,12 +609,17 @@ function OrgDomainsList() {
>
{concept.display_name}
</TableCell>
{concept.concept_class && (
<TableCell sx={{ padding: "12px" }}>
{concept.concept_class}
</TableCell>
)}
{concept.version && (
<TableCell sx={{ padding: "12px" }}>
{concept.version}
</TableCell>
)}
{concept.uuid && (
<TableCell
sx={{
padding: "12px",
Expand All @@ -620,7 +628,8 @@ function OrgDomainsList() {
>
{concept.uuid}
</TableCell>
</TableRow>
)}
</TableRow>
))}
</TableBody>
</Table>
Expand Down

0 comments on commit 6968ef2

Please sign in to comment.