Skip to content
This repository has been archived by the owner on Nov 19, 2021. It is now read-only.

Commit

Permalink
Merge pull request #184 from backstage/fix-serve-no-docker
Browse files Browse the repository at this point in the history
Fix serve  command with no docker
  • Loading branch information
camilaibs authored Oct 22, 2021
2 parents 3c97216 + 6ea9e7f commit 9c44b9a
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .changeset/rotten-cycles-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@techdocs/cli': patch
---

The [change](https://github.com/backstage/techdocs-cli/commit/b25014cec313d46ce1c9b4f324cc09047a00fc1f) updated the `@backstage/techdocs-common` from version `0.9.0` to `0.10.2` and one of the intermediate versions, the [0.10.0](https://github.com/backstage/backstage/blob/cac4afb95fdbd130a66e53a1b0430a1e62787a7f/packages/techdocs-common/CHANGELOG.md#patch-changes-2), introduced the use of search in context that requires an implementation for the Search API.

Created a custom techdocs page to disable search in the Reader component, preventing it from using the Search API, as we don't want to provide search in preview mode.
1 change: 1 addition & 0 deletions packages/embedded-techdocs-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"@backstage/cli": "^0.7.8",
"@backstage/config": "^0.1.6",
"@backstage/core": "^0.7.14",
"@backstage/core-components": "^0.7.0",
"@backstage/integration-react": "^0.1.7",
"@backstage/plugin-catalog": "^0.7.1",
"@backstage/plugin-techdocs": "^0.12.2",
Expand Down
5 changes: 4 additions & 1 deletion packages/embedded-techdocs-app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
} from '@backstage/plugin-techdocs';
import { apis } from './apis';
import { Root } from './components/Root';
import { techDocsPage } from './components/TechDocsPage';
import * as plugins from './plugins';

const app = createApp({
Expand All @@ -34,7 +35,9 @@ const routes = (
<Route
path="/docs/:namespace/:kind/:name/*"
element={<TechDocsReaderPage />}
/>
>
{techDocsPage}
</Route>
</FlatRoutes>
);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Copyright 2021 Spotify AB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import React from 'react';

import { Content } from '@backstage/core-components';

import {
Reader,
TechDocsPage,
TechDocsPageHeader,
} from '@backstage/plugin-techdocs';

const DefaultTechDocsPage = () => {
const techDocsMetadata = {
site_name: 'Live preview environment',
site_description: '',
};

return (
<TechDocsPage>
{({ entityRef, onReady }) => (
<>
<TechDocsPageHeader
techDocsMetadata={techDocsMetadata}
entityRef={entityRef}
/>
<Content data-testid="techdocs-content">
<Reader
onReady={onReady}
entityRef={entityRef}
withSearch={false}
/>
</Content>
</>
)}
</TechDocsPage>
);
};

export const techDocsPage = <DefaultTechDocsPage />;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './TechDocsPage';

0 comments on commit 9c44b9a

Please sign in to comment.