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(xo-web/menu): add warning icon in proxies menu #7237

Merged
merged 4 commits into from
Dec 22, 2023

Conversation

OlivierFL
Copy link
Collaborator

@OlivierFL OlivierFL commented Dec 13, 2023

See Zammad#19126

Description

Add a warning icon in Proxies menu if unable to check proxy upgrade

Screenshot

image

Checklist

  • Commit
    • Title follows commit conventions
    • Reference the relevant issue (Fixes #007, See xoa-support#42, See https://...)
    • If bug fix, add Introduced by
  • Changelog
    • If visible by XOA users, add changelog entry
    • Update "Packages to release" in CHANGELOG.unreleased.md
  • PR
    • If UI changes, add screenshots
    • If not finished or not tested, open as Draft

@OlivierFL OlivierFL self-assigned this Dec 13, 2023
Copy link
Member

@MathieuRA MathieuRA left a comment

Choose a reason for hiding this comment

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

Actually this code will not work in all error cases. If the proxy is unreachable, we won't be able to determine its state.
For that you have to add some code in the subscribeProxiesApplianceUpdaterState subscription, or directly to the getProxyApplianceUpdaterState method in src/common/xo/index.js.

// src/common/xo/index.js#subscribeProxiesApplianceUpdaterState

...
if (proxiesApplianceUpdaterState[proxyId] === undefined) {
    proxiesApplianceUpdaterState[proxyId] = createSubscription(async () => {
      try {
        return await getProxyApplianceUpdaterState(proxyId)
      } catch (error) {
        console.error(error)
        return { state: 'error' }
      }
    })
  }
...

Or

export const getProxyApplianceUpdaterState = async (id) => {
    try {
        return await _call('proxy.getApplianceUpdaterState', { id })
    } catch (error) {
        console.error(error)
        return { state: 'error' }
    }
}

packages/xo-web/src/common/intl/messages.js Outdated Show resolved Hide resolved
CHANGELOG.unreleased.md Outdated Show resolved Hide resolved
@OlivierFL OlivierFL force-pushed the xo5/proxies-menu-warning-icon branch 2 times, most recently from 364fd0a to bddc276 Compare December 18, 2023 14:09
@MathieuRA MathieuRA removed their request for review December 18, 2023 15:25
packages/xo-web/src/xo-app/menu/index.js Outdated Show resolved Hide resolved
@OlivierFL OlivierFL force-pushed the xo5/proxies-menu-warning-icon branch 2 times, most recently from 3e331a3 to 6c0b768 Compare December 21, 2023 11:46
packages/xo-web/src/xo-app/menu/index.js Outdated Show resolved Hide resolved
packages/xo-web/src/xo-app/menu/index.js Outdated Show resolved Hide resolved
@OlivierFL OlivierFL force-pushed the xo5/proxies-menu-warning-icon branch 2 times, most recently from a654df7 to b7b47eb Compare December 22, 2023 08:14
packages/xo-web/src/xo-app/menu/index.js Outdated Show resolved Hide resolved
@pdonias pdonias changed the title feat(xo-web): add warning icon in proxies menu feat(xo-web/menu): add warning icon in proxies menu Dec 22, 2023
@pdonias pdonias merged commit 2ec164c into master Dec 22, 2023
1 check passed
@pdonias pdonias deleted the xo5/proxies-menu-warning-icon branch December 22, 2023 08:53
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.

4 participants