openshift-assisted / assisted-installer-ui

The Assisted Installer User Interface
https://console.redhat.com/openshift/create/datacenter
Apache License 2.0
9 stars 35 forks source link

MGMT-15685: Allow the app to fetch capabilities #2383

Closed jkilzi closed 11 months ago

jkilzi commented 11 months ago

Allows the app to fetch capabilities from AMS and convert them into feature flags.

This PR adds 2 new redux slices: currentUser and featureFlags; and a hook called useFeatureDetection. The hook gets called when the Routes.tsx component first renders. It dispatches an action to fetch the user account information and uses the account's organization_id in order to retrieve the organization's capabilities. This is all relevant when the app runs inside OCM, in the standalone mode only the features passed through the allEnabledFeatures prop get enabled/disabled (this prop works also as a way to override whatever settings we might have in an external system like AMS).

Notes:

  1. This MR depends on this PR
  2. Importing members from index.ts increased memory consumption significantly while running the tests. I made some modifications to the affected test file in order to improve the performance. PTAL at this commit.
  3. I modified the ui-lib/tsconfig.json to exclude any file from the build when they start with "_" (all of the *.test.tsx? are now prefixed with underscores in order to comply with the setting).
openshift-ci-robot commented 11 months ago

@jkilzi: This pull request references MGMT-15685 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.15.0" version, but no target version was set.

