Commit Graph

117 Commits

Author SHA1 Message Date
Matei David a5e27d5c1d Introduce techdocs metadata in techdocs-common
* Add TechdocsMetadata type in backend plugin endpoint
 * Introduce TechDocsMetadata type in frontend
 * Add changeset
 * Remove old thennable metadata resp
 * Address PR feedback
  - Remove explicit type annotation on TechDocsMetadata
  - Reintroduce res.send instead of throwing an error
  - Change logger info to logger error
 * Add TechDocsMetadata type in frontend plugin
 * Commit yarn.lock
 * Introduce JSON5 and remove parsing in local pub
Signed-off-by: Matei David <matei.david.35@gmail.com>
2021-01-16 18:33:53 +00:00
Fredrik Adelöw a6f9dca0dc plugins should not depend on core-api 2021-01-14 08:54:54 +01:00
Kevin Lee 99a778ac9f Use history.pushState for hash link navigation in techdocs 2021-01-13 23:21:34 +01:00
Himanshu Mishra 9d08ef8f46 techdocs: replace 'build' with 'generate' in most places 2020-12-09 16:01:29 +01:00
Himanshu Mishra 9bd130a73a techdocs: Use 'local' and 'external' for alternatives for techdocs.builder config
Co-authored-by: freben <freben@gmail.com>
2020-12-09 12:31:40 +01:00
Himanshu Mishra 8736de114a Merge remote-tracking branch 'origin/master' into orkohunter/techdocs-publish-to-cloud-storage 2020-12-08 08:12:38 +01:00
Sebastian Qvarfordt 87a33d2fe8 [TechDocs] Bug fixes and cleanups (#3599)
* Fixed issue with some internal doc links reloading the page and removed modifyCss transformer

* Create silly-kiwis-rest.md

* Formatting in changeset
2020-12-07 16:49:24 +01:00
Himanshu Mishra a212e43142 techdocs: Add JSON Schema config
Show better error if techdocs.builder is set to 'ci' and if no docs are found.
Return 404 from googleStorage client when a file is not found.
2020-12-05 10:48:54 +01:00
Himanshu Mishra 11340fb2f6 techdocs: Remove spinners
Spinners cause unnecessary UX distraction.
Case 1 (when docs are built and are to be served): Spinners appear for a split second before the name of site shows up. This unnecessarily distracts eyes because spinners increase the size of the Header. A dot (.) would do fine. Definitely more can be done.
Case 2 (when docs are being generated): There is already a linear progress bar (which is recommended in Storybook). Spinners are not good. 🤷
2020-12-04 22:09:38 +01:00
Himanshu Mishra 85af34ffd5 techdocs: Use EntityName from catalog-model as Entity type 2020-11-28 20:02:40 +01:00
Himanshu Mishra dbca620ff9 Use fs-extra and async file read method 2020-11-26 20:41:40 +01:00
Himanshu Mishra 266e93b478 TechDocs: Refactor metadata retrieval
1. Don't use mkdocs in name of APIs or variables. It is an implementation detail and liable to change in future.
2. techDocsApi.getMetadata('mkdocs') and techDocsAPI.getMetadata('entity') should be two separate functions just because their responses differ in structure. They should also be type checked.
3. Use either 'techdocs' or 'TechDocs' consistently. 'techDocs' seems like an unnecessary third way to write TechDocs, which can be avoided.
4. Remove unused /plugins/techdocs-backend/src/service/metadata.ts file
2020-11-25 19:39:48 +01:00
Himanshu Mishra 8fd5e64351 TechDocs: Tell users when index.md is missing (better error message) (#3429)
* TechDocs: Logger already prints the name of plugin

* TechDocs: Display a custom error message if provided

* TechDocs: throw custom error message if index.md is not present

* Language improvements. Thanks @freben

Co-authored-by: Fredrik Adelöw <freben@gmail.com>

Co-authored-by: Fredrik Adelöw <freben@gmail.com>
2020-11-25 09:52:19 +01:00
Himanshu Mishra 1d55b1e976 Merge pull request #3336 from backstage/mob/techdocs-storage-solutions-spec 2020-11-24 14:30:42 +01:00
Himanshu Mishra 8fc3fc9629 TechDocs: Document basic and recommended architecture 2020-11-23 17:41:58 +01:00
Fredrik Adelöw 717e43de14 catalog-client: change entities interface, add fields support (#3296) 2020-11-18 19:58:36 +01:00
Fredrik Adelöw 42b0dbddcb feat(catalog-client): create a basic catalog client (#3166) 2020-11-04 13:18:03 +01:00
Vividh Chandna e29ffbe411 fix(TechDocs): Fix broken page title while fetching metadata 2020-10-27 16:53:27 +05:30
canut 8de84c77fc Remove MkDocs copyright from documentation pages (#3072)
* Simplify MkDocs footer in documentation pages

* Update plugins/techdocs/src/reader/transformers/simplifyMkdocsFooter.ts

Co-authored-by: Emma Indal <emma.indahl@gmail.com>

Co-authored-by: Emma Indal <emma.indahl@gmail.com>
2020-10-26 11:56:10 +01:00
blam 1bc1c3af06 Merge branch 'master' of github.com:spotify/backstage into migrate-to-msw
* 'master' of github.com:spotify/backstage:
  Read git auth token from backend config (#2992)
  chore(catalog-model): add the petstore into the default entities
  chore(deps-dev): bump @storybook/addon-actions from 6.0.21 to 6.0.26
  chore(deps): bump eslint-config-prettier from 6.10.0 to 6.14.0
  Add API docs link to About card
  adds a sample organization set of users and groups (#2963)
  Make sure hasCostsWithinTimeframe is a boolean
  fix(catalog-backend): fix codeowners processor to handle users
  feat(catalog): add simple client side paging
  default to last 30 days
  Removed default-branch library since it's no longer used (#3019)
  useRealTimers in  onCssReady test case
  move type dependecy
  remove unused import
  changeset
  simpler query params
2020-10-22 11:02:32 +02:00
Abhishek Jakhar 53f9d70658 useRealTimers in onCssReady test case 2020-10-21 15:43:02 +05:30
blam 101978963d Merge branch 'master' of github.com:spotify/backstage into migrate-to-msw
* 'master' of github.com:spotify/backstage: (139 commits)
  Cleanup
  Update PinButton.test.tsx
  feat: update github insights plugin version (#2973)
  Ignore IntelliJ *.iml files (#2971)
  chore(deps): bump rollup-plugin-dts from 1.4.11 to 1.4.13
  fix the plugin card on plugins page
  align 'Add to Marketplace' button on plugins page
  fix the PluginGrid on mobiles sizes
  use getBy query instead of queryBy when asserting for elements present in document (#2951)
  Update PinButton.tsx
  Add test case for Progress component (#2953)
  fix the styling of footer copy on mobile
  add changeset
  handle the case where no entities are available to show
  core-api: work around issue with ApiRef export const declarations
  core-api: move utility api system implementation into apis/system
  Update docs regarding npm config ignore-scripts flag
  Another try
  Fix Core Features configuration id (#2948)
  Fix test?
  ...
2020-10-19 23:57:40 +02:00
Abhishek Jakhar 782f3b3541 Add test case for Progress component (#2953)
* remove data-testid from div

* add test case for Progress component

* add changeset

* update the GraphiQLPage test cases to handle Progress timeout

* update the RadarComponent and RadarPage test case to handle Progress timeout

* update the TechDocsProgressBar test case to handle Progress timeout

* add changeset
2020-10-19 10:33:30 +02:00
Patrik Oldsberg 5ff5b1325d Merge pull request #2739 from Marvin9/feat/flexible-theme-for-page
feat: theme customization for pages
2020-10-16 12:47:05 +02:00
Marvin9 8f0608a5ed chore: refactor 2020-10-15 09:16:39 +05:30
Eric Nilsson 08f5e0311f TechDocsPageHeader: Changed repo location icon (#2895) 2020-10-14 11:03:41 +02:00
blam e44cb85b22 Merge branch 'master' of github.com:spotify/backstage into migrate-to-msw
* 'master' of github.com:spotify/backstage: (66 commits)
  chore: fix lerna linting
  v0.1.1-alpha.25
  Add Code Insights plugin to sample app and marketplace (#2833)
  Improve main CI build status badge in README (#2866)
  Update roadmap: Design System 🚢 (#2858)
  github/codecov: switch to informational mode
  github/workflows: use the tip of master as the base for comparing PR code coverage
  make saml provider path from globalConfig (#2855)
  fix(catalog-backend): limit search value lengths
  Update project Copyright (#2852)
  fix(catalog-backend): actually use modified entity output (default namespace was broken)
  remove unnecessary center keyword
  Move card header bg to up contrast, fix #2558
  Update name of env authentication env vars
  Fix feedback from dtuite
  Remove chart testing workflow for now
  Only lint charts on Pull Requests
  Move the k8s deployment docs to its own helm deployment page
  Remove line in initdb script that creates backend db
  Use app-config.development.yaml to provide configuration instead of local
  ...
2020-10-13 03:56:13 +02:00
Marvin9 6e3ba7c2c4 chore: resolve conflicts 2020-10-11 19:19:35 +05:30
Marvin9 6d68f6fec1 feat: consume theme provided by Page theme provider 2020-10-11 19:14:23 +05:30
Stefan Ålund 8d666e43bd Use MissingAnnotationEmptyState for plugins (#2824) 2020-10-09 15:11:15 +02:00
blam b33353dd39 Merge branch 'master' of github.com:spotify/backstage into migrate-to-msw
* 'master' of github.com:spotify/backstage: (110 commits)
  chore(catalog-backend): removing redudant classes and some functions
  chore(deps-dev): bump @types/webpack from 4.41.21 to 4.41.22 (#2765)
  move codecov.yml to .github
  feat(catalog-backend): add batch concurrency
  create-app: remove build step
  cli: simplify jest transform ignore regex
  feat(catalog-backend): introduce batching, speed up reading and writing of large datasets
  Techdocs: add Azure DevOps prepare support (#2748)
  feat(techdocs-header): Show breadcrumbs on docs page (#2786)
  changesets: add entry for create-app template location fix
  create-app: revert to github location type for example templates
  fix: make catalog filter work again
  Use new url scheme for techdocs
  feat: remove LocationProcessor.processEntity
  Add Dockerfile for helm chart
  feat: use the new UrlReader in the CodeOwnersProcessor
  feat: use new UrlReader in PlaceholderProcessor
  feat: remove the backstage.io/definition-at-location annotation
  Update loud-lamps-visit.md
  feat(proxy-backend): limit the forwarded http headers to a safe set
  ...
2020-10-09 14:48:32 +02:00
blam a0604474c1 chore: removing the last of the deps in the plugins 2020-10-09 13:49:10 +02:00
Himanshu Mishra c852e7b09d Merge pull request #2812 from spotify/sebastianq/techdocs-new-component-url
[TechDocs] Use new url scheme for techdocs
2020-10-09 10:41:47 +02:00
Mahmood Hosseini 4295a248e9 feat(techdocs-header): Show breadcrumbs on docs page (#2786) 2020-10-08 23:26:41 +02:00
Sebastian Qvarfordt ae499a55ff Use new url scheme for techdocs 2020-10-08 16:59:30 +02:00
Sebastian Qvarfordt 29ec8c2f09 TechDocs: Fix reload when clicking internal docs pages (#2784)
* Check to see if links start with window.location.origin to see if we should handle it as a internal docs link

* Fixed failing test

* Fix lint issues
2020-10-08 11:26:46 +02:00
Marvin9 7db0ffb6e5 feat: add rel to <a> & few <Link> tags 2020-10-06 21:19:31 +05:30
Marvin9 e2564645e5 feat: Replace old page theme props with new ones 2020-10-04 18:03:50 +05:30
Emma Indal 497675538c TechDocs: browse metadata (#2682)
* feat(techdocs): TechDocsPageWrapper to take in labels prop and use TechDocsHeader component

* feat(techdocs): new TechDocsHeader component as wrapper around Header from core

* feat(techdocs): TechDocsPage metadata

* feat(techdocs): TechDocsMetadata class responsible for reading metadata from generated techdocs metadata json file

* fix(techdocs): delete TechDocsPageWrapper component

* fix(app-config): delete /docs from request url

* feat(techdocs): TechDocsHeader with labels to browse metadata

* fix(techdocs): move metadata to backend plugin

* feat(techdocs-backend): introduce two new metadata routes

* feat(techdocs): new techdocs api to be responsible to request metadata from backend

* feat(techdocs): register new api for plugin

* fix(techdocs): reader to take in onReady prop

* fix(techdocs): TechDocsHome component to use its own header

* fix(techdocs): TechDocsPage responsible to get metadata and pass it down to the TechDocsHeader

* fix(techdocs): component tests for both TechDocsHeader and TechDocsPage

* fix(techdocs): adjust api to use /docs in url since it was taken away in requestURL

* fix(tests): move assertion into act

* fix(techdocs): rename TechDocsHeader to TechDocsPageHeader

* fix(techdocs): rename TechDocsHeader to TechDocsPageHeader

* fix(techdocs-backend): add some logs

* Update plugins/techdocs/src/reader/components/TechDocsPage.test.tsx

* delete unused import
2020-10-01 10:12:24 +02:00
Navaneeth Suresh e85030902f Add a message if techdocs takes long time to load 2020-09-26 21:49:49 +05:30
Sebastian Qvarfordt 19e34b5319 TechDocs: Inject CSS transformer and initial backstage style integration for reader (#2560)
* Inject CSS transformer and initial backstage style integration for reader

* Update plugins/techdocs/src/reader/transformers/injectCss.test.ts

Co-authored-by: Emma Indal <emmai@spotify.com>

* Fix test name and run injectCss in preTransformer

* Fix for invisible links in reader

* Added missing semi-colon

* Better styling on codeblocks

Co-authored-by: Emma Indal <emmai@spotify.com>
2020-09-23 16:40:18 +02:00
Sebastian Qvarfordt 999ff914af TechDocs: Enable allowVulnerableTags in sanitize-html (#2554)
* enable allowVulnerableTags in sanitize-html

* Fixed lint issue

* Removed style tag from allowed list. Seems to work fine.

* Added tests to make sure we keep link tags and remove style tags
2020-09-22 14:22:52 +02:00
Emma Indal 296b6376e3 fix unclickable external links (#2396) 2020-09-10 12:05:22 +02:00
Sebastian Qvarfordt d865f88344 [TechDocs] Rebuild docs if the github source is newer than last docs build (#2353)
* Added age check for documentation in github to make sure it's up to date

* Updated failing tests

* Updated docs to explain requestUrl and storageUrl

* Updated failing tests

* Update packages/create-app/templates/default-app/app-config.yaml.hbs

* Update docs/features/techdocs/getting-started.md

Co-authored-by: Emma Indal <emmai@spotify.com>
2020-09-09 16:05:28 +02:00
alandovskis f88d8873a8 Display Warning if TechDocs Annotation is Missing (#2319)
* Display warning if TechDocs annotation is missing.

* TechDocs: Add link to Getting Started when annotation is missing.
2020-09-09 08:52:36 +02:00
Patrik Oldsberg 38b6703102 core-api: change ApiFactory.implements to .api 2020-09-08 11:31:48 +02:00
Patrik Oldsberg aa235dd154 app: move api factories out to plugins 2020-09-08 11:31:47 +02:00
Emma Indal 969cf48858 [TechDocs] migrate techdocs to use new routing/catalog api (#2312)
* migrate techdocs to use new routing

* use new techdocs routing in default app

* new EntityPageDocs and Router components

* remove unused code

* remove unused import
2020-09-07 16:56:03 +02:00
Patrik Oldsberg b045b166b6 run prettier 2020-09-05 16:37:30 +02:00
Sebastian Qvarfordt 0b2f787699 Updated docs for techdocs plugin (#2127)
* Updated docs for techdocs plugin

* Error in example comment

* Update plugins/techdocs/README.md

Co-authored-by: Emma Indal <emmai@spotify.com>

* Update plugins/techdocs/src/reader/README.md

Co-authored-by: Emma Indal <emmai@spotify.com>

* Update plugins/techdocs/src/reader/README.md

Co-authored-by: Emma Indal <emmai@spotify.com>

* Update plugins/techdocs/src/reader/README.md

Co-authored-by: Emma Indal <emmai@spotify.com>

* Update link to transformers doc to point to reader doc for now

Co-authored-by: Emma Indal <emmai@spotify.com>
2020-08-27 09:52:49 +02:00