Giter Site home page Giter Site logo

gravitee-io / gravitee-ui-components Goto Github PK

View Code? Open in Web Editor NEW
18.0 28.0 12.0 15.86 MB

🧱 Set of UI components used across the Gravitee.io ecosystem.

Home Page: https://components.gravitee.io

License: Apache License 2.0

JavaScript 90.34% HTML 0.06% CSS 4.02% Dockerfile 0.07% Shell 0.01% TypeScript 5.50%
gravitee web-components lit security-scan

gravitee-ui-components's Introduction

Welcome to Gravitee.io UI Components

User guide

To use the Gravitee.io component library in your app just run:

npm install --save @gravitee/ui-components
# Or
yarn add @gravitee/ui-components

Configuration

The components are based on a set of files to manage icons, images, i18n or even for CSS. When we publish the dist folder, we also publish the assets, you can get them in folder @gravitee/ui-components/assets. To use them in an application, it is necessary to add some configuration to expose the folders on the correct paths.

When working with Webpack directly you need to update the configuration:

webpack.conf.js

const CopyPlugin = require('copy-webpack-plugin');

module.exports = {
  plugins: [
    new CopyPlugin({
      patterns: [
        { from: 'node_modules/@gravitee/ui-components/assets/images', to: 'images' },
        { from: 'node_modules/@gravitee/ui-components/assets/css', to: 'css' },
        { from: 'node_modules/@gravitee/ui-components/assets/svg', to: 'svg' },
        { from: 'node_modules/@gravitee/ui-components/assets/i18n', to: 'i18n' },
      ],
    }),
  ],
};

When working with Angular then update your angular.json file:

angular.json

{
  "architect": {
    "build": {
      "builder": "@angular-devkit/build-angular:browser",
      "options": {
        "index": "src/index.html",
        "main": "src/main.ts",
        "assets": [
          "src/favicon.ico",
          "src/favicon.png",
          "src/assets",
          {
            "glob": "**/*",
            "input": "node_modules/@gravitee/ui-components/assets/images",
            "output": "images/"
          },
          {
            "glob": "**/*.css",
            "input": "node_modules/@gravitee/ui-components/assets/css",
            "output": "css/"
          },
          {
            "glob": "**/*.svg",
            "input": "node_modules/@gravitee/ui-components/assets/icons",
            "output": "icons/"
          },
          {
            "glob": "**/*.json",
            "input": "node_modules/@gravitee/ui-components/assets/i18n",
            "output": "i18n/"
          }
        ]
      }
    }
  }
}

I18n

Some components use i18n, if you didn't need it, you can load the default EN translations when your app starts.

import { loadDefaultTranslations } from '@gravitee/ui-components/src/lib/i18n';

loadDefaultTranslations();

Using in Angular app

First import the component

import { FormGroup, FormControl } from '@angular/forms';

import '@gravitee/ui-components/wc/gv-input';
import '@gravitee/ui-components/wc/gv-button';

Use in template, like an simple HTML element

<form [formGroup]="loginForm" (ngSubmit)="login()">
  <div>
    <gv-input autofocus name="username" formControlName="username" ngDefaultControl gvControl icon-left="communication:shield-user">
    </gv-input>
    <gv-input type="password" name="password" formControlName="password" ngDefaultControl gvControl icon-left="general:shield-protected">
    </gv-input>
  </div>

  <div>
    <gv-button class="signin" primary icon="navigation:sign-in" type="submit">Login</gv-button>
  </div>
</form>

Upgrade

Read the changelog and be careful with breaking changes or notes about upgrade of dependencies.

To install the desired version:

npm install --save @gravitee/ui-components@{version}

TIP: You can clean the package-lock.json and remove duplicate dependencies with npm dedupe

Developers guide

Install

  • Install nvm
  • Use with nvm use or install with nvm install the node version declared in .nvmrc
  • Then install node modules with: yarn install

Tasks

The available scripts are:

  • yarn serve: start Storybook in dev mode
  • yarn lint: run eslint and prettier
  • yarn lint:fix: run eslint with autofix and prettier in write mode
  • yarn test: run the unit tests
  • yarn test --collect-coverage: run the unit tests with coverage
  • yarn docs: generate the documentation
  • yarn build: build storybook
  • yarn serve:prod: start Storybook in prod mode
  • yarn generate:dist: build components to use them in your project
  • yarn generate:icons: build icons files from svg files
  • yarn generate:theme: generate theme file based on css custom properties defined in each component file
  • yarn compile: compile source files
  • yarn compile:watch: compile source files on each change

If you want link for use in other local project as dependency:

yarn build
cd dist
npm link --ignore-scripts
cd ~/my-project
npm link @gravitee/ui-components

If you want to run hot-reload with npm link

yarn compile:watch

Renovate

Some components are based on third party libraries, for integration into a web component, we extract the css from its libraries as assets.

WARNING: When highlight.js or github-markdown-css are updated, we must run yarn build task to update the css.

Contributing

You think Gravitee.io is awesome and want to contribute to the project? Here are few guidelines that should help you get started.

Copyright

Copyright (C) 2015 The Gravitee team (http://gravitee.io) Licensed under the Apache License, Version 2.0 (the "License");

See the LICENSE file for details.

Changelog

Refer to the CHANGELOG for a complete list of changes.

gravitee-ui-components's People

Stargazers

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

Watchers

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

gravitee-ui-components's Issues

Improve icons integration

currently we generate a javascript file by category of icons in which we store the svg code.
Whenever we need it, we use a dynamic import.
It's not the most powerful and it's not really elegant.

It would be nice to use svg tag.

  • Use SVG tag instead JS
  • Add documentation "How to integrate assets (images, css, icons, i18n) to new project ?"
  • Add documentation "How to add new icon ?"
  • Add sample "How to use icon ? (with gv-icon component and with simple svg tag)"

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Warning

These dependencies are deprecated:

Datasource Name Replacement PR?
npm @codemirror/basic-setup Unavailable
npm @codemirror/stream-parser Unavailable
npm eslint-plugin-node Available
npm eslint-plugin-standard Unavailable
npm pascal-case Unavailable

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): replace dependency eslint-plugin-node with eslint-plugin-n 14.0.0
  • chore(deps): update dependency keeper to v0.6.3
  • fix(deps): update dependency @popperjs/core to v2.11.8
  • fix(deps): update dependency codemirror-asciidoc to v2.0.1
  • fix(deps): update dependency jsonschema to v1.4.1
  • fix(deps): update dependency whatwg-fetch to v3.6.20
  • fix(deps): update formatjs monorepo (@formatjs/intl-locale, @formatjs/intl-relativetimeformat)
  • chore(deps): update dependency gh to v2.4.0
  • chore(deps): update dependency node to 16.20
  • chore(deps): update node.js to v16.20
  • chore(deps): update yarn to v3.8.5
  • fix(deps): update dependency date-fns to v2.30.0
  • fix(deps): update dependency dompurify to v3.1.6
  • fix(deps): update dependency jdenticon to v3.3.0
  • fix(deps): update dependency lit to v2.8.0
  • chore(deps): update actions/checkout action to v4
  • chore(deps): update commitlint monorepo to v19 (major) (@commitlint/cli, @commitlint/config-conventional)
  • chore(deps): update dependency babel-loader to v9
  • chore(deps): update dependency chromatic to v11
  • chore(deps): update dependency danger to v12
  • chore(deps): update dependency eslint to v9
  • chore(deps): update dependency eslint-config-prettier to v9
  • chore(deps): update dependency eslint-config-standard to v17
  • chore(deps): update dependency eslint-plugin-promise to v7
  • chore(deps): update dependency eslint-plugin-standard to v5
  • chore(deps): update dependency glob to v11
  • chore(deps): update dependency highcharts to v11
  • chore(deps): update dependency husky to v9
  • chore(deps): update dependency lint-staged to v15
  • chore(deps): update dependency lit-html to v3
  • chore(deps): update dependency markdown-it to v14
  • chore(deps): update dependency node to v20
  • chore(deps): update dependency nodemon to v3
  • chore(deps): update dependency pascal-case to v4
  • chore(deps): update dependency prettier to v3
  • chore(deps): update dependency semantic-release to v24
  • chore(deps): update dependency svgo to v3
  • chore(deps): update dependency typescript to v5
  • chore(deps): update dependency web-component-analyzer to v2
  • chore(deps): update dependency webpack-merge to v6
  • chore(deps): update dependency zx to v8
  • chore(deps): update github/codeql-action action to v3
  • chore(deps): update jest monorepo to v29 (major) (babel-jest, jest)
  • chore(deps): update node.js to v22
  • chore(deps): update storybook monorepo to v8 (major) (@storybook/addon-a11y, @storybook/addon-essentials, @storybook/components, @storybook/theming, @storybook/web-components)
  • chore(deps): update yarn to v4
  • fix(deps): update dependency @codemirror/language-data to v6
  • fix(deps): update dependency date-fns to v3
  • fix(deps): update dependency lit to v3
  • fix(deps): update formatjs monorepo (major) (@formatjs/intl-locale, @formatjs/intl-relativetimeformat)
  • 🔐 Create all rate-limited PRs at once 🔐

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

  • chore(deps): update devdependencies (non-major) (@asciidoctor/core, @babel/preset-env, @babel/preset-typescript, @highcharts/map-collection, @semantic-release/changelog, @storybook/addon-a11y, @storybook/addon-essentials, @storybook/components, @storybook/theming, @storybook/web-components, @types/dompurify, asciidoctor, chromatic, danger, eslint, eslint-config-prettier, eslint-plugin-import, eslint-plugin-lit, eslint-plugin-promise, highlight.js, html-to-react, lit-html, nodemon, prettier, sort-package-json, web-component-analyzer, webpack-merge)
  • fix(deps): update codemirror to ^0.20.0 (@codemirror/basic-setup, @codemirror/language-data)

