Git Product home page Git Product logo

forklift-ui's Introduction

forklift-ui

Forklift UI - VMware to OpenShift Virtualization migration tool

A read-only preview with mock data is available at http://konveyor-forklift-ui-preview.surge.sh/.

Prerequisites

Quick-start

Clone and install dependencies:

git clone https://github.com/konveyor/forklift-ui
cd forklift-ui
npm install --legacy-peer-deps

Create a meta.dev.json file in the config directory using config/meta.dev.example.json as a template. Set the inventoryApi property to the root URL of your forklift-controller inventory API, and set the clusterApi property to the root URL of your host OpenShift cluster API. And also to be able to use VMware provider data to be analysed by Migration Analytics set the inventoryPayloadApi property to the root URL of your forklift-controller inventory Payload API.

Environment variables

  • DATA_SOURCE - either mock or remote (unnecessary if you use npm run [start:dev|build]:[mock|remote] scripts)
  • META_FILE path (for running in prod mode with npm run start)
  • BRAND_TYPE - either Konveyor (default) or RedHat
  • AUTH_REQUIRED - either true (default) or false, when false logging in using OAuth is disabled, can be used when running on k8s server that does not support OAuth loggin
  • K8S_AUTH_BEARER_TOKEN - string, can be used together with AUTH_REQUIRED=false to specify the k8s api server authentication bearer token

Run the UI with webpack-dev-server at localhost:9000:

npm run start:dev:remote  # uses data from the API URLs in your config/meta.dev.json file
npm run start:dev:mock    # uses static mock data, can run offline
npm run start:dev         # uses the DATA_SOURCE environment variable (remote or mock)

Development Scripts

To run the type-checker, linter and unit tests:

# Run all 3:
npm run ci
# Or run them individually:
npm run type-check
npm run lint # or lint:fix to automatically fix certain issues
npm run test # or test:watch to auto-rerun tests on file changes

Note: the npm run test script will create a coverage report at coverage/lcov-report/index.html. This is useful to inspect locally before opening a PR.

