strapi-plugin-comments 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -37,8 +37,10 @@ const DetailsEntity = ({
37
37
  .map(_ => capitalize(_))
38
38
  .join(' ');
39
39
 
40
+ const entityIsRenderable = data && !isEmpty(data) && !isEmpty(itemKeys);
41
+
40
42
  return (<Box padding={4}>
41
- { !isEmpty(keys) && (<Box marginBottom={4}>
43
+ { entityIsRenderable && (<Box marginBottom={4}>
42
44
  <Typography variant="sigma" textColor="neutral600" id="entity-details">
43
45
  { getMessage('page.details.panel.entity', 'Details') }
44
46
  </Typography>
@@ -102,15 +102,12 @@ const Details = ({ config }) => {
102
102
  <ContentLayout>
103
103
  <TwoColsLayout
104
104
  startCol={<DiscussionThread level={level} selected={selected} isReloading={isLoading} allowedActions={{ canModerate, canAccessReports, canReviewReports }} />}
105
- endCol={!contentTypeData?.schema ? (<Box padding={4}>
106
- <Loader small>{ getMessage('page.details.panel.loading', 'Loading...') }</Loader>
107
- </Box>) :
108
- (<DetailsEntity
105
+ endCol={<DetailsEntity
109
106
  data={entity}
110
107
  schema={contentTypeData?.schema}
111
108
  config={config}
112
109
  filters={filters}
113
- onFiltersChange={handleChangeFilters} />)}
110
+ onFiltersChange={handleChangeFilters} />}
114
111
  />
115
112
  </ContentLayout>
116
113
  </>) }
@@ -98,7 +98,7 @@ const DiscoverTableRow = ({ config, item, allowedActions: { canModerate, canAcce
98
98
  }, status) }</StatusBadge>);
99
99
  };
100
100
 
101
- const renderEntryUrl = entry => `/content-manager/collectionType/${entry.uid}/${entry.id}`;
101
+ const renderEntryUrl = entry => entry ? `/content-manager/collectionType/${entry.uid}/${entry.id}` : null;
102
102
  const renderDetailsUrl = entry => getUrl(`discover/${entry.id}`);
103
103
 
104
104
  const gotApprovalFlow = !isNil(item.approvalStatus);
@@ -130,7 +130,7 @@ const DiscoverTableRow = ({ config, item, allowedActions: { canModerate, canAcce
130
130
  }, '#' + item.threadOf.id) }</Link>) : '-' }
131
131
  </Td>
132
132
  <Td style={{ maxWidth: '15vw' }}>
133
- <TableLink to={ renderEntryUrl(item.related) }>{ renderEntryTitle(item.related, config) }</TableLink>
133
+ { item.related ? (<TableLink to={ renderEntryUrl(item.related) }>{ renderEntryTitle(item.related, config) }</TableLink>) : '-' }
134
134
  </Td>
135
135
  <Td>
136
136
  <Typography textColor="neutral800">{ formatDate(item.updatedAt || item.createdAt, { dateStyle: 'long', timeStyle: 'short' }) }</Typography>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "strapi-plugin-comments",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Strapi - Comments plugin",
5
5
  "strapi": {
6
6
  "name": "comments",