This repository was archived by the owner on Aug 21, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Changes for project, project-permissions services hook refactor #8989
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3daeb62 to
484722c
Compare
barankyle
approved these changes
Oct 12, 2023
Made checking for project permissions only apply to external calls
80deea1 to
9786e89
Compare
barankyle
approved these changes
Oct 13, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
🤖 Generated by Copilot at 21bdbe9
This pull request refactors and updates several files and modules related to the project, project permission, scene, and route services, as well as some scripts and tests. The main purpose is to improve the compatibility, security, consistency, and readability of the code, and to fix some errors and issues. The changes include using public methods instead of internal methods of the
projectPathandprojectPermissionPathservices, extending theKnexServiceclass instead of theKnexAdapterclass, adding and modifying hook functions and validations, and adjusting some method signatures and parameters.References
#8871
Explanation
🤖 Generated by Copilot at 21bdbe9
updatemethod calls of theKnexAdapterandprojectPathservices to pass an empty string as the first argument, instead of thedataobject, to avoid errors and match the expected format (link, link, link, link, link, link)ProjectPermissionServiceandProjectServiceclasses to extend theKnexServiceclass instead of theKnexAdapterclass, to leverage its features and be consistent with other services (link, link)appproperty and the constructor that assigned it from theProjectPermissionServiceandProjectServiceclasses, as they were unnecessary and inherited from theKnexServiceclass (link, link)_methods to use the public methods instead, to ensure that the hooks and validations are applied (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)ensureInviteCode,checkExistingPermissions,checkUser, andcheckPermissionStatushook functions to theproject-permissionhooks file, to validate and adjust the project permission data and queries (link, link, link, link)createAndUploadProject,updateProjectFiles,removeProjectFiles,addDataToProjectResult,checkProjectExists,checkProjectWriteAccess,checkProjectGithubUrl, andcheckProjectAutoUpdatehook functions to theprojecthooks file, to perform various tasks related to creating, updating, deleting, and querying projects (link)beforeandafterhooks of theprojectandproject-permissionservices, according to the logic and order of the operations ( link)needsRebuildandresetfields of theProjectBuildUpdateItemSchemaoptional, to allow more flexibility and compatibility (link)INVITE_CODE_REGEXandUSER_ID_REGEXconstants from theIdConstantsmodule, and theGITHUB_URL_REGEXconstant from theGitHubConstantsmodule, to validate the invite code, user id, and GitHub URL fields in the hooks (link, link)projectPathconstant from theproject.schemamodule, and thefsandpathmodules, to access theprojectservice and manipulate the file system and paths in the hooks (link, link)placeholderparameter from theupdatemethod of theProjectServiceclass, and reordered the other parameters, to match the signature of theupdatemethod of theKnexServiceclass (link)projectPathimport from theProjectPermissionServiceclass, as it was not used (link)installAllProjectsfunction call in theinstall-projectsscript file, as it was unnecessary and inconsistent (link)install-projectsscript file, as it was unnecessary and inconsistent (link)install-projectsscript file alphabetically, as it was a code style preference (link)patchandfindmethod calls in parentheses and cast them as the expected types, to avoid TypeScript errors and make the code work (link, link, link)🤖 Generated by Copilot at 21bdbe9
QA Steps
List any additional steps required to QA the changes of this PR, as well as any supplemental images or videos.
Checklist