Skip to content

Disable persistence methods in Folder mode #2403

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

Merged
merged 6 commits into from
Apr 2, 2023

Conversation

ianyong
Copy link
Member

@ianyong ianyong commented Apr 2, 2023

Description

The persistence methods will have to be reworked to account for Folder mode in the future. For now, we disallow saving to GitHub & Google Drive when in Folder mode.

Also updated the code relating to persistence so that it can work with any active editor tab index (and not just 0).

Related to #2176.

Type of change

  • 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 not work as expected)
  • This change requires a documentation update
  • Code quality improvements

How to test

The Folder mode is not yet ready for production and is disabled programmatically. Enable Folder mode for testing by changing the condition to false:

const toggleFolderModeButton = React.useMemo(() => {
// TODO: Remove this once the Folder mode is ready for production.
if (true) {
return <></>;
}
return (
<ControlBarToggleFolderModeButton
isFolderModeEnabled={isFolderModeEnabled}
toggleFolderMode={() => dispatch(toggleFolderMode(workspaceLocation))}
key="folder"
/>
);
}, [dispatch, isFolderModeEnabled, workspaceLocation]);

Check that the persistence methods cannot be used in Folder mode.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 4587530945

  • 12 of 35 (34.29%) changed or added relevant lines in 5 files are covered.
  • 3 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.004%) to 34.829%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/commons/controlBar/ControlBarGoogleDriveButtons.tsx 0 1 0.0%
src/commons/controlBar/github/ControlBarGitHubButtons.tsx 0 1 0.0%
src/commons/sagas/PersistenceSaga.tsx 12 15 80.0%
src/features/github/GitHubUtils.tsx 0 4 0.0%
src/commons/sagas/GitHubPersistenceSaga.ts 0 14 0.0%
Files with Coverage Reduction New Missed Lines %
src/commons/controlBar/github/ControlBarGitHubButtons.tsx 1 2.56%
src/commons/sagas/PersistenceSaga.tsx 1 56.38%
src/pages/playground/Playground.tsx 1 2.73%
Totals Coverage Status
Change from base Build 4583528364: -0.004%
Covered Lines: 4791
Relevant Lines: 12813

💛 - Coveralls

@ianyong ianyong merged commit b3764dd into master Apr 2, 2023
@ianyong ianyong deleted the disable-persistence-methods-in-folder-mode branch April 2, 2023 08:08
RichDom2185 pushed a commit to NUS-CS1101S/cadet-frontend that referenced this pull request Jul 15, 2023
* Update GitHub persistence to work with any active editor tab

* Update Google Drive persistence to work with any active editor tab

* Update PersistenceSaga tests

* Disable Google Drive persistence in Folder mode

* Disable GitHub persistence in Folder mode

* Disable Folder mode when a persistence method is active
@coveralls
Copy link

coveralls commented Sep 22, 2024

Pull Request Test Coverage Report for Build 4587530945

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 12 of 35 (34.29%) changed or added relevant lines in 5 files are covered.
  • 3 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.004%) to 34.829%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/commons/controlBar/ControlBarGoogleDriveButtons.tsx 0 1 0.0%
src/commons/controlBar/github/ControlBarGitHubButtons.tsx 0 1 0.0%
src/commons/sagas/PersistenceSaga.tsx 12 15 80.0%
src/features/github/GitHubUtils.tsx 0 4 0.0%
src/commons/sagas/GitHubPersistenceSaga.ts 0 14 0.0%
Files with Coverage Reduction New Missed Lines %
src/commons/controlBar/github/ControlBarGitHubButtons.tsx 1 2.56%
src/commons/sagas/PersistenceSaga.tsx 1 56.38%
src/pages/playground/Playground.tsx 1 2.73%
Totals Coverage Status
Change from base Build 4583528364: -0.004%
Covered Lines: 4791
Relevant Lines: 12813

💛 - Coveralls

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