Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat(CLI-terminal): Open terminal in new Tab
- Loading branch information
1 parent
61c0b63
commit ff7293a
Showing
7 changed files
with
65 additions
and
4 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
16 changes: 16 additions & 0 deletions
16
frontend/packages/console-app/src/components/cloud-shell/CloudShellTab.scss
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,16 @@ | ||
.co-cloud-shell-tab { | ||
width: 100%; | ||
height: 100%; | ||
overflow: hidden; | ||
background-color: var(--pf-global--Color--dark-100); | ||
&__header { | ||
height: var(--pf-global--target-size--MinHeight); | ||
background-color: var(--pf-global--palette--black-200); | ||
display: flex; | ||
align-items: center; | ||
padding-left: var(--pf-global--spacer--md); | ||
} | ||
&__restorelink { | ||
color: var(--pf-global--primary-color--100); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
frontend/packages/console-app/src/components/cloud-shell/CloudShellTab.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,12 @@ | ||
import * as React from 'react'; | ||
import CloudShellTerminal from './CloudShellTerminal'; | ||
import './CloudShellTab.scss'; | ||
|
||
const CloudShellTab: React.FC = () => ( | ||
<div className="co-cloud-shell-tab"> | ||
<div className="co-cloud-shell-tab__header">OpenShift command line terminal</div> | ||
<CloudShellTerminal /> | ||
</div> | ||
); | ||
|
||
export default CloudShellTab; |
13 changes: 13 additions & 0 deletions
13
frontend/packages/console-app/src/components/cloud-shell/CloudShellTabHeader.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,13 @@ | ||
import * as React from 'react'; | ||
import { Flex, FlexItem, FlexModifiers } from '@patternfly/react-core'; | ||
import './CloudShellTab.scss'; | ||
|
||
const CloudShellTabHeader: React.FC = () => ( | ||
<Flex breakpointMods={[{ modifier: FlexModifiers.grow }]}> | ||
<FlexItem> | ||
<span data-test-id="terminal-tab-header">OpenShift command line terminal</span> | ||
</FlexItem> | ||
</Flex> | ||
); | ||
|
||
export default CloudShellTabHeader; |
2 changes: 2 additions & 0 deletions
2
frontend/packages/console-app/src/components/cloud-shell/CloudShellTerminalFrame.scss
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
15 changes: 15 additions & 0 deletions
15
frontend/packages/console-app/src/components/cloud-shell/__tests__/CloudShellTab.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,15 @@ | ||
import * as React from 'react'; | ||
import { mount } from 'enzyme'; | ||
import { Provider } from 'react-redux'; | ||
import store from '@console/internal/redux'; | ||
import CloudShellTab from '../CloudShellTab'; | ||
import CloudShellTerminal from '../CloudShellTerminal'; | ||
|
||
describe('CloudShell Tab Test', () => { | ||
it('should render cloudshellterminal', () => { | ||
const cloudShellTabWrapper = mount(<CloudShellTab />, { | ||
wrappingComponent: ({ children }) => <Provider store={store}>{children}</Provider>, | ||
}); | ||
expect(cloudShellTabWrapper.find(CloudShellTerminal).exists()).toBe(true); | ||
}); | ||
}); |
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