Code Monkey home page Code Monkey logo

odf-console's Introduction

ODF Console

ODF Console is the UI plugin for Openshift Data Foundation Operator. It works as a remote module for OpenShift Container Platform console.

Running in Development Mode

ODF console works as a remote bundle for OCP console. To run ODF Console there should be a instance of OCP console up and running.

Steps to run OCP Console as a server in development mode:

  1. Follow everything as mentioned in the console README.md to build the application.
  2. Run the console bridge as follows ./bin/bridge -plugins odf-console=http://localhost:9001/
  3. Run developemnt mode of console by going into console/frontend and running yarn run dev

After the OCP console is set as required by ODF Console. Performs the following steps to make it run.

  1. Install ODF Operator
  2. Create a Storage System
  3. Clone this repo.
  4. Pull all required dependencies by running yarn install.
  5. Run the development mode of odf-console using yarn run dev. This runs a webserver in port 9001.

Steps to run OCP Console as a container in development mode:

  1. Install ODF Operator.
  2. Create a Storage System.
  3. Clone this repo.
  4. Pull all required dependencies by running yarn install.
  5. Run the development mode of odf-console using I8N_NS=plugin__odf-console PLUGIN=odf yarn run dev:c. This runs a container running both the console bridge and a webserver in port 9001.
  6. For more OCP container related environment variables Refer.

Unit Tests

Run all unit tests:

yarn test
# Run them with coverage:
yarn test-coverage

E2E Tests

E2E tests are written in Cypress.

Launch Cypress test runner:

yarn test-cypress

This will launch the Cypress Test Runner UI, where you can run one or all cypress tests after choosing the required browser.

It is also possible to run the Cypress tests in headless mode:

yarn test-cypress-headless

By default, it will look for Chrome in the system and use it, but if you want to use Firefox instead, set BRIDGE_E2E_BROWSER_NAME environment variable in your shell with the value firefox.

Build the CI runner image

Build a beta for testing:

docker build -t quay.io/ocs-dev/odf-console-ci-runner:beta -f Dockerfile.ci.runner .

Push it:

docker push quay.io/ocs-dev/odf-console-ci-runner:beta

