Commit Graph

125 Commits

Author SHA1 Message Date
dependabot-preview[bot]
0cdf1d376e Build(deps-dev): bump eslint-config-standard-jsx from 6.0.2 to 8.1.0 (#3943)
* Build(deps-dev): bump eslint-config-standard-jsx from 6.0.2 to 8.1.0

Bumps [eslint-config-standard-jsx](https://github.com/standard/eslint-config-standard-jsx) from 6.0.2 to 8.1.0.
- [Release notes](https://github.com/standard/eslint-config-standard-jsx/releases)
- [Commits](https://github.com/standard/eslint-config-standard-jsx/compare/v6.0.2...v8.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Clean lint; add rel="noopener noreferrer"

Ref https://mathiasbynens.github.io/rel-noopener
2019-09-04 00:34:44 +00:00
Paul Melnikow
fb186e2cf5 Typescripterize QueryStringBuilder and PathBuilder (#3885) 2019-08-25 14:46:37 -04:00
chris48s
dd89b19266 add missing alt text to some <img> tags (#3903) 2019-08-25 07:27:10 -04:00
Paul Melnikow
35ef9be434 Typescripterize BadgeExamples and SuggestionAndSearch (#3879)
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.
2019-08-21 08:25:03 +01:00
chris48s
5168675d0d move [githubtag] and [githubrelease] under /v, move variants to query params (#3610)
* 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
2019-08-17 22:16:41 +01:00
Paul Melnikow
583cc22471 Typescripterize StaticBadgeMaker (#3876) 2019-08-16 19:20:42 +03:00
Paul Melnikow
b36d01ba50 More TypeScript in the frontend (#3742) 2019-08-16 18:29:05 +03:00
Paul Melnikow
cfbd2c30df SVG by default (#3717)
Make cleaner badge URLs by omitting the `.svg` extension.

Closes #2674
2019-07-24 12:57:39 -05:00
Paul Melnikow
e6f8c4ed65 Fix extraneous brackets in query string builder (#3766)
Fix #3765
2019-07-24 12:13:50 -05:00
Paul Melnikow
0e181f16b5 Rewrite QueryStringBuilder using hooks (#3740) 2019-07-23 12:08:19 -05:00
Paul Melnikow
28b8836595 Unify the ESLint config (#3743)
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).
2019-07-22 15:06:38 -05:00
Paul Melnikow
ec6512b7ba Rewrite RequestMarkupButton using hooks (#3739) 2019-07-21 13:48:49 -05:00
Paul Melnikow
236decac29 Rewrite Main using hooks (#3738) 2019-07-19 12:27:25 -05:00
Paul Melnikow
4090ab8a01 Rewrite SugggestionAndSearch using hooks (#3741) 2019-07-19 12:10:10 -05:00
Paul Melnikow
88fc4a751c Initial adoption of TypeScript in the frontend (#3722)
Ref #3657
2019-07-17 23:11:51 -04:00
Paul Melnikow
d4e17d4e94 Rewrite PathBuilder using hooks (#3721) 2019-07-17 22:02:01 -04:00
Paul Melnikow
5d3d78b209 Rewrite Customizer using hooks (#3720) 2019-07-17 21:15:30 -04:00
Paul Melnikow
be275b9f13 Rewrite CopiedContentIndicator using hooks (#3719) 2019-07-17 16:16:42 -04:00
Pierre-Yves B
c6ef885b75 Footer update (#3655)
* Reworded footer

* Added metrics link
2019-07-06 17:14:13 +01:00
dependabot-preview[bot]
ec17c4d67e Build(deps-dev): bump js-yaml-loader from 1.2.0 to 1.2.2 (#3628)
* Build(deps-dev): bump js-yaml-loader from 1.2.0 to 1.2.2

Bumps [js-yaml-loader](https://github.com/wwilsman/js-yaml-loader) from 1.2.0 to 1.2.2.
- [Release notes](https://github.com/wwilsman/js-yaml-loader/releases)
- [Commits](https://github.com/wwilsman/js-yaml-loader/compare/v1.2.0...v1.2.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* clarify how service defs are loaded
2019-07-01 18:39:31 -04:00
dependabot-preview[bot]
7ed502e23d Build(deps-dev): bump enzyme from 3.9.0 to 3.10.0 (#3579)
* Build(deps-dev): bump enzyme from 3.9.0 to 3.10.0

Bumps [enzyme](https://github.com/airbnb/enzyme/tree/HEAD/packages/enzyme) from 3.9.0 to 3.10.0.
- [Release notes](https://github.com/airbnb/enzyme/releases)
- [Changelog](https://github.com/airbnb/enzyme/blob/master/CHANGELOG.md)
- [Commits](https://github.com/airbnb/enzyme/commits/enzyme@3.10.0/packages/enzyme)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* tests: tweak assertion on emtpy attribute
2019-06-24 21:09:04 -05:00
Caleb Cartwright
b95811ba40 fix: modal scroll bug (#3517) 2019-06-02 11:42:16 -05:00
Mackenzie Miller
ca49e522b3 Make dropdown visible when it overflows modal content (#3510)
Resolves #2806
2019-05-30 21:51:06 -04:00
Marcin Mielnicki
9008c4ef0f Show a badge pattern instead of a badge url (#3438)
* 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
2019-05-29 21:17:27 +02:00
Paul Melnikow
5e8fcc3b3c MarkupModal: Convert from class component to function component (#3415)
This continues the work from #3096, of converting our class components to function components.
2019-05-06 12:13:06 -04:00
Paul Melnikow
1da791e778 LogoPage: Update function style (#3414)
Many of the components (e.g. the ones in `common.js`) have already been converted to this style. This file was missed.
2019-05-06 09:51:07 +01:00
Paul Melnikow
c3bc0ac96f Take the Endpoint badge out of beta (#3405)
Close #2838
2019-05-01 23:05:34 -04:00
Marcin Mielnicki
eeb78ccf15 Badge suggestion feature fix (#3331)
* 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
2019-04-29 18:38:27 +02:00
tooomm
4911e11584 add more helpful syntax links to dynamic badges (#3223) 2019-03-22 22:00:10 +00:00
Paul Melnikow
667bbbebfa Rewrite a bunch of components as functions, with consistent func style (#3177) 2019-03-08 00:02:23 -05:00
Paul Melnikow
b288c99a29 Fix console error before applying a frontend route redirect (#3176) 2019-03-07 19:34:27 -06:00
Paul Melnikow
c7deb5a0d1 First adoption of React hooks (#3096)
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.
2019-03-03 18:30:20 -05:00
XhmikosR
4e2d144f97 Fix footer links (#3121)
Fix discord footer link and remove trailing slash from repo URL
2019-02-28 11:55:38 -05:00
Paul Melnikow
e3d115cf99 Rename maxAge to cacheSeconds (#3090)
Close #3069
2019-02-23 20:33:38 -05:00
Paul Melnikow
09e902fa38 Add frontend prop-type validation for the service definition schema (#3063)
Closes #2702
2019-02-23 15:34:49 -05:00
Paul Melnikow
cd49bda968 Improve coverage in frontend and remove some dead code (#3031) 2019-02-22 00:08:11 -05:00
Paul Melnikow
ab18bc0f09 Shorten [endpoint] URL (#3050)
Ref https://github.com/badges/shields/issues/2838#issuecomment-461794344
2019-02-22 00:01:56 -05:00
Paul Melnikow
4bd16f93e8 Sort imports and requires (#3056)
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
2019-02-21 22:14:40 -05:00
mbarkhau
f6628e62b7 [QueryStringStatic] service (#3024)
Ref #2673
2019-02-21 21:12:24 -05:00
Paul Melnikow
9e4a8cec09 Consolidate badge URL generation functions (#3032)
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
2019-02-21 21:07:27 -05:00
Paul Melnikow
5fda6ac11e Alphabetize JSX props in the frontend (#3055)
I'm game to give this a shot.

Ref #2701
2019-02-20 18:58:24 -05:00
Paul Melnikow
bc523e3aae Fix your-badge link (#3058)
Fix #1954
2019-02-20 16:34:50 -05:00
chris48s
6d4b80f124 improve docs for simple-icons usage (#3007)
Closes #2980
2019-02-19 22:14:19 -05:00
mbarkhau
6e2992a3e3 Rename colorB -> color; colorA -> labelColor (#3012)
This makes it possible to override the parameters `color` and `labelColor`.

ref #2673
2019-02-19 22:03:45 -05:00
Paul Melnikow
ad81f3c6ec Improve handling of some edge cases and get 100% coverage in generate-image-markup (#3030) 2019-02-18 19:25:02 -06:00
Paul Melnikow
0506a1762b Omit style=flat from generated URLs (#3025)
Fix #2953
2019-02-18 18:01:44 -05:00
Paul Melnikow
d9d8a3b227 Drop-downs for multiple choice in patterns (#2882)
You can see it in effect on the PyPI downloads and the David badges.
2019-02-18 11:15:58 -05:00
chris48s
0da1bb2b08 fix asciiDoc links (#3006) 2019-02-17 21:55:22 +00:00
Ville Skyttä
0d4a74bd6b Spelling fixes (#3013) 2019-02-17 14:10:06 -05:00
Paul Melnikow
90f8ad5b73 Endpoint customizer (#2908)
* 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
2019-02-14 19:08:56 -06:00