The two different kinds of data that can be passed to `<BadgeExample />` were a bit less similar than I thought, so this includes a little refactor related to that which isn't perfect, but leaves things in a cleaner place than before.
* move GH tag and release under /v, move variants to query params
- move github /tag and /release under /v
- both sort by date as default
- specify sort=date/semver, include_prereleases as query params
- use graphql api for tags
* pass string params from example defs to modal
Adding TypeScript to the frontend and a `.d.ts` file to `core` (see #3742) has multiplied out the different combinations of lint rules. ESLint has support for file-pattern-based overrides, which we've used in some places, but we've also maintained a separate eslintrc for `frontend/`.
This merges the config together, with the strategy of putting all the rules at the top level except where they conflict, and applying settings to exactly the files where they should apply.
This introduces a few new errors in the server but they are true positives – hoisting and lowercase class names – things we don't really need to be doing).
* Show patterns instead of real paths
* realBadge property instead of preview.buildFromExample
* E2e test for displaying a badge
* Check bagde url in badge wrapper
* expectBadgeExample helper function
* Remove a hostname from badge url
* Simpler Cypress assertions
* realBadge -> isBadgeSuggestion
* Do not show regexp in patterns
* Display suggested badges
* E2e test for badge suggestion
* Suggest resource returns example with pattern
* Do not require preview in MarkupModalContent
* Skip integration test for suggestion
* Unmodifiable path in customizer
* Use suggested link
* Allow to change suggested badges
* Enable skipped test
* Enable skipped test
* Code refactoring
* Code refactoring
* Code refactoring
* Code refactoring
* Code refactoring
* Code refactoring
* Unused code removed
* Unused code removed
* getExampleWithServiceByPattern helper added
* BadgeExamples uses examples instead of services definitions
* Revert "getExampleWithServiceByPattern helper added"
This reverts commit 80839fd705.
* style removed from example
* example.exact replaced with preview.buildFromExample
* keywords are required again
* Code refactoring
* More e2e tests for suggestion feature
* Code refactoring
* Build add with a base url
* showActualParams -> isPrefilled
* A new schema for BadgeExamples
* Link moved to queryParams
* Updated documentation for the suggest reponse format
* Link moved to queryParams - another test updated
* Revert "Link moved to queryParams - another test updated"
This reverts commit b5f811bb07.
* Revert "Link moved to queryParams"
This reverts commit 3b54c6d2b4.
* Disable changes in path in suggested badges
* 'link' element documentation restored
I did this as a warm-up to using [React hooks](https://reactjs.org/docs/hooks-intro.html), which provide a better way to accomplish stateful things and side effects using functional components. This allows all components to be written in the same style, improves testability, facilitates code reuse, etc.
There's [a intro here](https://reactjs.org/docs/hooks-intro.html) which links to [Dan's talk at React Conf](https://www.youtube.com/watch?time_continue=3599&v=dpw9EHDh2bM) which does a really good job of explaining why hooks are a good way to write components. He describes hooks as being the electrons and neutrons to components which are atoms. Low-level functionality which was always there in React, though not as accessibly or visibly.
This adds a lint rule that enforces "the rule of hooks" which says they have to be declared at the top level in the functional component.
I don't think this changeset does a fabulous job of showing off the improvements hooks allows, though I think it is still a good direction for this code.
This will definitely save time, and ensure more uniformity.
It moves the `createServiceTester()` calls to a different place from where I'd like them, though I'm happy to have them checked by the linter.
Closes#2701
This consolidates all the badge URL generation functions into a single place, and updates the rest of the calling code to use it. It renames some things and updates labels to bring the names into alignment with the current API.
Resolve#2027
* Endpoint page: improve formatting
Cherry-picked from #2906 (conflicts with that)
Partly addresses #2837 but does not resolve it
* Add badge customizer to the endpoint page
* Clean lint