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

[full-ci] TypeScript almost everything #8289

Merged
merged 11 commits into from
Jan 23, 2023
Merged

Conversation

dschmidt
Copy link
Member

Description

While #8235 focused on Vue components, this converts basically all other files currently still used to TypeScript - with a few exceptions: acceptance tests, docs, a few legacy (config) files for design system or web-app-skeleton

Related Issue

Motivation and Context

Get type safety to avoid bugs (and find existing ones), reduce mental load by making sure all files are written in the same language, make cut pasting easier, ....

How Has This Been Tested?

  • test environment:
  • test case 1:
  • test case 2:
  • ...

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

Open tasks:

  • ...

@update-docs
Copy link

update-docs bot commented Jan 21, 2023

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

text: undefined
allowContextActions: true,
text: 'bar',
onClick: () => undefined
})
)
})
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO this test was completely broken as breadCrumbsFromPath was not spread into concatBreadcrumbs which just accepts a single rest args parameter.

@@ -29,7 +29,7 @@ async function post(url, data) {
}

export async function registerClient(openIdConfig) {
const clientData = sessionStorage.getItem('dynamicClientData')
const clientData = JSON.parse(sessionStorage.getItem('dynamicClientData'))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this was an actual bug, I have no idea how to test the whole feature, which is why I did not add a Changelog entry.

@ownclouders
Copy link
Contributor

ownclouders commented Jan 21, 2023

Results for acceptance oC10 https://drone.owncloud.com/owncloud/web/31929/27/1

💥 The acceptance tests failed on retry. Please find the screenshots inside ...

webUISharingInternalGroupsToRoot-shareWithGroups_feature-L21.png

webUISharingInternalGroupsToRoot-shareWithGroups_feature-L21.png

@dschmidt dschmidt changed the title [full-ci] Typescript almost everything [full-ci] TypeScript almost everything Jan 21, 2023
@ownclouders
Copy link
Contributor

Results for acceptance oCIS https://drone.owncloud.com/owncloud/web/31929/62/1

💥 The acceptance tests failed on retry. Please find the screenshots inside ...

webUISharingInternalGroups-shareWithGroups_feature-L19.png

webUISharingInternalGroups-shareWithGroups_feature-L19.png

@@ -21,28 +17,28 @@ describe('theme loading and error reporting', () => {
})

it('should load the default theme if location is not found', async () => {
fetch.mockResponse(new Error(), { status: 404 })
;(fetch as FetchMock).mockResponse(new Error() as any, { status: 404 })
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found no method with a signature that allows me to pass an error and a status ... hence I need to cast error :-\

@sonarcloud
Copy link

sonarcloud bot commented Jan 21, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 2 Security Hotspots
Code Smell A 13 Code Smells

30.9% 30.9% Coverage
0.0% 0.0% Duplication

@JammingBen JammingBen merged commit a68ab61 into master Jan 23, 2023
@delete-merged-branch delete-merged-branch bot deleted the typescript-almost-everything branch January 23, 2023 08:39
ownclouders pushed a commit that referenced this pull request Jan 23, 2023
Author: Dominik Schmidt <[email protected]>
Date:   Mon Jan 23 09:39:26 2023 +0100

    [full-ci] TypeScript almost everything (#8289)

    * Rename .js files to .ts

    This renames most of the actively used .js files to .ts.
    Notable exceptions: acceptance tests, docs, a few legacy (config) files for design system or web-app-skeleton

    * Fix imports

    * Fix global variables usage

    * fixup! Fix imports

    * Fix exports

    * Fix non-isolated modules

    * Fix types in clientRegistration

    * Fix breadcrumbs unit test

    * Fix jest config

    * Fix remaining type issues

    * Fix textUtils.naturalSortCompare
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants