Skip to content

Commit

Permalink
Run prettier, fix action for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
campos20 committed Jun 17, 2024
1 parent e594bc4 commit a03ee94
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 30 deletions.
18 changes: 9 additions & 9 deletions client/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
ignorePatterns: ["dist", ".eslintrc.cjs"],
parser: "@typescript-eslint/parser",
plugins: ["react-refresh"],
rules: {
'react-refresh/only-export-components': [
'warn',
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
},
}
};
2 changes: 1 addition & 1 deletion client/src/main/api/SumOfRanksApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class SumOfRanksApi {
region: string,
page: number,
pageSize: number,
wcaId?: string
wcaId?: string,
) => {
let url = `${this.BASE_URL}/${resultType}/${regionType}/${region}`;
let params = { page, pageSize, wcaId };
Expand Down
22 changes: 11 additions & 11 deletions client/src/main/components/StatisticsDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const StatisticsDisplay = () => {

const [statistics, setStatistics] = useState<Statistics>();
const [selectedKeys, setSelectedKeys] = useState<string | undefined>(
getQueryParameter("selectedKeys") || undefined
getQueryParameter("selectedKeys") || undefined,
);
const [filteredStatistics, setFilteredStatistics] =
useState<StatisticsDetail[]>();
Expand All @@ -36,8 +36,8 @@ const StatisticsDisplay = () => {
if (!!key) {
setFilteredStatistics(
statistics.statistics.filter(
(stat) => !!stat.keys && stat.keys[0] === key
)
(stat) => !!stat.keys && stat.keys[0] === key,
),
);
setSelectedKeys(key);
} else {
Expand All @@ -46,7 +46,7 @@ const StatisticsDisplay = () => {
break;
case "SELECTOR":
let filtered = statistics.statistics.filter(
(it) => joinKeys(it.keys) === selectedKeys
(it) => joinKeys(it.keys) === selectedKeys,
);

// Display stats based on query parameter
Expand All @@ -62,7 +62,7 @@ const StatisticsDisplay = () => {
setFilteredStatistics(statistics.statistics);
}
},
[]
[],
);

useEffect(() => {
Expand All @@ -77,18 +77,18 @@ const StatisticsDisplay = () => {
setStatistics(response.data);
handleFilteredStatistics(
response.data,
getQueryParameter("selectedKeys")
getQueryParameter("selectedKeys"),
);
})
.catch(() =>
message.error("Could not get statistics result for " + pathId)
message.error("Could not get statistics result for " + pathId),
)
.finally(() => setLoading(false));
}, [pathId, handleFilteredStatistics]);

useEffect(
() => setQueryParameter("selectedKeys", selectedKeys),
[selectedKeys]
[selectedKeys],
);

const getIcon = (statisticsDetail: StatisticsDetail) => {
Expand All @@ -109,7 +109,7 @@ const StatisticsDisplay = () => {

const showKeys = (
statisticsDetail: StatisticsDetail,
displayMode?: DisplayMode
displayMode?: DisplayMode,
) => {
if (
!statisticsDetail.keys ||
Expand Down Expand Up @@ -137,8 +137,8 @@ const StatisticsDisplay = () => {
// For selector
it.keys + "" === jointKeys ||
// For grouped
(!!it.keys && it.keys[0] === jointKeys)
)
(!!it.keys && it.keys[0] === jointKeys),
),
);
};

Expand Down
12 changes: 6 additions & 6 deletions client/src/main/pages/SumOfRanks/SumOfRanksPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const SumOfRanksPage = () => {
setMetaSor(response.data);
setResultType(response.data[0].resultType);
setSelectedRegionGroup(
`${response.data[0].regionGroups[0].regionType}-${response.data[0].regionGroups[0].regions[0].region}`
`${response.data[0].regionGroups[0].regionType}-${response.data[0].regionGroups[0].regions[0].region}`,
);
})
.catch(() => {
Expand All @@ -55,7 +55,7 @@ export const SumOfRanksPage = () => {
region: string,
page: number,
pageSize: number,
wcaId?: string
wcaId?: string,
) => {
setLoading(true);
sumOfRanksApi
Expand All @@ -67,7 +67,7 @@ export const SumOfRanksPage = () => {
})
.finally(() => setLoading(false));
},
[]
[],
);

useEffect(fetchMetaInfor, [fetchMetaInfor]);
Expand Down Expand Up @@ -144,7 +144,7 @@ export const SumOfRanksPage = () => {
region!,
page,
pageSize,
wcaId
wcaId,
)
}
/>
Expand Down Expand Up @@ -215,8 +215,8 @@ export const SumOfRanksPage = () => {
!e.completed
? styles.notCompleted
: e.regionalRank <= 10
? styles.top10
: ""
? styles.top10
: ""
}
>
{e.regionalRank}
Expand Down
4 changes: 2 additions & 2 deletions client/src/main/util/result.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const getMbldResult = (result: number) => {
let resultString = "" + result;

let missed = Number(
resultString.slice(resultString.length - 2, resultString.length)
resultString.slice(resultString.length - 2, resultString.length),
);
let DD = Number(resultString.slice(0, 2));
let difference = 99 - DD;
Expand All @@ -28,7 +28,7 @@ export const getMbldPoints = (result: number) => {
const formatResult = (
result: number,
event_id: string,
type: ResultType
type: ResultType,
): string => {
if (result == null) {
return "";
Expand Down
2 changes: 1 addition & 1 deletion client/src/test/DatabaseQuery.test.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ let rows = Math.floor(Math.random() * 20) + 1;
export const defaultQueryResponse: QueryDatabaseResponse = {
headers: Array.from({ length: columns }, (_, id) => "Header " + id),
content: Array.from({ length: rows }, (_, i) =>
Array.from({ length: columns }, (_, j) => `Result ${i} ${j}`)
Array.from({ length: columns }, (_, j) => `Result ${i} ${j}`),
),
number: 0,
numberOfElements: 20,
Expand Down

0 comments on commit a03ee94

Please sign in to comment.