Prettier code formatting is enforced by ESLint. To run Prettier and format your code (do this before committing if you don't run Prettier in your editor):

npm run format

To run a production build using webpack (outputs to ./dist):

npm run build:remote  # uses data from the API URLs in meta.json (path set by META_FILE)
npm run build:mock    # uses static mock data, can run offline or be deployed as a preview
npm run build         # uses the DATA_SOURCE environment variable (remote or mock)

To launch a tool for inspecting the bundle size:

npm run bundle-profile:analyze

Running in production mode (run a build first)

npm run start

Configurations

Import paths

TypeScript is configured to allow importing modules by their absolute path. The prefix @app/ is an alias for the main src/app/ directory.

For example:

import { PROVIDER_TYPE_NAMES } from '@app/common/constants';

In general, we should use relative paths ../ when they make sense for co-located files, and absolute paths for things located near the root. The goal is to avoid long and hard-to-read relative paths.


More Information

The configuration of this repository is based on patternfly-react-seed. See that project's README for more information:

forklift-ui's People

Contributors

dependabot[bot] avatar fabiendupont avatar fbladilo avatar gildub avatar ibolton336 avatar ibragins avatar imsamuel avatar kpunwatk avatar mnecas avatar mturley avatar nachandr avatar rayfordj avatar seanforyou23 avatar yaacov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

forklift-ui's Issues

Add search state to the tree view in step 2 of the plan wizard

Currently the onSearch prop of the <TreeView> is not connected to anything. Related to #38, since this will involve filtering the same generated tree items based on the search state before passing them into the TreeView.

Also weirdly, pressing the enter key while focused in the search bar expands/collapses the tree, not sure what's going on there. We'll want to address that too somehow.

Wizard network mapping step scaffolding

Create a page for the network mapping step in the plan wizard. This will involve conditional components displayed via a radio button.

  • Implement the radio button conditional
  • Add Title markup & body copy
  • Create placeholder for the create network mapping component
  • Create placehodler for the select existing network mapping component

networkmapping

networkmapping2

PF Select ignores aria-label propagation from SimpleSelect, generating `serious` error.

It seems like Select triggered from SimpleSelect is simply ignoring aria-label which is propagated via ...props.
I tried to force by adding aria-label explicitly to Select component with the same result

serious: ARIA input fields must have an accessible name https://dequeuniversity.com/rules/axe/3.5/aria-input-field-name?application=axeAPI index.js:216
Element:  
<ul id="target-provider" class="pf-c-select__menu" role="listbox">
index.js:114
HTML: <ul class="pf-c-select__menu" role="listbox" id="target-provider"> index.js:122
Fix any of the following:
  aria-label attribute does not exist or is empty
  aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty
  Element has no title attribute or the title attribute is empty react_devtools_backend.js:2273:24

โ€‹
To reproduce:
Use any component calling SimpleSelect and make sure aria-label prop is define in the SimpleSelect call.
For example use AddEditMappingModal and then in debug mode (dev tools) click on any select field, the error should appear in console.

REMOTE_API_URL needs to be a run-time configuration variable instead of a build-time one.

Right now, the .env file contents are statically replaced by webpack at build time wherever they are referenced in the source. This means you can't change the API URL on a deployed build, you'd have to rebuild it.

We need to do something similar to the MigMeta object in MTC and ship the value of REMOTE_API_URL to the client at run time via the Express server.

Wizard storage mapping step scaffolding

Create a page for the storage mapping step in the plan wizard. This will involve conditional components displayed via a radio button.

  • Implement the radio button conditional
  • Add Title markup & body copy
  • Create placeholder for the create storage mapping component
  • Create placehodler for the select existing storage mapping component
    image

image

Replace @patternfly/react-icons imports with direct deep-path imports to reduce bundle size

According to @redallen we should be importing our icons like this:

import CogIcon from '@patternfly/react-icons/dist/js/icons/cog-icon';

instead of:

import { CogIcon } from '@patternfly/react-icons';

As-is, we're bundling and shipping all of those SVG icons in our app no matter which ones we use.

We should also add https://github.com/patternfly/patternfly-react/tree/master/packages/eslint-plugin-patternfly-react to catch these issues in the future.

Change informational text notification on Providers page

The notification that appears the first time a user sees the Providers table telling them the benefits of uploading to cloud.redhat.com should have this text, "You can analyze your VMware provider data with the Red Hat Migration Analytics service. Migration Analytics generates a complete inventory of your VMware environment and VM recommendations for migration. Select your VMware providers and download the data file. Then log in to cloud.redhat.com, select Migration Analytics, and create a Migration Analytics report."

MTV Welcome page text change

Per Avital, the page heading should be "Welcome to the Migration Toolkit for Virtualization". Need to add "the".

Handle/display error messages from inventory API requests

Currently all of our react-query queries can return an isError property (or status === 'error') but don't return any information about the error itself. We should determine if/where error messages can be returned and put them on the page.

Implement plans table - migration details child table

As a user I would like view additional migration details so that I can see an aggregate view of migrations associated with a migration plan with relevant status information.
This view includes an expandable PF table component filled with migration items. Rows should be filterable, sortable, and contain an actions section with a kebab and action buttons. Row columns migration name, start time, end time, data copied, & migration status. The status progress pipeline component & status implementation details should be left for another PR.

image

Implement plan status progress bar component

As a user I would like to view an individual plans migration progress so that I can determine the current status of a given migration/plan status.

This view includes a PF progress bar with several states derived from the plans underlying migration data. This component should be somewhat modular so that it can receive status information via props & change the components text, icon, & progress bar color accordingly.

image

Add useFormState validation to all other forms

In #53 we only added validation using useFormState to the Add Provider form. We should put it in all the other forms we have so far (mappings, host network selection, plan wizard steps, ???)

Following is exhaustive list of forms, checked one are using useFormState:

  • AddProviderModals - Providers
  • PlanWizard - Plan migration wizard
  • SelectNetworkModal - Host Network
  • AddEditMappingModal - for Network and Storage mappings
  • MappingForm - for Network and Storage mappings from Wizard Plan

Add useFormState to plan wizard, figure out how lifting that state will work

I was thinking we'd need to use Context to lift the form state for wizard steps, but that complicates TS types (the consumer can't tell what form you're passing in since you could be using it for any provider, so we'd need generics and explicit form field interfaces there). I think instead we can just pass the form state objects directly into the wizard steps.

