-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DSD-1603: component changelogs #1436
Merged
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2a7fd44
added ComponentChangelogTable component and then added it to some sto…
bigfishdesign13 aa6750c
code formatting cleanup
bigfishdesign13 594edf8
updates based on feedback
bigfishdesign13 ba232ff
adding better typing and better docs
bigfishdesign13 d28edb1
Merge branch 'development' into DSD-1603/component-changelogs
bigfishdesign13 48019ef
removing errant comments
bigfishdesign13 301f3d7
Merge branch 'DSD-1603/component-changelogs' of https://github.com/NY…
bigfishdesign13 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** This data is used to populate the ComponentChangelogTable component. | ||
* | ||
* date: string (when adding new entry during development, set value as "Prerelease") | ||
* version: string (when adding new entry during development, set value as "Prerelease") | ||
* type: "Bug Fix" | "New Feature" | "Update"; | ||
* affects: array["Accessibility" | "Documentation" | "Functionality" | "Styles"]; | ||
* notes: array (will render as a bulleted list, add one array element for each list element) | ||
*/ | ||
import { ChangelogData } from "../../utils/ComponentChangelogTable"; | ||
|
||
export const changelogData: ChangelogData[] = [ | ||
{ | ||
date: "Prerelease", | ||
version: "Prerelease", | ||
type: "Update", | ||
affects: ["Accessibility"], | ||
notes: [ | ||
"Updates to pass a secondaryHelperTextId to its TextInput if needed so that the aria-describedby value can be associated with all relevant helperTexts.", | ||
"Updates so that focus remains on input after value is changed.", | ||
], | ||
}, | ||
{ | ||
date: "2023-9-28", | ||
version: "2.0.0", | ||
type: "Update", | ||
affects: ["Styles"], | ||
notes: [ | ||
"Applied Typo2023 styles, including font size, font color, and text link patterns.", | ||
], | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** This data is used to populate the ComponentChangelogTable component. | ||
* | ||
* date: string (when adding new entry during development, set value as "Prerelease") | ||
* version: string (when adding new entry during development, set value as "Prerelease") | ||
* type: "Bug Fix" | "New Feature" | "Update"; | ||
* affects: array["Accessibility" | "Documentation" | "Functionality" | "Styles"]; | ||
* notes: array (will render as a bulleted list, add one array element for each list element) | ||
*/ | ||
import { ChangelogData } from "../../utils/ComponentChangelogTable"; | ||
|
||
export const changelogData: ChangelogData[] = [ | ||
{ | ||
date: "Prerelease", | ||
version: "Prerelease", | ||
type: "Update", | ||
affects: ["Accessibility", "Styles"], | ||
notes: ["Remove the underline on the component's `Privacy Policy` link."], | ||
}, | ||
{ | ||
date: "2023-9-28", | ||
version: "2.0.0", | ||
type: "Update", | ||
affects: ["Styles"], | ||
notes: [ | ||
"Applied Typo2023 styles, including font size, font color, and text link patterns.", | ||
], | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** This data is used to populate the ComponentChangelogTable component. | ||
* | ||
* date: string (when adding new entry during development, set value as "Prerelease") | ||
* version: string (when adding new entry during development, set value as "Prerelease") | ||
* type: "Bug Fix" | "New Feature" | "Update"; | ||
* affects: array["Accessibility" | "Documentation" | "Functionality" | "Styles"]; | ||
* notes: array (will render as a bulleted list, add one array element for each list element) | ||
*/ | ||
import { ChangelogData } from "../../utils/ComponentChangelogTable"; | ||
|
||
export const changelogData: ChangelogData[] = [ | ||
{ | ||
date: "Prerelease", | ||
version: "Prerelease", | ||
type: "Bug Fix", | ||
affects: ["Functionality"], | ||
notes: [ | ||
"Fixes an issue with `backgroundColor` and `foregroundColor` props not prioritizing the passed design token values for the `Hero` component.", | ||
], | ||
}, | ||
{ | ||
date: "2023-9-28", | ||
version: "2.0.0", | ||
type: "Update", | ||
affects: ["Styles"], | ||
notes: [ | ||
"Applied Typo2023 styles, including font size, font color, and text link patterns.", | ||
], | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** This data is used to populate the ComponentChangelogTable component. | ||
* | ||
* date: string (when adding new entry during development, set value as "Prerelease") | ||
* version: string (when adding new entry during development, set value as "Prerelease") | ||
* type: "Bug Fix" | "New Feature" | "Update"; | ||
* affects: array["Accessibility" | "Documentation" | "Functionality" | "Styles"]; | ||
* notes: array (will render as a bulleted list, add one array element for each list element) | ||
*/ | ||
import { ChangelogData } from "../../utils/ComponentChangelogTable"; | ||
|
||
export const changelogData: ChangelogData[] = [ | ||
{ | ||
date: "Prerelease", | ||
version: "Prerelease", | ||
type: "Bug Fix", | ||
affects: ["Accessibility", "Functionality"], | ||
notes: [ | ||
"Updated to use appropriate aria-label values for the slider thumbs and text input fields.", | ||
], | ||
}, | ||
{ | ||
date: "2023-9-28", | ||
version: "2.0.0", | ||
type: "Update", | ||
affects: ["Styles"], | ||
notes: ["Applied Typo2023 styles, including font size and font color."], | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
import List from "../components/List/List"; | ||
import Table from "../components/Table/Table"; | ||
|
||
export const affectTypesArray = [ | ||
"Accessibility", | ||
"Documentation", | ||
"Functionality", | ||
"Styles", | ||
] as const; | ||
export type AffectTypes = typeof affectTypesArray[number]; | ||
|
||
export interface ChangelogData { | ||
/** Date of the release; format yyyy-mm-dd; when adding new entry during development, set value as "Prerelease" */ | ||
date: string; | ||
/** Version nunber of the release; when adding new entry during development, set value as "Prerelease" */ | ||
version: string; | ||
/** The type of update */ | ||
type: "Bug Fix" | "New Feature" | "Update"; | ||
/** The scope of the update */ | ||
affects: AffectTypes[]; | ||
/** Details about the update; this array will be rendered as a bulleted list */ | ||
notes: string[]; | ||
} | ||
|
||
export interface ComponentChangelogTableProps { | ||
changelogData: ChangelogData[]; | ||
} | ||
|
||
export const ComponentChangelogTable = ( | ||
props: ComponentChangelogTableProps | ||
) => { | ||
const { changelogData } = props; | ||
const tableData = changelogData.map((tableRow: ChangelogData) => { | ||
const { date, version, type, affects, notes } = tableRow; | ||
const dateFormatted = | ||
date === "Prerelease" | ||
? date | ||
: new Date(date).toLocaleDateString("en-us", { | ||
year: "numeric", | ||
month: "short", | ||
day: "numeric", | ||
}); | ||
const affectsFormatted = affects.sort().join(", "); | ||
const notesItems = notes.map((item, i) => <li key={i}>{item}</li>); | ||
const notesList = <List type="ul">{notesItems}</List>; | ||
const rowData = [dateFormatted, version, type, affectsFormatted, notesList]; | ||
return rowData; | ||
}); | ||
|
||
const headersData = ["Date", "Version", "Type", "Affects", "Notes"]; | ||
const narrowTdWidth = "9rem"; | ||
const narrowerTdWidth = "7rem"; | ||
const borderColor = "ui.gray.semi-medium"; | ||
const customStyles = { | ||
thead: { | ||
th: { | ||
borderColor: borderColor, | ||
fontSize: "desktop.overline.overline2", | ||
pb: "xs", | ||
pt: "xs", | ||
textTransform: "uppercase", | ||
}, | ||
}, | ||
th: { | ||
borderColor: borderColor, | ||
fontSize: "desktop.caption", | ||
_last: { | ||
borderColor: borderColor, | ||
}, | ||
}, | ||
td: { | ||
borderColor: borderColor, | ||
fontSize: "desktop.caption", | ||
// pb: "xs", | ||
// pt: "xs", | ||
_last: { | ||
borderColor: borderColor, | ||
}, | ||
}, | ||
"th:nth-child(1)": { | ||
width: { base: "auto", md: narrowTdWidth }, | ||
}, | ||
"th:nth-child(2)": { | ||
width: narrowerTdWidth, | ||
}, | ||
"th:nth-child(3)": { | ||
width: narrowerTdWidth, | ||
}, | ||
"th:nth-child(4)": { | ||
width: narrowerTdWidth, | ||
}, | ||
ul: { | ||
m: "0", | ||
}, | ||
li: { | ||
_notFirst: { mt: "xs" }, | ||
}, | ||
}; | ||
|
||
return ( | ||
<Table | ||
className="sb-unstyled" | ||
columnHeaders={headersData} | ||
columnHeadersBackgroundColor="ui.bg.default" | ||
showRowDividers | ||
tableData={tableData} | ||
useRowHeaders | ||
sx={customStyles} | ||
/> | ||
); | ||
}; | ||
|
||
export default ComponentChangelogTable; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay to remove.