Detected dependencies

circleci
.circleci/config.yml
  • keeper 0.6.2
  • gh 2.2.0
  • cimg/node 16.19
dockerfile
docker/Dockerfile
github-actions
.github/workflows/codeql-analysis.yml
  • actions/checkout v3
  • github/codeql-action v2
  • github/codeql-action v2
npm
package.json
  • @codemirror/basic-setup ^0.19.1
  • @codemirror/language-data ^0.19.1
  • @codemirror/stream-parser ^0.19.9
  • @formatjs/intl-locale ^2.4.40
  • @formatjs/intl-relativetimeformat ^9.3.2
  • @messageformat/core 3.3.0
  • @popperjs/core ^2.11.7
  • clipboard-copy ^4.0.0
  • codemirror-asciidoc ^2.0.0
  • date-fns ^2.26.0
  • dompurify ^3.0.3
  • jdenticon ^3.1.0
  • jsonschema ^1.4.0
  • lit ^2.0.2
  • object-path ^0.11.8
  • resize-observer-polyfill ^1.5.1
  • whatwg-fetch ^3.6.17
  • @asciidoctor/core 3.0.2
  • @babel/preset-env 7.20.2
  • @babel/preset-typescript 7.21.0
  • @commitlint/cli 16.3.0
  • @commitlint/config-conventional 16.2.4
  • @highcharts/map-collection 2.0.1
  • @semantic-release/changelog 6.0.2
  • @semantic-release/git 10.0.1
  • @storybook/addon-a11y 6.4.22
  • @storybook/addon-essentials 6.4.22
  • @storybook/components 6.4.22
  • @storybook/theming 6.4.22
  • @storybook/web-components 6.4.22
  • @types/dompurify ^3.0.2
  • asciidoctor 3.0.2
  • asciidoctor-highlight.js 0.4.0
  • babel-jest 27.5.1
  • babel-loader 8.3.0
  • chromatic 6.17.1
  • danger 11.2.4
  • del 7.1.0
  • eslint 8.35.0
  • eslint-config-prettier 8.7.0
  • eslint-config-standard 16.0.3
  • eslint-plugin-import 2.27.5
  • eslint-plugin-lit 1.8.2
  • eslint-plugin-node 11.1.0
  • eslint-plugin-promise 6.1.1
  • eslint-plugin-standard 4.1.0
  • esm 3.2.25
  • fs-extra 11.2.0
  • github-markdown-css 4.0.0
  • glob 7.2.3
  • highcharts 10.3.3
  • highlight.js 11.7.0
  • html-to-react 1.5.0
  • husky 7.0.4
  • i18n-extract 0.6.7
  • ignore-loader 0.1.2
  • is-ci 3.0.1
  • jest 27.5.1
  • license-check-and-add 4.0.5
  • lint-staged 12.5.0
  • lit-html 2.6.1
  • markdown-it 12.3.2
  • node-static 0.7.11
  • nodemon 2.0.21
  • pascal-case 3.1.2
  • prettier 2.8.4
  • semantic-release 18.0.1
  • sort-package-json 2.6.0
  • svgo 2.8.0
  • svgstore 3.0.1
  • typescript 4.9.5
  • web-component-analyzer 1.1.6
  • webpack-env 0.8.0
  • webpack-merge 5.8.0
  • zx 4.3.0
  • @asciidoctor/core ^3.0.2
  • @highcharts/map-collection ^1.0.0 || ^2.0.0
  • asciidoctor ^3.0.2
  • asciidoctor-highlight.js ^0.3.0 || ^0.4.0
  • highcharts ^8.0.0 || ^9.0.0 || ^10.0.0
  • highlight.js ^10.7.0 || ^11.1.0
  • colors 1.4.0
  • yarn 3.4.1
nvm
.nvmrc
  • node 16.19

  • Check this box to trigger a request for Renovate to run again on this repository

[gv-table] Add a title on a table cell

If for some reason a user of the gv-table want to truncate the content of a cell, it could be nice to have the full content in the title of the cell, so it can appears when the pointer enter the cell.

Like this:
image

Logging configuration buttons not working

Describe the bug
When i want to configure the logs to only log the headers i go to Analytics -> Logs -> Configure the logging.
Here i click enable the logging to enable the logging. This works, if i press save i can redeploy and the requests will be logged.
But pressing any of the options under Mode, Content and Scope, don't allow me to save and redeploy and they don't get stored. The logging behavior is not changed.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Logging configuration
  2. Click on Headers only
  3. Scroll down to [SAVE]
  4. See error: you cannot save

Expected behavior
The expected behavior is that when you change the settings you can save and deploy them.

Screenshots
image

Use Chromatic to avoid visual regression

Description

As this repo is deeply using Storybook with multiples stories for each component; it would be great to use them to ensure we don't introduce regression when opening a PR.

To do so, we can use Chromatic:

Chromatic ensures consistency in UI components, down to the pixel. Every commit is automatically tested for visual changes in the cloud.

Chromatic uses the build Storybook and make "screenshots" of each stories to later compare them to a base reference, often the master branch. It then offers a webapp to walk through the potential differences between a branch and the base, and validate or reject them:

image

A check is also automatically added in the PR on GitHub:

image

There is a free plan of Chromatic including a small number of story snapshots per month but as this repo is open source I'm sure I can get a specific OpenSource key if I ask nicely 😁.

--

A presentation of Chromatic and the integration we can make on this repo has been made internally, as @gaetanmaisse for details and/or the slides.

--

Next step:

  • Discuss with @Jean-Baptiste-Lasselle about CI updates to integrate properly Chromatic
  • Try different things to reduce the number of snapshots done during each run:
    • Manual validation in CircleCI before the Chromatic job
    • Filter some stories for which Chromatic isn't very relevant (components with loaders, highchart charts etc)
  • Add some doc about Chromatic + CI integration in the readme
  • Merge and try!
  • Move to the Starter plan and follow the snapshot usage quotas in the few first months

Move some dependencies to optional peer dependencies

Description

Currently, some packages are listed as dependencies but they are quite heavy and are only required for some components.
To avoid forcing all the users to install this lib we could make these dependencies optional peer dependencies instead and let the end-user decide or not if he wants to install them or not.

Another benefit would be to let the end-user define the version he wants to use. To do so it will avoid having multiple version of the same lib in the end app, resulting in smaller app builds and avoiding any conflicts between 2 versions of the same lib.

I have in mind the following deps:

  • highcharts and @highcharts/map-collection
  • highlight.js
  • asciidoctor and asciidoctor-highlight.js

Refactor some Storybook helpers

Description

This repo offers a great and complete Storybook to show the whole design system of Gravitee.
As there are a lot of components and dynamically editable variables some utility functions have been written to simplify story definitions. With the latest versions of Storybook some of theses utils/helpers could be rewrite/simplified.

i18n management

Some of the components adapt themselves according to the currently selected language, for instance, the date format in the date picker component. The management of the language across Storybook is done with a service and a knob variable:
image

As of Storybook 6, we can now add selectors in the toolbar, so we could move the i18n selection there and get something like:
image

As the i18nKnob tweak is already using a decorator there will not be so much change to migrate to the toolbar selector.

Knob deprecation

To easily demonstrate the components in many states almost all the stories are using Storybook knobs variables :
image

As of Storybook 6, a new addon has landed in the Storybook ecosystem: @storybook/addon-controls.
This addon is the future of knob as it offers a more Storybook agnostic way of describing variables, it somehow looks like some of the things done in makeStory of this repo, so I think we should take a look at that and see if we can simplify our custom code about story generation.

The visual result is quite the same:
image

See details here: https://github.com/storybookjs/storybook/tree/next/addons/controls

Storybook configuration

Some configurations, files in the .storybook directory, can be cleaned/simplified. This will doesn't change anything in term of feature or performance but it's always great to remove unneeded code.

[gv-http-client] headers are not well displayed

Describe the bug
There is an error in Try It mode when displaying headers.

To Reproduce
Steps to reproduce the behavior:

  1. Go to API - Design Studio - Try it
  2. Make a call to your API
  3. You will see strange trace in response headers section

Expected behavior
I should see headers as desired:
image

Screenshots
image

[gv-confirm] if gv-button is disabled, gv-confirm should not popup

I have the following:

<gv-confirm message="Are you sure ?" okLabel="OK" cancelLabel="CANCEL">
   <gv-button disabled="true" danger>Action<gv-button>
</gv-confirm>

I would expect confirm not to popup when clicking on button as it is disabled.

Other solution would be to put a disabled attribute on gv-confirm.

gv-select default background should be white

The default background for gv-select should be white. Having a transparent background causes the following issue in APIM Portal : gravitee-io/issues#5121

But we also want it to be transparent for Cockpit.

There is already a story for transparent select on dark background: https://components.gravitee.io/?path=/story/atoms-gv-select--simple-on-dark-background, with the expected look&feel:
screenshot-components gravitee io-2021 02 23-14_59_06

We should make sure this one is still working as expected, and also create a second one with default white background.

gv-popover truncate content

The large content popover is truncated when

  • the element is located on the left edge of the screen
  • we use the top (or bottom) position

Screen Shot 2021-01-15 at 9 22 15 AM
Screen Shot 2021-01-15 at 10 42 17 AM
Screen Shot 2021-01-15 at 10 42 34 AM

create a gv-banner

As mentioned by @gcusnieux here, it could be great to have a banner component like this :

The name is clearly defined, maybe gv-note would be more appropriated

image
image

gv-autocomplete options panel should close when an item is selected

Current behavior

In the case of a gv-autocomplete component with "no option" slot, when the user clicks on an item to select it, the item is selected but item list is not closed.

Atoms._.gv-autocomplete.-.No.Options.Slot.Storybook.mp4

Expected behavior

Item selection panel should be closed when an item is selected.

Create a gv-modal component

We want to be able to show some warning to the user when he is performing irreversible actions, as Github does for its danger zone actions.

screenshot-github com-2021 02 26-08_45_49

For this we need to build a gv-modal poping on top of the page with a gray background over it, with a slot to define the content.

Clean Maven related stuff

Description

As the CI for PR build and release is now migrated to CircleCI and bare NodeJS we don't need the maven related stuff.

Edit: It looks like there is a missing check in the current CI workflow, the licence check, it was done with a maven plugin. We should easily find an equivalent NPM package and setup it in the repo.

[gv-select] Switch to a native HTML `select`

Context

Currently, the gv-select is based on the composition of an input and ul/li to display the options. Even if it works properly most of the time there are some edge cases where the current implementation isn't working fine, for instance:

  • Inside a scrollable parent, playing with position attribute leads to weird behaviour of the options list when scrolling
  • Inside a gv-table, the options are cropped to fit inside the table container and there is no easy trick to fix that

There was already a few attempts to fix the problematic behaviour but it never really succeeded as each fix was introducing new issues.

Goal

