Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

[terra-folder-tree] Initial component setup #1855

Merged
merged 5 commits into from
Oct 25, 2023
Merged

[terra-folder-tree] Initial component setup #1855

merged 5 commits into from
Oct 25, 2023

Conversation

sycombs
Copy link
Contributor

@sycombs sycombs commented Oct 24, 2023

Summary

This PR sets up the base terra-folder-tree component to prepare for development on terra-folder-tree.

These changes are based on the Terra File Path changes from #1771.

Testing

This change was tested using:

  • WDIO
  • Jest
  • Visual testing (please attach a screenshot or recording)
  • Other (please describe below)
  • No tests are needed

Reviews

In addition to engineering reviews, this PR needs:

  • UX review
  • Accessibility review
  • Functional review

Additional Details

This PR resolves:

UXPLATFORM-9679


Thank you for contributing to Terra.
@cerner/terra

@github-actions
Copy link
Contributor

github-actions bot commented Oct 25, 2023

Fails
🚫 Please include a CHANGELOG entry for each changed package this PR. Looks like a CHANGELOG entry is missing for:
  • terra-framework-docs

Generated by 🚫 dangerJS against 9e7aea2

@sycombs
Copy link
Contributor Author

sycombs commented Oct 25, 2023

Fails
🚫 Please include a CHANGELOG entry for each changed package this PR. Looks like a CHANGELOG entry is missing for:

  • terra-framework-docs

Generated by 🚫 dangerJS against 28efb84

The only changes to terra-framework-docs is placeholder documentation, so omitting the Changelog entry.

@sycombs sycombs marked this pull request as ready for review October 25, 2023 15:30
@@ -0,0 +1,3 @@
{
"Terra.folder-tree.placeholder": "Placeholder"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: no newline.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -0,0 +1,7 @@
@import '~terra-mixins/lib/Mixins';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need Terra mixins?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, this is just a placeholder file to get started on FolderTree development and the content of this file was copied from the equivalent setup for file path: https://github.com/cerner/terra-framework/pull/1771/files#diff-213a5eefceecea61e9ec5bbdb472d503d5193b21a7f7e655af877752445bd241R1

@@ -0,0 +1,10 @@
module.exports = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have noticed that in that and FilePath component we have .eslintrc.js and jest.config.js on package level rather than use them from terra-framework level and then use as in older components:
"jest": "jest --config ../../jest.config.js"
"lint:js": "eslint --ext .js,.jsx . --ignore-path ../../.eslintignore"
I was wondering why we switched to that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we are following the pattern established in cerner/terra-toolkit#811, although I'm not sure why we are adding the configs at the package level rather than using the ones at the root level. @sdadn Do you have any insight on this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the idea at the time was to make each package fully independent, so if a package needed a custom config, it will stay within that package. But I can also see that it's overly redundant and results in dozens of duplicate config files. In the last component that got created, @artpark utilized the root level configs (#1771 (comment)). So I'm not opposed to updating the pattern if you guys think using the root configs is cleaner.

Copy link
Contributor

@adoroshk adoroshk Oct 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either way works for me. I am just creating a new component set up for Compact Interactive List and was wondering which approach to use, and if separate config - in what cases, hence asked that question. Thank you for taking a look into it!

Copy link
Contributor Author

@sycombs sycombs Oct 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried removing the package-level .eslintrc.js and running eslint from the package level, and it errors due to not having an eslint config. I think this is because the root eslint config is defined in the root package.json, so it can't be resolved from the package level?

We could probably define a root-level .eslintrc.js to fix this; for now I'm going to leave the files as they are so the Folder Tree package can be merged into main, but I'm open to changing this in a future PR.

@@ -524,6 +524,7 @@ exports[`Menu correctly applies the theme context className 1`] = `
"timeZone": null,
}
}
isTabFocusDisabled={false}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for taking care of that! Came across the same problem in other PR, glad to see it's taken care of!

@github-actions github-actions bot temporarily deployed to preview-pr-1855 October 25, 2023 20:31 Destroyed
@sycombs sycombs merged commit 539bcc8 into main Oct 25, 2023
@sycombs sycombs deleted the setup-folder-tree branch October 25, 2023 20:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants