Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#1936] Migrate c-authorship.vue to TypeScript #1969

Merged
merged 15 commits into from
Apr 10, 2023
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: 1 addition & 1 deletion frontend/cypress/tests/codeView/codeView_reload.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('reload page', () => {
cy.reload();

cy.get('#tab-authorship > .title > .contribution > .sorting > .sort-by > select')
.should('have.value', 'lineOfCode');
.should('have.value', 'linesOfCode');

cy.get('#tab-authorship > .title > .contribution > .sorting > .sort-order > select')
.should('have.value', 'true');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('switch authorship', () => {
// check default controls
cy.get('#tab-authorship > .title > .contribution > .sorting > .sort-by > select')
.should('not.have.value', 'path')
.should('have.value', 'lineOfCode');
.should('have.value', 'linesOfCode');

cy.get('#tab-authorship > .title > .contribution > .sorting > .sort-order > select')
.should('have.value', 'true');
Expand Down
11 changes: 11 additions & 0 deletions frontend/package-lock.json

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

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@fortawesome/free-brands-svg-icons": "^6.0.0",
"@fortawesome/free-solid-svg-icons": "^6.0.0",
"@fortawesome/vue-fontawesome": "^3.0.3",
"@types/minimatch": "^5.1.2",
"core-js": "^3.6.5",
"highlight.js": "^10.5.0",
"jszip": "^3.5.0",
Expand Down
11 changes: 11 additions & 0 deletions frontend/src/types/authorship.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export enum FilesSortType {
LinesOfCode = 'linesOfCode',
Path = 'path',
FileName = 'fileName',
FileType = 'fileType',
}

export enum FilterType {
Checkboxes = 'checkboxes',
Search = 'search',
}
11 changes: 5 additions & 6 deletions frontend/src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,21 @@ export interface Repo extends RepoRaw {
users?: User[];
}

interface AuthorshipFileSegment {
authored: boolean;
export interface AuthorshipFileSegment {
knownAuthor: string | null;
lineNumbers: number[];
lines: string[];
}

export interface AuthorshipFile {
active: boolean;
blankLineCount: number;
charCount: number;
fileSize: number | undefined; // not actually in schema - to verify relevancy when migrating c-authorship.vue
blankLineCount?: number;
charCount?: number;
fileType: string;
isBinary: boolean;
isIgnored: boolean;
lineCount: number;
path: string;
segments: AuthorshipFileSegment[];
segments?: AuthorshipFileSegment[];
wasCodeLoaded: boolean;
}
1 change: 1 addition & 0 deletions frontend/src/types/zod/authorship-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ export const authorshipSchema = z.array(fileResult);
// Export typescript types
export type AuthorshipSchema = z.infer<typeof authorshipSchema>;
export type FileResult = z.infer<typeof fileResult>;
export type Line = z.infer<typeof lineSchema>;
Loading