The goal of this issue is to rework the gv-select deeper than what has been tried before to:

  • fix current bugs, see the previous section
  • have a better browser support
  • ease the implementation of future features

To do so, it could be interesting to see if we can use a native select (+ option) instead of dealing with a rebuild version of that.

Additional info / Comments

For any details discuss with @gcusnieux @gaetanmaisse

Policy studio: Strange behaviour when add new flow, save and select other flow.

Describe the bug
The last flow selected mark as dirty (yellow highlight in menu) after a form submit and save.

To Reproduce
Steps to reproduce the behavior:

  1. Go to "Policy studio AM editable story"
  2. Add new flow
  3. Change the title
  4. Submit the flow form
  5. Save all
  6. Select an other flow

Expected behavior
After step 6, the flow should not mark as dirty

Screenshots

policy-studio-dirty

Theming console

The goal is to have a look n feel of an administration console.

[gv-schema-form] disable field on condition

Describe

Currently, to disable a field we can add the field name into the disabled array of the schema definition.
When the gv-schema-form component is wrapped inside another one (like the policy studio), we can't update the disabled array of the schema through the TS code.

We need a way to define a condition to disable an element using the schema definition like :

    "type": {
      "title": "Type",
      "type": "string",
      "default": "root",
      "x-disable-condition": {
        "id" : "$notEmpty"
      }
  }

Additional context

We need this feature to fix gravitee-io/issues#5646, indeed the 'type' attribute of a flow can't be updated but need to be editable during the creation step, we have to test if the flow id is empty.

[gv-policy-studio] unable to reset flow condition

Describe the bug

Since #376 it is not possible to reset a flow condition.

To Reproduce
Steps to reproduce the behavior:

  1. Create a flow with condition
  2. Save the flow
  3. Remove the content of the condition field
  4. Submit the flow before saving it
  5. the condition isn't removed and the save button still disabled

Expected behavior

Condition field should be empty and the Save button should be enabled

[gv-table] Refactoring of `gv-table` component

Context

Currently, the gv-table is configuration-based, this is very useful when working with a dataset with only a few basic columns but becomes a real pain with complex rows.

Goal

The goal of this issue is to rework the gv-table to provide a better Developer eXperience. A way to do that can be to use slot to define rows, allowing users to write them in plain HTML file instead of using a config attribute like today. However this is not a silver bullet and leads to questions we need to keep in mind when working on that:

  • Should the slot only give a kind of template and the data should still be passed to the gv-table to let it populate the template?
  • Or, should the slots be used for the header and all the rows; meaning the gv-table is only handling some styling?
  • What about the pagination? Should it be integrated or let to the user? Should the potential "pagination API" be designed with server or local pagination in mind?
  • What about the alpha sort per column? If the gv-table doesn't contain the data anymore it can not sort them directly

Also, this component is quite used in the Gravitee.io ecosystem so we need to minimise the breaking change or start a fresh component to enable users to gradually migrate.

As of today, the Portal is using 13 gv-table, it could be a good start to take a look at them and use one as a real use case when developing the new version. It would help to:

  • Focus on the must-have feature
  • Be sure the DX is improve
  • Have a migration example to share with devs

Additional info / Comments

For any details discuss with @gcusnieux @gaetanmaisse

Related issues:

gv-state: clean var css

The success, warn and error colors must use the generic variable to configure them globally in the theme

Use Prettier to automatically format source code

Description

Prettier is an opinionated code formatter allowing developers to focus on what really matters and not code style.
This tool is widely used in the web ecosystem and has a 1st class integration in all major IDEs.

Prettier setup is quite simple, here are the different steps to follow:

  • add prettier dependency
  • setup a prettierrc.json file, based on options set in .editorconfig
  • format everything
  • commit & 🚀

[gc-chart-xxx] Blink when loading new data

Problem

When using a promise for the seriesof a gv-chart, then the skeleton appears until the promise is resolved.

If we want to refresh the data, there is a blink before rendering the skeleton state.

One clue we have with @gaetanmaisse is when the component is updated, then it is re-rendered with old value before passing to skeleton

Concerned components

  • gv-chart-pie
  • gv-chart-bar
  • gv-chart-line ( -> here there is no blink, but we see the data refreshing then pass to skeleton state)

