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

feat: support recycle bin in content navigation #152 #176

Closed
wants to merge 15 commits into from

Conversation

boyce-w
Copy link
Contributor

@boyce-w boyce-w commented Mar 20, 2023

Summary
Support Recycle Bin in the SAS Content Navigation Pane.
See details in the issue #152

Testing
How did you test this change?
Test manually and run all the unit tests

@boyce-w boyce-w self-assigned this Mar 20, 2023
boyce-w and others added 7 commits March 20, 2023 16:51
Bumps [esbuild](https://github.com/evanw/esbuild) from 0.17.11 to 0.17.12.
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md)
- [Commits](evanw/esbuild@v0.17.11...v0.17.12)

---
updated-dependencies:
- dependency-name: esbuild
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [webpack](https://github.com/webpack/webpack) from 5.75.0 to 5.76.2.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](webpack/webpack@v5.75.0...v5.76.2)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.54.1 to 5.55.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.55.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [prettier](https://github.com/prettier/prettier) from 2.8.4 to 2.8.5.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](prettier/prettier@2.8.4...2.8.5)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.9.5 to 5.0.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](microsoft/TypeScript@v4.9.5...v5.0.2)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
**Summary**
This fixes an issue where session invalidation caused issues with displaying files and folders (see sassoftware#163). This addresses the issue by triggering a reconnect when a 401 (Unauthorized) error is encountered.

**Testing**
 - Tested using SAS content as one normally would
 - Left the extension unattended for several hours, and made sure SAS content was refreshed
@Zhirong2022
Copy link
Collaborator

Zhirong2022 commented Mar 22, 2023

Acceptance Criteria:
1.Make sure there are no regression issues
2.Verify that the file or folder will be moved to Recycle bin folder if performing delete action
3.Verify that the file or folder will roll back to its original location if performing restore action
4.Verify that the file tab page will be closed at the same time if trying to delete a file in open status
5.Verify that the file is in read-only in Recycle bin folder
6.Verity that it will ask the user to Save, NotSave or Cancel if trying to delete a file in edit mode
7.Verify that the file will be handled properly if the user take Save, NotSave or Cancel action
7.1 "Save": The file will be saved and moved to Recycle bin folder
7.2 "NotSave" The file will not be saved and moved to Recycle bin folder
7.3 "Cancel" The popup confirmation message dialog close and the file keeps in edit mode
8.Verify that the file or folder can be deleted successfully in Recycle bin folder
9.Verify that it can Empty the Recycle bin folder successfully
10.Verify 1 to 9 in OS: Windows and Mac
11.Verify 1 to 10 in NLS environment

@Zhirong2022 Zhirong2022 added the testing Test the pull requests label Mar 22, 2023
Copy link
Contributor

@scottdover scottdover left a comment

Choose a reason for hiding this comment

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

This is looking good so far. I appreciate you taking this one on :)

client/src/components/ContentNavigator/ContentModel.ts Outdated Show resolved Hide resolved
Comment on lines 58 to 63
const actions = [
addMember && !isRecycled ? "createChild" : undefined,
del ? "delete" : undefined,
write && !isRecycled ? "update" : undefined,
write && isRecycled ? "restore" : undefined,
].filter((action) => !!action);
Copy link
Contributor

@scottdover scottdover Mar 22, 2023

Choose a reason for hiding this comment

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

This code looks a little complicated. I made an effort to uncomplicate it a little, but my code is relying on javascript trickery which I don't love...

Suggested change
const actions = [
addMember && !isRecycled ? "createChild" : undefined,
del ? "delete" : undefined,
write && !isRecycled ? "update" : undefined,
write && isRecycled ? "restore" : undefined,
].filter((action) => !!action);
const actions = [
addMember && !isRecycled && "createChild",
del && "delete",
write && !isRecycled && "update",
write && isRecycled && "restore",
].filter((action) => !!action);

In any case, this is a challenge to read at first glance

Copy link
Contributor

Choose a reason for hiding this comment

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

This is all to say, you can leave your code as-is, or if you see a good way to make it a little more readable, that'd be awesome, too :)

client/src/components/ContentNavigator/utils.ts Outdated Show resolved Hide resolved
client/src/components/ContentNavigator/utils.ts Outdated Show resolved Hide resolved
client/src/components/ContentNavigator/utils.ts Outdated Show resolved Hide resolved
package.json Show resolved Hide resolved
scnwwu and others added 7 commits March 22, 2023 22:27
* fix: reset ready timeout on success

* feat: sinon types

* add sinon types to aid with type safety
* refactor contentdataprovider tests to use types
* add ts-sinon library to add with stubbing of interfaces

* add unit tests for ssh connection provider

* remove only function from ssh suite

* stub axios interceptor

* fix: use stream.close when closing session

* use arrow functions
* visibility modifiers on class functions
* refactor listeners into discreet methods

* Update client/test/connection/ssh/index.test.ts

Co-authored-by: Scott Dover <scott@scottdover.com>

* Update client/test/connection/ssh/index.test.ts

Co-authored-by: Scott Dover <scott@scottdover.com>

---------

Co-authored-by: Scott Dover <scott@scottdover.com>
@boyce-w
Copy link
Contributor Author

boyce-w commented Mar 24, 2023

I don't know why this branch goes wrong after I rebased the PR and resolved the conflicts. It contains the commits pushed in the main branch and the changed files are contaminated. So I created a new PR #190 and close this one. Sorry for confusing.

@boyce-w boyce-w closed this Mar 24, 2023
@boyce-w boyce-w deleted the recycle-bin branch March 24, 2023 05:44
@Zhirong2022
Copy link
Collaborator

Since the issue is Dup to PR#190, verify it as well.

@Zhirong2022 Zhirong2022 added verified and removed testing Test the pull requests labels Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants