Skip to content

Commit

Permalink
Corrected MetadataQueryView code under ContentExplorer
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-in-a-box committed Nov 15, 2024
1 parent bea0019 commit 5ea0047
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions content/guides/embed/ui-elements/explorer.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,9 @@ function App() {
// Define metadata source
// Example: enterprise_123456789.metadatatemplate
const metadataSource = `metadata.enterprise_${EID}.${templateName}`;
const metadataSource = `enterprise_${EID}.${templateName}`;
const metadataSourceFieldName = `metadata.${metadataSource}`;
const metadataQuery = {
from: metadataSource,
Expand All @@ -368,22 +369,22 @@ function App() {
// Define which other metadata fields you'd like to display
fields: [
`${metadataSource}.name`,
`${metadataSource}.last_contacted_at`,
`${metadataSource}.industry`,
`${metadataSource}.role`,
`${metadataSourceFieldName}.name`,
`${metadataSourceFieldName}.last_contacted_at`,
`${metadataSourceFieldName}.industry`,
`${metadataSourceFieldName}.role`,
],
};
// The metadata fields/columns to view - must be valid field names from the metadata template
const fieldsToShow = [
// Determine if the user can edit the metadata directly from Content Explorer component
{ key: `${metadataSource}.name`, canEdit: false },
{ key: `${metadataSourceFieldName}.name`, canEdit: false },
// Determine label alias on metadata column with displayName prop
{ key: `${metadataSource}.industry`, canEdit: false, displayName: "alias" },
{ key: `${metadataSource}.last_contacted_at`, canEdit: true },
{ key: `${metadataSource}.role`, canEdit: true },
{ key: `${metadataSourceFieldName}.industry`, canEdit: false, displayName: "alias" },
{ key: `${metadataSourceFieldName}.last_contacted_at`, canEdit: true },
{ key: `${metadataSourceFieldName}.role`, canEdit: true },
];
// defaultView - a required prop to paint the metadata view.
Expand Down

0 comments on commit 5ea0047

Please sign in to comment.