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

Refactor the Extensions settings page #2221

Merged
merged 10 commits into from Apr 19, 2021
Merged

Refactor the Extensions settings page #2221

merged 10 commits into from Apr 19, 2021

Conversation

Nokel81
Copy link
Collaborator

@Nokel81 Nokel81 commented Feb 24, 2021

  • Simplify the install logic by refactoring out the multi-install logic

  • Revamp the ExtensionInstallStateStore to more strictly track the lifetime of an install or uninstall request

  • Fix the install of an already installed extension just hanging visually

  • Display a spinner more often for more visual feedback

Signed-off-by: Sebastian Malton sebastian@malton.name

fixes #2116

@Nokel81 Nokel81 added bug Something isn't working area/ui area/extension Something to related to the extension api labels Feb 24, 2021
@Nokel81 Nokel81 requested a review from a team February 24, 2021 21:34
@Nokel81 Nokel81 self-assigned this Feb 24, 2021
@Nokel81
Copy link
Collaborator Author

Nokel81 commented Feb 25, 2021

twice-install.mov

@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2021

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2021

Conflicts have been resolved. A maintainer will review the pull request shortly.

@github-actions
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions
Copy link
Contributor

Conflicts have been resolved. A maintainer will review the pull request shortly.

@Nokel81 Nokel81 added this to the 4.2.1 milestone Mar 24, 2021
@aleksfront
Copy link
Contributor

aleksfront commented Mar 29, 2021

While it works okay in case of twice install, but I found a few issues:

  1. It doesn't clear disabled state if wrong link provided
    invalid bundle

  2. When installed initial extension from a tar file, there's no loading state showed (not inside Install button nor with Spinner at the bottom).
    no loading state

  3. It doesn't clear disabled state if close button clicked inside notification. Spinner is spinning and input keeps disabled.
    clicking close

  4. When installing same extension twice, green notification about successful uninstall appears. Than nothing happens - no any loading state (but new extension getting installed in background).
    no loading

  5. Why we replaced "Install state" visualisation from button? I think we don't need to show Spinner instead when installation is in progress. At least we need to keep both.

jakolehm
jakolehm previously approved these changes Mar 29, 2021
@jim-docker
Copy link
Contributor

  1. Why we replaced "Install state" visualisation from button? I think we don't need to show Spinner instead when installation is in progress. At least we need to keep both.

If you already have a long list of extensions the spinner is not even visible unless you scroll to the bottom

@Nokel81
Copy link
Collaborator Author

Nokel81 commented Mar 29, 2021

I see know, reverting to the button having the animation.

@Nokel81
Copy link
Collaborator Author

Nokel81 commented Mar 29, 2021

@aleksfront @jakolehm @jim-docker I have fixed the issues that Aleks discovered and reverted to the older loading animation (for install). PTALA

@aleksfront
Copy link
Contributor

@Nokel81 There's still 2 issue available. 1 and 3 from the previous list.

  1. It shows [object Object] error message and doesn't drop loading state.
    object Object

  2. It doesn't clear disabled state if close button clicked inside notification.
    clicking close

@github-actions
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@Nokel81 Nokel81 added the merge/master This PR will need to be merged to master after merged to target. Using cherry-pick. label Apr 6, 2021
Signed-off-by: Sebastian Malton <sebastian@malton.name>
Signed-off-by: Sebastian Malton <sebastian@malton.name>
Signed-off-by: Sebastian Malton <sebastian@malton.name>
@Nokel81 Nokel81 modified the milestones: 4.2.1, 4.2.2 Apr 9, 2021
* Add support for installing extensions by name

- Optionally specify the version, defaults to latest non-prerelease
  version

- Usable via the protocol handlers, but requires user confirmation to
  actually install

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* resolve pr comments

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* add confirm dialog message

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* display error when registry returns not found as JSON

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* fix unit test

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* fix registry error detection

Signed-off-by: Sebastian Malton <sebastian@malton.name>
@Nokel81 Nokel81 requested review from jakolehm, a team and jim-docker and removed request for a team April 13, 2021 12:09
src/extensions/extension-discovery.ts Show resolved Hide resolved
src/extensions/extension-discovery.ts Outdated Show resolved Hide resolved
if (extEntrypoint !== "") {
if (!fs.existsSync(extEntrypoint)) {
console.log(`${logModule}: entrypoint ${extEntrypoint} not found, skipping ...`);
const extensionEntryPointAbsolutePath = path.resolve(path.join(path.dirname(extension.manifestPath), extensionEntryPointRelativePath));
Copy link
Contributor

Choose a reason for hiding this comment

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

these path functions can all throw a TypeError so why not keep this statement in the try block?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

They can throw but only if it is not a string.


fireEvent.change(screen.getByPlaceholderText("Path or URL to an extension package", {
fireEvent.change(res.getByPlaceholderText("Path or URL to an extension package", {
Copy link
Contributor

Choose a reason for hiding this comment

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

The placeholder text has changed but I guess this still works because it's not looking for an exact match?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Probably

src/renderer/components/+extensions/extensions.tsx Outdated Show resolved Hide resolved
src/renderer/components/+extensions/extensions.tsx Outdated Show resolved Hide resolved
src/renderer/components/+extensions/extensions.tsx Outdated Show resolved Hide resolved
Signed-off-by: Sebastian Malton <sebastian@malton.name>
@Nokel81 Nokel81 requested a review from jim-docker April 14, 2021 12:38
Signed-off-by: Sebastian Malton <sebastian@malton.name>
dispose();
fse.unlink(validatedRequest.tempFile).catch(noop);
}
onClose: dispose,
Copy link
Contributor

Choose a reason for hiding this comment

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

much cleaner!

@Nokel81 Nokel81 modified the milestones: 4.2.2, 4.2.3 Apr 16, 2021
Copy link
Contributor

@jakolehm jakolehm left a comment

Choose a reason for hiding this comment

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

LGTM

@Nokel81 Nokel81 merged commit 86205b3 into release/v4.2 Apr 19, 2021
@Nokel81 Nokel81 deleted the twice-install branch April 19, 2021 17:50
@Nokel81 Nokel81 mentioned this pull request Apr 26, 2021
Nokel81 added a commit that referenced this pull request Apr 26, 2021
Nokel81 added a commit that referenced this pull request Apr 26, 2021
Nokel81 added a commit that referenced this pull request Apr 26, 2021
Signed-off-by: Sebastian Malton <sebastian@malton.name>
jakolehm pushed a commit that referenced this pull request Apr 27, 2021
* Fix: logs data disapearing causing crashes (#2566)

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Refactor helm-chart.api and improve kube validation and error handling (#2265)

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix: HPA's not sortable by age (#2565)

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Conditionally render status icon for kube meta (#2298)

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix custom resource loading spinner appears above extensions' cluster menus (#2344)

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Lens should point to the release docs (#2268)

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Refactor the Extensions settings page (#2221)

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* try and get jest to not core dump

Signed-off-by: Sebastian Malton <sebastian@malton.name>
@Nokel81 Nokel81 removed the merge/master This PR will need to be merged to master after merged to target. Using cherry-pick. label Jun 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/extension Something to related to the extension api area/ui blocker bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Installing extension twice - blue "install" status field remains flashing
4 participants