How to reproduce

You can try with gv-chart-pie.stories.js, Loading story and use the following as simulations

simulations: [
    storyWait(0, ([component]) => {
      component.series = new Promise((resolve) => (seriesResolver = resolve));
      component.options = options;
    }),

    storyWait(750, () => {
      seriesResolver(series);
    }),

    storyWait(1500, ([component]) => {
      component.series = new Promise((resolve) => (seriesResolver = resolve));
      component.options = options;
    }),

    storyWait(2250, () => {
      seriesResolver(series);
    }),
  ],

Display the Changelog in Storybook

Description

As there is now a CHANGELOG.md it would be great to display it in Storybook near the Welcome section.

Additional info

The changelog page should be added here:

createDocsStories('Documentation', [

However, it looks like there is an issue with the generated markdown and/or Storybook as adding it here break the display of all the MD docs. So it will need some investigation.

gv-expression-language scroll and overflow issue

Describe the bug

When type Cmd+E to have the hints list for EL, the hints appear in the container, adding a scroll to it and hiding a part of the hint (see picture)

image

To Reproduce
You can go on APIM - Configure Health check and add headers to reproduce

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: Cannot find preset's package (github>whitesource/merge-confidence:beta)

[gv-tabs] Implement a new full size mode

Context

The current version of the gv-tabs has a very specific UI with tabs on the right of the screen: https://components.gravitee.io/?path=/story/organisms-gv-tabs--simple
This makes them quite hard to use in app screens where we are looking for a more full-width version.

Goal

The goal of this issue is to implement a new mode of gv-tabs looking closer to:
image

or

image

https://material-components.github.io/material-components-web-components/demos/tabs/

Additional info / Comments

For any details discuss with @gcusnieux @gaetanmaisse

Investigate about an Overlay component

Context

Some components like gv-select or gv-autocomplete are opening panels when focused/used. In the vaste majority of cases everything is working fine but there are some situation where the panel is cropped or displayed under an other element. Technically the panel in like a simple div dynamically renderer or not inside the component that why there are sometimes display issues.

After searching a bit it looks like some other frameworks are using an Overlay component to handle that cases, refs:

Goal

The goal of this issue is to make an investigation on:

  • what would be the real benefit against our current implementation
  • would it be still relevant if #251 is done
  • is it technically doable at an acceptable cost

Additional info / Comments

For any details discuss with @gcusnieux @gaetanmaisse

CI Overhaul

Description

  1. Workflow duration

Locally we currently have the following timings for each command:

  • npm install: ~15s
  • npm run lint: ~1s
  • npm run test: ~15s
  • npm run build: ~70s

It makes the whole validation workflow run in ~100s.

On the CI, the workflow ran on each PR takes ~8min, it's a lot lot more and so makes the feedback loop longer.

  1. Maven dependency

Currently, the CircleCI workflow is based on a common orb used for all Java + Front repos. This workflow looks to be based on Maven which is perfect for backend projects but can be quite heavy/overengineered for an NPM project as small as gravitee-ui-components. Plus, this repo has a lifecycle completely different from the one of APIM and AM products so I'm a bit afraid we will have a lot of constraints and only a few benefits using the same CI workflow/pipeline as APIM/AM.

Considered Solution

Maybe we should think to rework the CI to use a simple Node Docker image and avoid all the Maven toolings. It will certainly speed up the whole process, be more aligned with the web project philosophy, and will allow much simpler evolutions of the CI workflow (see next section for details about what I have in mind). This doesn't prevent us to create a CircleCI orb/functions in case we want to mutualize some code and reuse it in other NPM projects.

Long Term Vision

The release of this repo is in fact the publication of an NPM package on npmjs my long term vision is a fully automated release triggered automatically each time a merge on master is done. Ideas:

  • Enforce commit convention with a tool like CommitLint
  • Compute the version bump needed in a release by analyzing commit messages, see Semantic Release
  • Trigger a release each time a commit is pushed on master
  • Generate a GitHub release + update the Changelog with release bump and commit messages + links, see Conventional Changelog

--

@Jean-Baptiste-Lasselle will work on the CI of other NPM projects soon so it will be a great opportunity to discuss with him.

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.