Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
"@types/dropzone": "5.7.9",
"@types/jquery": "3.5.33",
"@types/katex": "0.16.7",
"@types/license-checker-webpack-plugin": "0.2.5",
"@types/pdfobject": "2.2.5",
"@types/sortablejs": "1.15.8",
"@types/swagger-ui-dist": "3.30.6",
Expand Down Expand Up @@ -111,7 +110,6 @@
"stylelint-declaration-strict-value": "1.10.11",
"stylelint-value-no-unknown-custom-properties": "6.0.1",
"svgo": "4.0.0",
"type-fest": "4.41.0",
"typescript-eslint": "8.43.0",
"updates": "16.7.0",
"vite-string-plugin": "1.4.6",
Expand Down
57 changes: 0 additions & 57 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion updates.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type {Config} from 'updates';
export default {
exclude: [
'@mcaptcha/vanilla-glue', // breaking changes in rc versions need to be handled
'@stylistic/eslint-plugin-js', // need to migrate to eslint 9
'cropperjs', // need to migrate to v2 but v2 is not compatible with v1
'tailwindcss', // need to migrate
],
Expand Down
16 changes: 11 additions & 5 deletions web_src/js/components/RepoContributors.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import {chartJsColors} from '../utils/color.ts';
import {sleep} from '../utils.ts';
import 'chartjs-adapter-dayjs-4/dist/chartjs-adapter-dayjs-4.esm';
import {fomanticQuery} from '../modules/fomantic/base.ts';
import type {Entries} from 'type-fest';
import {pathEscapeSegments} from '../utils/url.ts';

const customEventListener: Plugin = {
Expand Down Expand Up @@ -57,6 +56,13 @@ Chart.register(
customEventListener,
);

type ContributorsData = {
total: {
weeks: Record<string, any>,
},
[other: string]: Record<string, Record<string, any>>,
}

export default defineComponent({
components: {ChartLine, SvgIcon},
props: {
Expand Down Expand Up @@ -127,20 +133,20 @@ export default defineComponent({
}
} while (response.status === 202);
if (response.ok) {
const data = await response.json();
const {total, ...rest} = data;
const data = await response.json() as ContributorsData;
const {total, ...other} = data;
// below line might be deleted if we are sure go produces map always sorted by keys
total.weeks = Object.fromEntries(Object.entries(total.weeks).sort());

const weekValues = Object.values(total.weeks) as any;
const weekValues = Object.values(total.weeks);
this.xAxisStart = weekValues[0].week;
this.xAxisEnd = firstStartDateAfterDate(new Date());
const startDays = startDaysBetween(this.xAxisStart, this.xAxisEnd);
total.weeks = fillEmptyStartDaysWithZeroes(startDays, total.weeks);
this.xAxisMin = this.xAxisStart;
this.xAxisMax = this.xAxisEnd;
this.contributorsStats = {};
for (const [email, user] of Object.entries(rest) as Entries<Record<string, Record<string, any>>>) {
for (const [email, user] of Object.entries(other)) {
user.weeks = fillEmptyStartDaysWithZeroes(startDays, user.weeks);
this.contributorsStats[email] = user;
}
Expand Down
2 changes: 1 addition & 1 deletion web_src/js/modules/observer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {isDocumentFragmentOrElementNode} from '../utils/dom.ts';
import type {Promisable} from 'type-fest';
import type {Promisable} from '../types.ts';
import type {InitPerformanceTracer} from './init.ts';

let globalSelectorObserverInited = false;
Expand Down
2 changes: 2 additions & 0 deletions web_src/js/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,5 @@ export type FomanticInitFunction = {
};

export type GitRefType = 'branch' | 'tag';

export type Promisable<T> = T | Promise<T>; // stricter than type-fest which uses PromiseLike
2 changes: 1 addition & 1 deletion web_src/js/utils/dom.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {debounce} from 'throttle-debounce';
import type {Promisable} from 'type-fest';
import type {Promisable} from '../types.ts';
import type $ from 'jquery';
import {isInFrontendUnitTest} from './testhelper.ts';

Expand Down