In response to [this](https://github.com/openshift-assisted/assisted-installer-ui/pull/2383): >Adds automatically generated clients based on the OAS definitions in https://api.openshift.com for AMS, authorizations and assisted-service Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
openshift-ci-robot commented 11 months ago

@jkilzi: This pull request references MGMT-15685 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.15.0" version, but no target version was set.

In response to [this](https://github.com/openshift-assisted/assisted-installer-ui/pull/2383): >Allows the app to fetch capabilities from AMS and convert them into feature flags. Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
openshift-ci-robot commented 11 months ago

@jkilzi: This pull request references MGMT-15685 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.15.0" version, but no target version was set.

In response to [this](https://github.com/openshift-assisted/assisted-installer-ui/pull/2383): >Allows the app to fetch capabilities from AMS and convert them into feature flags. Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
openshift-ci-robot commented 11 months ago

@jkilzi: This pull request references MGMT-15685 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.15.0" version, but no target version was set.

In response to [this](https://github.com/openshift-assisted/assisted-installer-ui/pull/2383): >Allows the app to fetch capabilities from AMS and convert them into feature flags. > >Notes: >Importing members from index.ts increased memory consumption significantly while running the tests. I made some modifications to the affected test file in order to improve the performance. PTAL at [this commit](https://github.com/openshift-assisted/assisted-installer-ui/pull/2383/commits/9786a5f5285d4119370e68e6079f6633d3387574). Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
openshift-ci-robot commented 11 months ago

@jkilzi: This pull request references MGMT-15685 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.15.0" version, but no target version was set.

In response to [this](https://github.com/openshift-assisted/assisted-installer-ui/pull/2383): >Allows the app to fetch capabilities from AMS and convert them into feature flags. > >Notes: >1. Importing members from index.ts increased memory consumption significantly while running the tests. I made some modifications to the affected test file in order to improve the performance. PTAL at [this commit](https://github.com/openshift-assisted/assisted-installer-ui/pull/2383/commits/9786a5f5285d4119370e68e6079f6633d3387574). >2. I modified the ui-lib/tsconfig.json to exclude any file from the build when they start with "_" (all of the *.test.tsx? are now prefixed with underscores in order to comply with the setting). Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
openshift-ci-robot commented 11 months ago

@jkilzi: This pull request references MGMT-15685 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.15.0" version, but no target version was set.

In response to [this](https://github.com/openshift-assisted/assisted-installer-ui/pull/2383): >Allows the app to fetch capabilities from AMS and convert them into feature flags. > >This PR adds 2 new redux slices: `currentUser` and `featureFlags`; and a hook called `useFeatureDetection`. >The hook gets called when the `Routes.tsx` component first renders. It dispatches an action to fetch the user account information and uses the account's `organization_id` in order to retrieve the organization's capabilities. >This is all relevant when the app runs inside OCM, in the standalone mode only the features passed through the `allEnabledFeatures` prop get enabled/disabled (this prop works also as a way to override whatever settings we might have in an external system like AMS). > >Notes: >1. Importing members from index.ts increased memory consumption significantly while running the tests. I made some modifications to the affected test file in order to improve the performance. PTAL at [this commit](https://github.com/openshift-assisted/assisted-installer-ui/pull/2383/commits/9786a5f5285d4119370e68e6079f6633d3387574). >2. I modified the ui-lib/tsconfig.json to exclude any file from the build when they start with "_" (all of the *.test.tsx? are now prefixed with underscores in order to comply with the setting). Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
openshift-ci-robot commented 11 months ago

@jkilzi: This pull request references MGMT-15685 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.15.0" version, but no target version was set.

In response to [this](https://github.com/openshift-assisted/assisted-installer-ui/pull/2383): >Allows the app to fetch capabilities from AMS and convert them into feature flags. > >This PR adds 2 new redux slices: `currentUser` and `featureFlags`; and a hook called `useFeatureDetection`. >The hook gets called when the `Routes.tsx` component first renders. It dispatches an action to fetch the user account information and uses the account's `organization_id` in order to retrieve the organization's capabilities. >This is all relevant when the app runs inside OCM, in the standalone mode only the features passed through the `allEnabledFeatures` prop get enabled/disabled (this prop works also as a way to override whatever settings we might have in an external system like AMS). > >Notes: >1. [This MR](https://gitlab.cee.redhat.com/service/uhc-portal/-/merge_requests/4614) depends on this PR >2. Importing members from index.ts increased memory consumption significantly while running the tests. I made some modifications to the affected test file in order to improve the performance. PTAL at [this commit](https://github.com/openshift-assisted/assisted-installer-ui/pull/2383/commits/9786a5f5285d4119370e68e6079f6633d3387574). >3. I modified the ui-lib/tsconfig.json to exclude any file from the build when they start with "_" (all of the *.test.tsx? are now prefixed with underscores in order to comply with the setting). Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
openshift-ci-robot commented 11 months ago

@jkilzi: This pull request references MGMT-15685 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.15.0" version, but no target version was set.

In response to [this](https://github.com/openshift-assisted/assisted-installer-ui/pull/2383): >Allows the app to fetch capabilities from AMS and convert them into feature flags. > >This PR adds 2 new redux slices: `currentUser` and `featureFlags`; and a hook called `useFeatureDetection`. >The hook gets called when the `Routes.tsx` component first renders. It dispatches an action to fetch the user account information and uses the account's `organization_id` in order to retrieve the organization's capabilities. >This is all relevant when the app runs inside OCM, in the standalone mode only the features passed through the `allEnabledFeatures` prop get enabled/disabled (this prop works also as a way to override whatever settings we might have in an external system like AMS). > >Notes: >1. [This MR](https://gitlab.cee.redhat.com/service/uhc-portal/-/merge_requests/4614) depends on this PR >2. Importing members from index.ts increased memory consumption significantly while running the tests. I made some modifications to the affected test file in order to improve the performance. PTAL at [this commit](https://github.com/openshift-assisted/assisted-installer-ui/pull/2383/commits/9786a5f5285d4119370e68e6079f6633d3387574). >3. I modified the ui-lib/tsconfig.json to exclude any file from the build when they start with "_" (all of the *.test.tsx? are now prefixed with underscores in order to comply with the setting). Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
openshift-ci-robot commented 11 months ago

@jkilzi: This pull request references MGMT-15685 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.15.0" version, but no target version was set.

In response to [this](https://github.com/openshift-assisted/assisted-installer-ui/pull/2383): >Allows the app to fetch capabilities from AMS and convert them into feature flags. > >This PR adds 2 new redux slices: `currentUser` and `featureFlags`; and a hook called `useFeatureDetection`. >The hook gets called when the `Routes.tsx` component first renders. It dispatches an action to fetch the user account information and uses the account's `organization_id` in order to retrieve the organization's capabilities. >This is all relevant when the app runs inside OCM, in the standalone mode only the features passed through the `allEnabledFeatures` prop get enabled/disabled (this prop works also as a way to override whatever settings we might have in an external system like AMS). > >Notes: >1. [This MR](https://gitlab.cee.redhat.com/service/uhc-portal/-/merge_requests/4614) depends on this PR >2. Importing members from index.ts increased memory consumption significantly while running the tests. I made some modifications to the affected test file in order to improve the performance. PTAL at [this commit](https://github.com/openshift-assisted/assisted-installer-ui/pull/2383/commits/9786a5f5285d4119370e68e6079f6633d3387574). >3. I modified the ui-lib/tsconfig.json to exclude any file from the build when they start with "_" (all of the *.test.tsx? are now prefixed with underscores in order to comply with the setting). Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
openshift-ci[bot] commented 11 months ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ammont82, jgyselov, jkilzi

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/openshift-assisted/assisted-installer-ui/blob/master/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment