Convert apiUtils to TypeScript.

Review Request #14157 — Created Sept. 11, 2024 and submitted — Latest diff uploaded

Information

Review Board
master

Reviewers

This change converts our API methods to TypeScript. Our apiUtils file
has a few methods, primary among them being apiCall. This change adds
typing for everything, and cleans up some old cruft. It does not yet
make any changes to the internals of how API requests work.

In order to facilitate using jasmine for unit tests. these methods are
all exported under a new top-level object called API.

  • Ran js-tests.
  • Smoke tested the UI and verified that things still worked correctly.

Diff Revision 1

This is not the most recent revision of the diff. The latest diff is revision 4. See what's changed.

orig
1
2
3
4

Commits

First Last Summary ID Author
Convert apiUtils to TypeScript.
This change converts our API methods to TypeScript. Our apiUtils file has a few methods, primary among them being `apiCall`. This change adds typing for everything, and cleans up some old cruft. It does not yet make any changes to the internals of how API requests work. In order to facilitate using jasmine for unit tests. these methods are all exported under a new top-level object called `API`. Testing Done: - Ran js-tests. - Smoke tested the UI and verified that things still worked correctly.
0419e1712936fa2c135d34dba6d86215ab2e4945 David Trowbridge

Files

reviewboard/staticbundles.py
reviewboard/static/rb/js/accountPrefsPage/views/oauthApplicationsView.ts
reviewboard/static/rb/js/accountPrefsPage/views/oauthTokensView.ts
reviewboard/static/rb/js/common/collections/baseCollection.ts
reviewboard/static/rb/js/common/resources/collections/repositoryCommitsCollection.ts
reviewboard/static/rb/js/common/resources/collections/resourceCollection.ts
reviewboard/static/rb/js/common/resources/models/baseResourceModel.ts
reviewboard/static/rb/js/common/resources/models/draftResourceChildModelMixin.ts
reviewboard/static/rb/js/common/resources/models/draftResourceModelMixin.ts
reviewboard/static/rb/js/common/resources/models/draftReviewModel.ts
reviewboard/static/rb/js/common/resources/models/draftReviewRequestModel.ts
reviewboard/static/rb/js/common/resources/models/reviewGroupModel.ts
reviewboard/static/rb/js/common/resources/models/reviewReplyModel.ts
reviewboard/static/rb/js/common/resources/models/reviewRequestModel.ts
reviewboard/static/rb/js/common/resources/models/tests/baseResourceModelTests.ts
reviewboard/static/rb/js/common/resources/models/tests/draftReviewRequestModelTests.ts
reviewboard/static/rb/js/common/resources/models/tests/reviewGroupModelTests.ts
reviewboard/static/rb/js/common/resources/models/tests/reviewReplyModelTests.ts
reviewboard/static/rb/js/common/resources/models/tests/reviewRequestModelTests.ts
reviewboard/static/rb/js/common/utils/apiUtils.ts Was reviewboard/static/rb/js/utils/apiUtils.es6.js
This diff has been split across 2 pages: 1 2 >
reviewboard/staticbundles.py
Revision ef7fff989f3f227cc05b587d202973d1a805d3e8 New Change
67 lines
68
            'rb/js/reviewRequestPage/views/tests/reviewViewTests.es6.js',
68
            'rb/js/reviewRequestPage/views/tests/reviewViewTests.es6.js',
69
            'rb/js/ui/views/tests/drawerViewTests.es6.js',
69
            'rb/js/ui/views/tests/drawerViewTests.es6.js',
70
            'rb/js/ui/views/tests/infoboxManagerViewTests.es6.js',
70
            'rb/js/ui/views/tests/infoboxManagerViewTests.es6.js',
71
            'rb/js/ui/views/tests/notificationManagerTests.es6.js',
71
            'rb/js/ui/views/tests/notificationManagerTests.es6.js',
72
            'rb/js/ui/views/tests/scrollManagerViewTests.es6.js',
72
            'rb/js/ui/views/tests/scrollManagerViewTests.es6.js',
73
            'rb/js/utils/tests/apiUtilsTests.es6.js',

   
74
            'rb/js/utils/tests/keyBindingUtilsTests.es6.js',
73
            'rb/js/utils/tests/keyBindingUtilsTests.es6.js',
75
            'rb/js/utils/tests/linkifyUtilsTests.es6.js',
74
            'rb/js/utils/tests/linkifyUtilsTests.es6.js',
76
            'rb/js/utils/tests/urlUtilsTests.es6.js',
75
            'rb/js/utils/tests/urlUtilsTests.es6.js',
77
            'rb/js/views/tests/collectionViewTests.es6.js',
76
            'rb/js/views/tests/collectionViewTests.es6.js',
78
            'rb/js/views/tests/screenshotThumbnailViewTests.es6.js',
77
            'rb/js/views/tests/screenshotThumbnailViewTests.es6.js',
7 lines
86

    
   
85

   
87
            # Legacy JavaScript
86
            # Legacy JavaScript
88
            'rb/js/utils/underscoreUtils.es6.js',
87
            'rb/js/utils/underscoreUtils.es6.js',
89
            'rb/js/init.es6.js',
88
            'rb/js/init.es6.js',
90
            'rb/js/utils/apiErrors.es6.js',
89
            'rb/js/utils/apiErrors.es6.js',
91
            'rb/js/utils/apiUtils.es6.js',

   
92
            'rb/js/utils/linkifyUtils.es6.js',
90
            'rb/js/utils/linkifyUtils.es6.js',
93
            'rb/js/utils/mathUtils.es6.js',
91
            'rb/js/utils/mathUtils.es6.js',
94
            'rb/js/utils/keyBindingUtils.es6.js',
92
            'rb/js/utils/keyBindingUtils.es6.js',
95
            'rb/js/utils/urlUtils.es6.js',
93
            'rb/js/utils/urlUtils.es6.js',
96
            'rb/js/collections/filteredCollection.es6.js',
94
            'rb/js/collections/filteredCollection.es6.js',
235 lines
reviewboard/static/rb/js/accountPrefsPage/views/oauthApplicationsView.ts
reviewboard/static/rb/js/accountPrefsPage/views/oauthTokensView.ts
reviewboard/static/rb/js/common/collections/baseCollection.ts
reviewboard/static/rb/js/common/resources/collections/repositoryCommitsCollection.ts
reviewboard/static/rb/js/common/resources/collections/resourceCollection.ts
reviewboard/static/rb/js/common/resources/models/baseResourceModel.ts
reviewboard/static/rb/js/common/resources/models/draftResourceChildModelMixin.ts
reviewboard/static/rb/js/common/resources/models/draftResourceModelMixin.ts
reviewboard/static/rb/js/common/resources/models/draftReviewModel.ts
reviewboard/static/rb/js/common/resources/models/draftReviewRequestModel.ts
reviewboard/static/rb/js/common/resources/models/reviewGroupModel.ts
reviewboard/static/rb/js/common/resources/models/reviewReplyModel.ts
reviewboard/static/rb/js/common/resources/models/reviewRequestModel.ts
reviewboard/static/rb/js/common/resources/models/tests/baseResourceModelTests.ts
reviewboard/static/rb/js/common/resources/models/tests/draftReviewRequestModelTests.ts
reviewboard/static/rb/js/common/resources/models/tests/reviewGroupModelTests.ts
reviewboard/static/rb/js/common/resources/models/tests/reviewReplyModelTests.ts
reviewboard/static/rb/js/common/resources/models/tests/reviewRequestModelTests.ts
reviewboard/static/rb/js/utils/apiUtils.es6.js
This diff has been split across 2 pages: 1 2 >
Loading...