Skip to content

Commit

Permalink
Merge branch 'main' into replace-minikube
Browse files Browse the repository at this point in the history
  • Loading branch information
skoeva authored Jun 26, 2024
2 parents e96d25a + b9e15b7 commit cf614a3
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface ResourceListViewWithResourceClassProps<ItemType>
}

export default function ResourceListView<ItemType>(
props: ResourceListViewProps<ItemType> | ResourceListViewWithResourceClassProps<ItemType>,
props: ResourceListViewProps<ItemType> | ResourceListViewWithResourceClassProps<ItemType>
) {
const { title, children, headerProps, ...tableProps } = props;
const withNamespaceFilter =
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/common/Resource/ResourceTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export interface ResourceTableFromResourceClassProps<RowItem>
}

export default function ResourceTable<RowItem>(
props: ResourceTableFromResourceClassProps<RowItem> | ResourceTableProps<RowItem>,
props: ResourceTableFromResourceClassProps<RowItem> | ResourceTableProps<RowItem>
) {
if (!!(props as ResourceTableFromResourceClassProps<RowItem>).resourceClass) {
const { resourceClass, ...otherProps } = props as ResourceTableFromResourceClassProps<RowItem>;
Expand Down Expand Up @@ -228,11 +228,11 @@ function ResourceTableContent<RowItem>(props: ResourceTableProps<RowItem>) {
const tableProcessors = useTypedSelector(state => state.resourceTable.tableColumnsProcessors);
const defaultFilterFunc = useFilterFunc();
const [columnVisibility, setColumnVisibility] = useState(() =>
initColumnVisibilityState(columns, id),
initColumnVisibilityState(columns, id)
);

const [tableSettings] = useState<{ id: string; show: boolean }[]>(
!!id ? helpers.loadTableSettings(id) : [],
!!id ? helpers.loadTableSettings(id) : []
);

const [allColumns, sort] = useMemo(() => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/common/Table/Table.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ const TemplateWithFilter: StoryFn<{
state = {
filter: { namespaces: new Set<string>(), search: '' },
config: { settings: { tableRowsPerPageOptions: [10, 20, 50, 100] } },
},
}
) => state,
preloadedState: {
filter: {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/common/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export type TableProps<RowItem extends Record<string, any>> = Omit<
function usePageURLState(
key: string,
prefix: string,
initialPage: number,
initialPage: number
): ReturnType<typeof useURLState> {
const [page, setPage] = useURLState(key, { defaultValue: initialPage + 1, prefix });
const [zeroIndexPage, setZeroIndexPage] = useState(page - 1);
Expand Down Expand Up @@ -161,7 +161,7 @@ export default function Table<RowItem extends Record<string, any>>({
id: column.id ?? String(i),
header: column.header || '',
})),
[tableProps.columns],
[tableProps.columns]
);

const tableData = useMemo(() => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/node/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default function NodeList() {
gridTemplate: 'minmax(150px, .3fr)',
getValue: node => {
const isReady = !!node.status.conditions.find(
condition => condition.type === 'Ready' && condition.status === 'True',
condition => condition.type === 'Ready' && condition.status === 'True'
);
return isReady ? t('translation|Yes') : t('translation|No');
},
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/pod/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export function PodListRenderer(props: PodListProps) {
}

const statusTrueCount = Object.values(readinessGatesStatus).filter(
status => status === 'True',
status => status === 'True'
).length;

return statusTrueCount;
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@ async function loadAxe() {
// https://github.com/microsoft/monaco-editor/issues/2448
results.violations = results.violations.filter(
(v: any) =>
!(v.id === 'landmark-unique' && v.nodes[0].html.indexOf('monaco-status') !== -1),
!(v.id === 'landmark-unique' && v.nodes[0].html.indexOf('monaco-status') !== -1)
);

// tooltips have role="tooltip", but should be in a landmark.
// This would need to be fixed within Material UI ToolTip component.
results.violations = results.violations.filter(
(v: any) => !(v.id === 'region' && v.nodes[0].html.indexOf('role="tooltip"') !== -1),
(v: any) => !(v.id === 'region' && v.nodes[0].html.indexOf('role="tooltip"') !== -1)
);

// Tooltips do an opacity transition, which causes a color contrast issue.
// But it's not an issue in practice, because the animation is quick.
// The final tooltip contrast is fine.
results.violations = results.violations.filter(
(v: any) =>
!(v.id === 'color-contrast' && v.nodes[0].html.indexOf('MuiTooltip-tooltip') !== -1),
!(v.id === 'color-contrast' && v.nodes[0].html.indexOf('MuiTooltip-tooltip') !== -1)
);

return results;
Expand All @@ -51,7 +51,7 @@ async function loadAxe() {
alreadyWarned = true;
alert(
'Accessibility issues found. See developer console. ' +
'`REACT_APP_SKIP_A11Y=false make run-frontend` to enable alert.',
'`REACT_APP_SKIP_A11Y=false make run-frontend` to enable alert.'
);
}
}
Expand Down
16 changes: 8 additions & 8 deletions frontend/src/lib/k8s/apiProxy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ describe('apiProxy', () => {
describe('singleApiFactory', () => {
it('Successfully creates API client for single resource', async () => {
const server = new WS(
`${wsUrl}clusters/${clusterName}/apis/${mockSingleResource[0]}/${mockSingleResource[1]}/${mockSingleResource[2]}`,
`${wsUrl}clusters/${clusterName}/apis/${mockSingleResource[0]}/${mockSingleResource[1]}/${mockSingleResource[2]}`
);

const client = apiProxy.apiFactory(...mockSingleResource);
Expand All @@ -177,7 +177,7 @@ describe('apiProxy', () => {

const connections = mockMultipleResource.map(async ([group, version, resource]) => {
const server = new WS(
`${wsUrl}clusters/${clusterName}/apis/${group}/${version}/${resource}`,
`${wsUrl}clusters/${clusterName}/apis/${group}/${version}/${resource}`
);
const client = apiProxy.apiFactory(group, version, resource);
client.list(cb, errCb, {}, clusterName);
Expand All @@ -203,7 +203,7 @@ describe('apiProxy', () => {
expect.assertions(4);

const mockServer = new WS(
`${wsUrl}clusters/${clusterName}/apis/${mockSingleResource[0]}/${mockSingleResource[1]}/namespaces/${namespace}/${mockSingleResource[2]}`,
`${wsUrl}clusters/${clusterName}/apis/${mockSingleResource[0]}/${mockSingleResource[1]}/namespaces/${namespace}/${mockSingleResource[2]}`
);

const client = apiProxy.apiFactoryWithNamespace(...mockSingleResource);
Expand All @@ -229,7 +229,7 @@ describe('apiProxy', () => {

const connections = mockMultipleResource.map(async ([group, version, resource]) => {
const mockServer = new WS(
`${wsUrl}clusters/${clusterName}/apis/${group}/${version}/namespaces/${namespace}/${resource}`,
`${wsUrl}clusters/${clusterName}/apis/${group}/${version}/namespaces/${namespace}/${resource}`
);
const client = apiProxy.apiFactoryWithNamespace(group, version, resource);
client.list(namespace, cb, errCb, {}, clusterName);
Expand Down Expand Up @@ -511,7 +511,7 @@ describe('apiProxy', () => {
apiProxy.streamResultsForCluster(
streamResultsUrl,
{ cb, errCb, cluster: clusterName },
{ watch: '1' },
{ watch: '1' }
);

mockServer.on('connection', async (socket: any) => {
Expand All @@ -537,7 +537,7 @@ describe('apiProxy', () => {
apiProxy.streamResultsForCluster(
streamResultsUrl,
{ cb, errCb, cluster: clusterName },
{ watch: '1' },
{ watch: '1' }
);

mockServer.on('connection', async (socket: any) => {
Expand All @@ -551,7 +551,7 @@ describe('apiProxy', () => {
reason: errorMessage.object.reason,
}),
type: errorMessage.type,
}),
})
);
done();
});
Expand All @@ -565,7 +565,7 @@ describe('apiProxy', () => {
.streamResultsForCluster(
streamResultsUrl,
{ cb, errCb, cluster: clusterName },
{ watch: '1' },
{ watch: '1' }
)
.then(cancel => {
mockServer.on('connection', async socket => {
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/lib/k8s/apiProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ export async function request(
params: RequestParams = {},
autoLogoutOnAuthError: boolean = true,
useCluster: boolean = true,
queryParams?: QueryParameters,
queryParams?: QueryParameters
): Promise<any> {
// @todo: This is a temporary way of getting the current cluster. We should improve it later.
const cluster = (useCluster && getCluster()) || '';
Expand Down Expand Up @@ -339,7 +339,7 @@ export interface ClusterRequestParams extends RequestParams {
export async function clusterRequest(
path: string,
params: ClusterRequestParams = {},
queryParams?: QueryParameters,
queryParams?: QueryParameters
): Promise<any> {
interface RequestHeaders {
Authorization?: string;
Expand Down Expand Up @@ -1399,7 +1399,7 @@ async function connectStreamWithParams(
path: string,
cb: StreamResultsCb,
onFail: () => void,
params?: StreamParams,
params?: StreamParams
): Promise<{
close: () => void;
socket: WebSocket | null;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ export function useId(prefix = '') {
const [id] = React.useState<string | undefined>(
import.meta.env.UNDER_TEST === 'true'
? prefix + 'id'
: prefix + Math.random().toString(16).slice(2),
: prefix + Math.random().toString(16).slice(2)
);

return id;
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/redux/filterSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function filterResource(
item: KubeObjectInterface | KubeEvent,
filter: FilterState,
search?: string,
matchCriteria?: string[],
matchCriteria?: string[]
) {
let matches: boolean = true;

Expand Down Expand Up @@ -71,7 +71,7 @@ export function filterResource(
export function filterGeneric<T extends { [key: string]: any } = { [key: string]: any }>(
item: T,
search?: string,
matchCriteria?: string[],
matchCriteria?: string[]
) {
if (!search) {
return true;
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/storybook.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const compose = (entry: StoryFile) => {
return composeStories(entry);
} catch (e) {
throw new Error(
`There was an issue composing stories for the module: ${JSON.stringify(entry)}, ${e}`,
`There was an issue composing stories for the module: ${JSON.stringify(entry)}, ${e}`
);
}
};
Expand All @@ -45,7 +45,7 @@ function getAllStoryFiles() {
const storyFiles = Object.entries(
import.meta.glob<StoryFile>('./**/*.stories.tsx', {
eager: true,
}),
})
);

return storyFiles.map(([filePath, storyFile]) => {
Expand Down Expand Up @@ -86,7 +86,7 @@ getAllStoryFiles().forEach(({ storyFile, componentName, storyDir }) => {

if (stories.length <= 0) {
throw new Error(
`No stories found for this module: ${title}. Make sure there is at least one valid story for this module, without a disable parameter, or add parameters.storyshots.disable in the default export of this file.`,
`No stories found for this module: ${title}. Make sure there is at least one valid story for this module, without a disable parameter, or add parameters.storyshots.disable in the default export of this file.`
);
}

Expand All @@ -103,7 +103,7 @@ getAllStoryFiles().forEach(({ storyFile, componentName, storyDir }) => {
const snapshotPath = path.join(
storyDir,
options.snapshotsDirName,
`${componentName}.${name}${options.snapshotExtension}`,
`${componentName}.${name}${options.snapshotExtension}`
);

expect(asFragment()).toMatchFileSnapshot(snapshotPath);
Expand Down
2 changes: 1 addition & 1 deletion plugins/headlamp-plugin/bin/headlamp-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ function start() {
console.warn(
' @kinvolk/headlamp-plugin is out of date. Run the following command to upgrade \n' +
` See release notes here: ${url}` +
' npx @kinvolk/headlamp-plugin upgrade',
' npx @kinvolk/headlamp-plugin upgrade'
);
return;
}
Expand Down

0 comments on commit cf614a3

Please sign in to comment.