Skip to content

Commit 98a4422

Browse files
Corrected MetadataQueryView code under ContentExplorer (#637)
1 parent bea0019 commit 98a4422

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

content/guides/embed/ui-elements/explorer.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,9 @@ function App() {
352352
353353
// Define metadata source
354354
// Example: enterprise_123456789.metadatatemplate
355-
const metadataSource = `metadata.enterprise_${EID}.${templateName}`;
356-
355+
const metadataSource = `enterprise_${EID}.${templateName}`;
356+
const metadataSourceFieldName = `metadata.${metadataSource}`;
357+
357358
const metadataQuery = {
358359
from: metadataSource,
359360
@@ -368,22 +369,22 @@ function App() {
368369
369370
// Define which other metadata fields you'd like to display
370371
fields: [
371-
`${metadataSource}.name`,
372-
`${metadataSource}.last_contacted_at`,
373-
`${metadataSource}.industry`,
374-
`${metadataSource}.role`,
372+
`${metadataSourceFieldName}.name`,
373+
`${metadataSourceFieldName}.last_contacted_at`,
374+
`${metadataSourceFieldName}.industry`,
375+
`${metadataSourceFieldName}.role`,
375376
],
376377
};
377378
378379
// The metadata fields/columns to view - must be valid field names from the metadata template
379380
const fieldsToShow = [
380381
// Determine if the user can edit the metadata directly from Content Explorer component
381-
{ key: `${metadataSource}.name`, canEdit: false },
382+
{ key: `${metadataSourceFieldName}.name`, canEdit: false },
382383
383384
// Determine label alias on metadata column with displayName prop
384-
{ key: `${metadataSource}.industry`, canEdit: false, displayName: "alias" },
385-
{ key: `${metadataSource}.last_contacted_at`, canEdit: true },
386-
{ key: `${metadataSource}.role`, canEdit: true },
385+
{ key: `${metadataSourceFieldName}.industry`, canEdit: false, displayName: "alias" },
386+
{ key: `${metadataSourceFieldName}.last_contacted_at`, canEdit: true },
387+
{ key: `${metadataSourceFieldName}.role`, canEdit: true },
387388
];
388389
389390
// defaultView - a required prop to paint the metadata view.

0 commit comments

Comments
 (0)