Only for testing purposes (don't merge this), add a separate commit updating .ci-operator.yaml: tag: beta

odf-console's People

Contributors

agarwal-mudit avatar alfonsomthd avatar alonfirestein avatar aruniiird avatar bipuladh avatar debjyoti-pandit avatar gowthamshanmugam avatar ivoalmeida avatar nik-redhat avatar openshift-ci[bot] avatar openshift-merge-bot[bot] avatar openshift-merge-robot avatar puiterwijk avatar rexagod avatar rishabhkodes avatar sanjalkatiyar avatar timothyasirjeyasing avatar umangachapagain avatar vbnrh avatar weirdwiz avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

odf-console's Issues

ODF deployment 4.11, some attributes deleted

SC-NAME:
New:

<a tabindex="-1" data-ouia-component-type="PF4/DropdownItem" data-ouia-safe="true" data-ouia-component-id="OUIA-Generated-DropdownItem-1" aria-disabled="false" class="pf-c-dropdown__menu-item"><div><span class="co-resource-item"><span class="sr-only">SC</span><span class="co-m-resource-icon" title="StorageClass">SC</span>thin</span></div><div><span class="text-muted">(default) | kubernetes.io/vsphere-volume</span></div></a>

Old:
id="thin-link"
image


data-test-id="dropdown-button" attribute deleted on OSD size

<button id="pf-select-toggle-id-32" aria-labelledby="requested-capacity-dropdown pf-select-toggle-id-32" aria-expanded="false" aria-haspopup="listbox" type="button" class="pf-c-select__toggle" aria-label="Options menu"><div class="pf-c-select__toggle-wrapper"><span class="pf-c-select__toggle-text">2 TiB</span></div><span class="pf-c-select__toggle-arrow"><svg fill="currentColor" height="1em" width="1em" viewBox="0 0 320 512" aria-hidden="true" role="img" style="vertical-align: -0.125em;"><path d="M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"></path></svg></span></button>

image

Deployment type:
new:
<button id="pf-select-toggle-id-10" aria-labelledby=" pf-select-toggle-id-10" aria-expanded="false" aria-haspopup="listbox" type="button" class="pf-c-select__toggle" aria-label="Options menu"><div class="pf-c-select__toggle-wrapper"><span class="pf-c-select__toggle-text">Full deployment</span></div><span class="pf-c-select__toggle-arrow"><svg fill="currentColor" height="1em" width="1em" viewBox="0 0 320 512" aria-hidden="true" role="img" style="vertical-align: -0.125em;"><path d="M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"></path></svg></span></button>
old:
input[id="bs-existing"]

image

OSD size changed:
New:
<button id="pf-select-toggle-id-16" aria-labelledby="requested-capacity-dropdown pf-select-toggle-id-16" aria-expanded="true" aria-haspopup="listbox" type="button" class="pf-c-select__toggle" aria-label="Options menu"><div class="pf-c-select__toggle-wrapper"><span class="pf-c-select__toggle-text">0.5 TiB</span></div><span class="pf-c-select__toggle-arrow"><svg fill="currentColor" height="1em" width="1em" viewBox="0 0 320 512" aria-hidden="true" role="img" style="vertical-align: -0.125em;"><path d="M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"></path></svg></span></button>

Old:

    "512": ('button[data-test-dropdown-menu="512Gi"]', By.CSS_SELECTOR),
    "2048": ('button[data-test-dropdown-menu="2Ti"]', By.CSS_SELECTOR),
    "4096": ('button[data-test-dropdown-menu="4Ti"]', By.CSS_SELECTOR),

image


image
Deployment type:
New:
<input name="backing-storage-radio-group" id="bs-existing" class="pf-c-radio__input" type="radio" aria-invalid="false" data-ouia-component-type="PF4/Radio" data-ouia-safe="true" data-ouia-component-id="OUIA-Generated-Radio-1" value="existing" checked="">
OLD:

    "choose_lso_deployment": ('input[id="bs-local-devices"]', By.CSS_SELECTOR),```
**********************************************************************************************************************

[perf-improv] Create separate provider for the context and pass its descendants as a "children"

Currently used:
https://github.com/red-hat-storage/odf-console/blob/master/packages/odf/components/topology/Topology.tsx#L502
https://github.com/red-hat-storage/odf-console/blob/master/packages/mco/components/mco-dashboard/data-policy/dr-dashboard.tsx#L163

Refer: https://reactjs.org/docs/context.html#contextprovider
All consumers that are descendants of a Provider will re-render whenever the Provider’s value prop changes.
Whenever Provider’s value prop changes all the child FCs will get re-rendered (irrespective of whether a child is a consumer of the context or not). This will cause unnecessary re-renders for those FCs which are not consuming any state from the context.
To avoid that use composition: create a separate FC which will provide the context and pass the consumer FCs as its "children".
example: https://github.com/openshift/console/blob/master/frontend/public/components/app.jsx#L241

Styling fixes needed after PF5 upgrade

  • Breadcrumb missing "link" like styling.
  • FieldLevelHelp on aligned with card title.
  • Status icon on properly aligned with card title (status and details card).
  • "Utilization" card header size is different from other card's title.
  • Chart legends + corresponding text are missing.
  • Add capacity modal: "Raw capacity" is not center-ed and x 3 replicas is rendered in separate row.
  • Configure performance dropdown.
  • Spacing between buttons.
  • Multus radio and TP badge.

Screenshot 2024-03-14 at 4 30 54 PM
Screenshot 2024-03-14 at 4 31 07 PM
Screenshot 2024-03-14 at 5 40 10 PM
Screenshot 2024-03-14 at 5 43 40 PM
Screenshot 2024-03-14 at 5 43 58 PM
Screenshot 2024-03-14 at 5 44 12 PM
Screenshot 2024-03-14 at 5 49 12 PM
Screenshot 2024-03-14 at 6 07 22 PM
Screenshot 2024-03-14 at 6 09 07 PM
Screenshot 2024-03-14 at 6 13 28 PM
Screenshot 2024-03-20 at 6 52 19 PM

Make StorageClass Provisioners Enums

Make StorageClassProvisioners enums to help with dealing with them in multiple places efficiently.
We could come up with utility functions to help users filter provisioners easily.

[bug] [odf/mco] Fix anti-pattern in SelectorInput

SelectorInput (https://github.com/red-hat-storage/odf-console/blob/master/packages/shared/modals/Selector.tsx#L173): used in add labels modal and apply-policy (mco) modal.

Priority of issue is "low" for now, still it is an anti-pattern and may cause bug moving forward if this component is used at multiple places.
Check demo: https://codesandbox.io/s/m3w9zn1z8x (same case can happen with SelectorInput as well)
Refer: https://reactjs.org/blog/2018/06/07/you-probably-dont-need-derived-state.html#common-bugs-when-using-derived-state

Remove co- based classes from Components

co- classes are defined in console project and can break at any time. We need to remove dependency on them and maintain our own CSS classes for long term stability.

Add validation for before setting odf flag

Currently we are setting this setODFflag to true however we improve here by setting the value after checking for the class definition or custom resource definition found or not.

Externalization issues

[user@localhost packages]$ yarn i18n
yarn run v1.22.10
$ i18next "src/**/*.{js,ts,tsx}" [-oc] -c i18next-parser.config.js

  i18next Parser
  --------------
  Input:  src/**/*.{js,ts,tsx}, [-oc]
  Output: locales/$LOCALE/$NAMESPACE.json


  Stats:  0 files were parsed
Done in 0.44s.

0 files were parsed even though text has being externalized at multiple places.

Update ReadMe

Need to add steps on how to perform (locally):

  • end-to-end testing.

  • unit testing.

Topology view missing functionality

  • "Ready" label and close button overlapping in sidebar.
  • No option to drill down the node.
  • Search bar is too long and "Expand" button is rendered in separate row.

Screenshot 2024-03-14 at 5 48 26 PM
Screenshot 2024-03-14 at 5 48 31 PM
Screenshot 2024-03-14 at 5 47 00 PM

[CI] Update to nginx for CI instead of http server

#854 >> reverted to ODF 4.13 as current 4.14 (which corresponds to master) has some issues.
To make ODF 4.13 work had to revert back to http server as well because ODF 4.13 do not have privileges config to work with "nginx-unprivileged" (was added for 4.14 only).

Once we move to ODF 4.14 for CI, we need to move back to nginx as well.

Avoid possible race condition while fetching

Refer: https://react.dev/learn/you-might-not-need-an-effect#fetching-data

We don't have such clean-ups for:
https://github.com/red-hat-storage/odf-console/blob/master/packages/shared/src/hooks/useK8sList.ts
https://github.com/red-hat-storage/odf-console/blob/master/packages/shared/src/hooks/k8s-get-hook.ts
https://github.com/red-hat-storage/odf-console/blob/master/packages/shared/src/hooks/custom-prometheus-poll/use-url-poll.ts

The way we are currently using these hooks in our repo, most probably we are safe for now as arguments passed to the dependency list of the useEffect are mostly static throughout the lifecycle of the component, but generic hooks should be agnostic of such assumptions.

Configure mco console plugin web server to use recommended MIME type

Severity: Medium
Priority: Low

Current behaviour (checked on OCP/MCO 4.15):
Request URL: https://<OCP_BASE_URL>/api/plugins/odf-multicluster-console/exposed-features-chunk.js

Response headers:

content-type: application/javascript
x-content-type-options: nosniff

application/javascript is considered to be a legacy JavaScript MIME type but is still a valid one for now. Proper MIME type for JavaScript according to current HTML spec is text/javascript.

Refer: openshift/console#13637 (comment) for more details.

[perf-improv] No need to "await", save up extra API call(s)

No need to "await" here: https://github.com/red-hat-storage/odf-console/blob/master/packages/mco/features.ts#L130
If we do, "intervalId" (here: https://github.com/red-hat-storage/odf-console/blob/master/packages/mco/features.ts#L131) will not be set until above "await" resolves, which will eventually lead to "featureDetector" be executed once again.
Without "await", "intervalId" will be set immediately and as soon as "featureDetector" gets resolved for the first time it will clear the interval as well (preventing callback in "setInterval" from being executed).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.