-
Notifications
You must be signed in to change notification settings - Fork 593
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit add http request a make reuested changes add vars fix lint errors add unit tests remove comments
- Loading branch information
Showing
21 changed files
with
803 additions
and
268 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import store from '@console/internal/redux'; | ||
import { coFetch } from '@console/internal/co-fetch'; | ||
|
||
export const coFetchText = (url: string) => { | ||
const headers = new Headers(); | ||
headers.set('Accept', 'application/json'); | ||
const { kind: impersonateKind, name: impersonateName } = store | ||
.getState() | ||
.UI.get('impersonate', {}); | ||
if ((impersonateKind === 'User' || impersonateKind === 'Group') && impersonateKind) { | ||
// Even if we are impersonating a group, we still need to set Impersonate-User to something or k8s will complain | ||
headers.set('Impersonate-User', impersonateName); | ||
if (impersonateKind === 'Group') { | ||
headers.set('Impersonate-Group', impersonateName); | ||
} | ||
} | ||
headers.set('method', 'GET'); | ||
return coFetch(url, headers).then((response) => { | ||
if (!response.ok) { | ||
return response.text(); | ||
} | ||
|
||
// If the response has no body, return promise that resolves with an empty object | ||
if (response.headers.get('Content-Length') === '0') { | ||
return Promise.resolve({}); | ||
} | ||
return response.text(); | ||
}); | ||
}; |
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 @@ | ||
export * from './co-fetch'; |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './formik-validation-fix'; | ||
export * from './deep-compare-memoize'; | ||
export * from './screenfull'; |
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,31 @@ | ||
import * as React from 'react'; | ||
import * as screenfull from 'screenfull'; | ||
|
||
export const useFullScreen = (node: HTMLElement): [boolean, () => void] => { | ||
const [isFullScreen, setIsFullScreen] = React.useState<boolean>(false); | ||
|
||
const fullScreenToggleCallback = React.useCallback(() => { | ||
if (node && screenfull.enabled) { | ||
screenfull.toggle(node); | ||
} | ||
}, [node]); | ||
|
||
React.useEffect(() => { | ||
if (screenfull.enabled) { | ||
screenfull.on('change', () => { | ||
setIsFullScreen(screenfull.isFullscreen); | ||
}); | ||
screenfull.on('error', () => { | ||
setIsFullScreen(false); | ||
}); | ||
} | ||
return () => { | ||
if (screenfull.enabled) { | ||
screenfull.off('change'); | ||
screenfull.off('error'); | ||
} | ||
}; | ||
}, []); | ||
|
||
return [isFullScreen, fullScreenToggleCallback]; | ||
}; |
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
1 change: 1 addition & 0 deletions
1
...nd/packages/dev-console/src/components/pipelineruns/detail-page-tabs/PipelineRunLogs.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
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
48 changes: 0 additions & 48 deletions
48
...d/packages/dev-console/src/components/pipelineruns/detail-page-tabs/PipelineTaskLogs.scss
This file was deleted.
Oops, something went wrong.
199 changes: 0 additions & 199 deletions
199
...nd/packages/dev-console/src/components/pipelineruns/detail-page-tabs/PipelineTaskLogs.tsx
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
frontend/packages/dev-console/src/components/pipelineruns/logs/Logs.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,14 @@ | ||
.odc-logs { | ||
// color: var(--pf-global--BackgroundColor--100); | ||
margin: 0; | ||
padding: var(--pf-global--spacer--sm) var(--pf-global--spacer--md); | ||
|
||
&__name { | ||
font-weight: var(--pf-global--FontWeight--bold); | ||
text-transform: uppercase; | ||
} | ||
|
||
&__content { | ||
padding-left: var(--pf-global--spacer--md); | ||
} | ||
} |
Oops, something went wrong.