@@ -0,0 +1,6 @@
|
||||
---
|
||||
'@backstage/plugin-adr-common': patch
|
||||
'@backstage/plugin-adr': patch
|
||||
---
|
||||
|
||||
fixed error with date parsing.
|
||||
@@ -32,7 +32,8 @@
|
||||
"@backstage/catalog-model": "workspace:^",
|
||||
"@backstage/integration": "workspace:^",
|
||||
"@backstage/plugin-search-common": "workspace:^",
|
||||
"front-matter": "^4.0.2"
|
||||
"front-matter": "^4.0.2",
|
||||
"luxon": "3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "workspace:^"
|
||||
|
||||
@@ -21,6 +21,7 @@ import { Entity, getEntitySourceLocation } from '@backstage/catalog-model';
|
||||
import { IndexableDocument } from '@backstage/plugin-search-common';
|
||||
import { ScmIntegrationRegistry } from '@backstage/integration';
|
||||
import frontMatter from 'front-matter';
|
||||
import { DateTime } from 'luxon';
|
||||
|
||||
/**
|
||||
* ADR plugin annotation.
|
||||
@@ -135,10 +136,12 @@ export const parseMadrWithFrontmatter = (content: string): ParsedMadr => {
|
||||
const parsed = frontMatter<Record<string, unknown>>(content);
|
||||
const status = parsed.attributes.status;
|
||||
const date = parsed.attributes.date;
|
||||
const luxdate = DateTime.fromJSDate(new Date(`${date}`));
|
||||
const formattedDate = luxdate.toISODate();
|
||||
return {
|
||||
content: parsed.body,
|
||||
status: status ? String(status) : undefined,
|
||||
date: date ? String(date) : undefined,
|
||||
date: date ? String(formattedDate) : undefined,
|
||||
attributes: parsed.attributes,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -68,10 +68,6 @@ const useStyles = makeStyles((theme: Theme) => ({
|
||||
color: theme.palette.grey[700],
|
||||
marginBottom: theme.spacing(1),
|
||||
},
|
||||
adrChip: {
|
||||
position: 'absolute',
|
||||
right: 0,
|
||||
},
|
||||
}));
|
||||
|
||||
const AdrListContainer = (props: {
|
||||
@@ -139,7 +135,6 @@ const AdrListContainer = (props: {
|
||||
label={adr.status}
|
||||
size="small"
|
||||
variant="outlined"
|
||||
className={classes.adrChip}
|
||||
/>
|
||||
)}
|
||||
</Box>
|
||||
|
||||
@@ -4589,6 +4589,7 @@ __metadata:
|
||||
"@backstage/integration": "workspace:^"
|
||||
"@backstage/plugin-search-common": "workspace:^"
|
||||
front-matter: ^4.0.2
|
||||
luxon: 3.0.0
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
@@ -31149,6 +31150,13 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"luxon@npm:3.0.0":
|
||||
version: 3.0.0
|
||||
resolution: "luxon@npm:3.0.0"
|
||||
checksum: c2d13ec1939962a318f5568fc750611346b64fe41041a2ab1c677450b7b41c699ee12ef080ff04d5a2027bf26d962d46661c7c87e394a20f6d60f14edb832c54
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"luxon@npm:^2.0.2":
|
||||
version: 2.5.2
|
||||
resolution: "luxon@npm:2.5.2"
|
||||
|
||||
Reference in New Issue
Block a user