Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Editor Selector improvements (#1079)
* feat: default editor flow Signed-off-by: Oleksii Kurinnyi <okurinny@redhat.com> * feat: show 'Tech Preview' tag Signed-off-by: Oleksii Kurinnyi <okurinny@redhat.com> --------- Signed-off-by: Oleksii Kurinnyi <okurinny@redhat.com>
- Loading branch information
Showing
19 changed files
with
485 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...ontend/src/components/EditorSelector/DocsLink/__tests__/__snapshots__/index.spec.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`DocsLink snapshot 1`] = ` | ||
<div | ||
className="pf-l-flex" | ||
> | ||
<div | ||
className="pf-m-align-right" | ||
> | ||
<a | ||
aria-disabled={false} | ||
aria-label={null} | ||
className="pf-c-button pf-m-link pf-m-inline" | ||
data-ouia-component-id="OUIA-Generated-Button-link-1" | ||
data-ouia-component-type="PF4/Button" | ||
data-ouia-safe={true} | ||
disabled={null} | ||
href="https://eclipse.dev/che/docs/stable/end-user-guide/defining-a-common-ide/" | ||
role={null} | ||
target="_blank" | ||
type={null} | ||
> | ||
How to specify and use a custom editor | ||
</a> | ||
</div> | ||
</div> | ||
`; |
29 changes: 29 additions & 0 deletions
29
packages/dashboard-frontend/src/components/EditorSelector/DocsLink/__tests__/index.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright (c) 2018-2024 Red Hat, Inc. | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
import { DocsLink } from '@/components/EditorSelector/DocsLink'; | ||
import getComponentRenderer from '@/services/__mocks__/getComponentRenderer'; | ||
|
||
const { createSnapshot } = getComponentRenderer(getComponent); | ||
|
||
describe('DocsLink', () => { | ||
test('snapshot', () => { | ||
const snapshot = createSnapshot(); | ||
expect(snapshot.toJSON()).toMatchSnapshot(); | ||
}); | ||
}); | ||
|
||
function getComponent() { | ||
return <DocsLink />; | ||
} |
37 changes: 37 additions & 0 deletions
37
packages/dashboard-frontend/src/components/EditorSelector/DocsLink/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright (c) 2018-2024 Red Hat, Inc. | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
*/ | ||
|
||
import { Button, Flex, FlexItem } from '@patternfly/react-core'; | ||
import React from 'react'; | ||
|
||
const DOCS_DEFINING_A_COMMON_IDE = | ||
'https://eclipse.dev/che/docs/stable/end-user-guide/defining-a-common-ide/'; | ||
|
||
export class DocsLink extends React.PureComponent { | ||
public render() { | ||
return ( | ||
<Flex> | ||
<FlexItem align={{ default: 'alignRight' }}> | ||
<Button | ||
component="a" | ||
href={DOCS_DEFINING_A_COMMON_IDE} | ||
variant="link" | ||
isInline | ||
target="_blank" | ||
> | ||
How to specify and use a custom editor | ||
</Button> | ||
</FlexItem> | ||
</Flex> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.