refs https://github.com/TryGhost/Team/issues/3504
This migrates comments-ui to TypeScript. Only `App.js` is left to
migrate, but since this isn't using hooks yet, it will need a bigger
rewrite so this will need to happen in a separate PR.
refs https://github.com/TryGhost/Team/issues/3504
- Sentry was never setup and we don't use it
- Styles have been moved to inline JS styles (no separate css file generated)
- App version was never used
- Improved current script tag detection
refs https://github.com/TryGhost/Toolbox/issues/400
- this package won't pass tests on Node 16 because of the use of
`fetch`, but that's ok because we publish using Node 18 anyway
- this switches the test command to just ensuring the package can build
refs https://github.com/TryGhost/Team/issues/3504
- Removed Cypress. Tests will get replaced by Playwright
- Removed unused files and HTML files
- Updated scripts to work similar to Portal, Signup-Form
- Updated to pinned dependencies and removed unused dependencies
- `yarn start:dev` was failing with `error:0308010C:digital envelope routines::unsupported` without the `--openssl-legacy-provider` option on Node 18. Currently react-scripts@4.x doesn't support Node 18, so until we upgrade to use react-scripts@5.x we'll need to pass in this change for build scripts
refs https://github.com/TryGhost/Team/issues/2221
- added guard to `formatNumber` helper used in the `<Count>` component via the `<ContentTitle>` component so a missing count prop is handled gracefully
- Changed all borders to work better in different background colours
- Same goes for main buttons like pagination for main and reply
- Same goes for any secondary text which should help
no issue
refs https://github.com/TryGhost/Team/issues/1780
This commit adds some Cypress tests as a POC to the project. If we decide to go with Cypress, we can add more tests to cover the rest of the codebase. The main reason to have a E2E framework is that some editor related UI is hard to test with the React tests because it uses JSDOM.
no issue
When the state of a comment changes (e.g., after a like) the relative time would update. This is not desirable because it looks glitchy. If the relative time doesn't update every second, then it is better to never update it after the initial render.
ref https://github.com/TryGhost/Team/issues/1772
- all references of "Bio" to "Expertise" for Comments
- this commit is a breaking change as it relies on the API that returns `expertise` instead of `bio`.
refs https://github.com/TryGhost/Team/issues/1858
- PopupBox better reflects that it contains a Popup and is not a Popup
- In line with ContentBox, that contains the iframe with the comments content
refs https://github.com/TryGhost/Team/issues/1858
fixes https://github.com/TryGhost/Team/issues/1789
- Split up the Comment component in many small Components to make it easier to read and maintain
- Added support for synchronous actions, which are required for actions that affect the context state based on the current value (e.g., increasing a value by one) because of the asynchronous nature of setState:
Before this change
```
// Context state: {hello: 0};
dispatchAction('increaseHelloByOne')
dispatchAction('increaseHelloByOne')
```
Could end up having a state `{hello: 1}` instead of the expected `{hello: 2}`, because underlying this would resolve into:
```
// Context state: {hello: 0};
const hello = {hello: 0};
setState({hello: hello + 1});
setState({hello: hello + 1});
```
Instead of
```
// Context state: {hello: 0};
setState(({hello}) => {hello: hello + 1});
setState(({hello}) => {hello: hello + 1});
```
Synchronous actions now support this.
- Removed deprecated `onAction` context state function
- Replaced the boolean based form checking by the more reliable counter based checking that uses synchronous actions (reason we needed synchronous actions) (fixes https://github.com/TryGhost/Team/issues/1789)
- Prevent creating a new `dispatchAction` function every time the context state changes, by using bind. This prevents infinte updates in `useEffect` hooks that depend on `dispatchAction` and also update the context via actions.
refs https://ghost.slack.com/archives/C02G9E68C/p1660323308235919
- When opening and closing a popup very fast, it will stay in DOM, blocking all pointer events.
- The Headless UI component <Transition show={show}> is not removed from DOM when show is set to true, and false very fast
- Fixed this by forcing a popup to get removed from DOM after 250ms after is has been closed.
- Updated HeadlessUI version
- Moved testing packges to dev dependencies