Add a FilterToolbar to the plans table

Leaving this out of #66, let's add it as a follow-up. To the left of the Create button there should be a FilterToolbar (driven by useFilterState) to allow the user to filter by a few columns.

Screen Shot 2020-09-23 at 2 31 21 PM

@vconzola which columns should we able to filter on here? I'm guessing all of them except number of VMs?

Add "expand/collapse all" control in the header of the leftmost column of the select VMs table in step 2 of the plan wizard.

Similar to #35, we will need a change in PF to support this since we can't modify the header of that column (it's generated by the expandable transform in Table). Will open an issue there and follow up here.

Once it's available, as noted here we can use the selectAll and areAllSelected values from useSelectionState to drive this button, and it should use the <AngleRightIcon> and <AngleDownIcon> icons depending on its state.

Handle displaying various status conditions on providers

The status column in the providers table will currently only display the first condition in the list, and hasn't been tested with error or warning conditions. We need to double check that stuff, and possibly look at the rest of the conditions array to identify the most serious condition or display multiple conditions.

See: https://github.com/konveyor/virt-ui/blob/2bf0b914669a79553bad324759b1985bd62a8e29/src/app/Providers/components/ProvidersTable/VMware/VMwareProvidersTable.tsx#L43

Add checkbox selection state to tree view in step 2 of the plan wizard.

This has strange recursion implications because of the need to represent a subtree's selection state based on the selection of its descendants. We can reference the implementation in this example on patternfly.org, possibly modified to work with our useSelectionState hook, but we may need to modify that hook to support selecting multiple items (a subtree) at once synchronously.

In order to do this, we should also define our TreeViewDataItems declaratively as a function of API data and selection state, instead of mutating the tree items directly when selection state changes. This may require traversing the tree structure more than once.. I started brainstorming that here: #21 (review)

Plans table details view - implement widget for pipeline summary icons

This won't have a place to live until we get to the drill-down plan details page, but we'll need a special custom component for the little dots-on-a-line progress summary in the table.

This guy:
Screen Shot 2020-09-21 at 10 01 15 AM

Screen Shot 2020-09-21 at 10 01 18 AM

I think it'll be fairly simple, I'm thinking just a flex container with evenly spaced icons, and a backdrop div (lower z-index) with a top border and padding equal to half the height minus half the border width, for the line through them.

Wizard VM selection step scaffolding

Create a page for the VM selection step in the plan wizard. This will involve 2 nested steps for Filter VMs and Select VMs.
Include necessary title markup & placeholders for the Filter VMs component and Select VMs component.

image

image

Move host details to its own page in MTV UI

We should move host details from a row expansion under providers to its own page that can be drilled down to from the providers page. Reasons: scaling - we need to support 50 or more hosts on a single provider and row expansion does not work well.

Switch expandable selectable tables from custom checkbox columns back to using the `onSelect` prop

The issue that kept me from using the PF Table's onSelect prop was that the expanded content had a phantom column that we couldn't control, to the left of our expanded content. I'm not sure if I missed this before, but we might just be able to use the fullWidth: true property in the expanded rows, as in this example to get around the issue. This would also fix the awful layout these tables have on mobile viewports.

Fetch storage classes for each provider (first dependent query)

Storage classes are a separate resource keyed by provider, we can't fetch all of them at once. So we need a storage classes query that depends on the providers query and gets storage classes for a certain provider. This will be used in the expanded content of the OpenShift providers table and in the mapping builder.

Implement plans table - Parent table

As a user I would like to view created migration plans so that I can see an aggregate view of current plans with relevant status information.
This view includes a PF table component filled with plan items. Rows should be filterable, sortable, and contain an actions section with a kebab and action buttons. Row columns plan names, source, target, vm count, & status. The status progress bar component & status implementation details should be left for another PR.

image

Move plan wizard from a modal to a standalone page w/ breadcrumb bar

Discussing form validation with @vconzola, we realized there may be a few things we want to warn the user about actively before they proceed to the next step (e.g. open a modal that says "not all source datastores were mapped, are you sure you want to proceed?")

In order to prevent having a modal on top of a modal, we decided we should convert the plan wizard into a full page. This is low priority though, we can have a modal-in-a-modal in the meantime if we need to.

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.