GithubHelp home page GithubHelp logo

amalto / platform6-ui-components Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 2.0 20.95 MB

:package: Platform 6 UI components provided to develop the user interface of services

License: MIT License

TypeScript 77.72% JavaScript 20.86% HTML 0.50% SCSS 0.92%
javascript react typescript user-interface

platform6-ui-components's People

Contributors

choucrifahed avatar dependabot[bot] avatar jswale avatar roxanemace avatar snyk-bot avatar vincentv avatar vuongc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

platform6-ui-components's Issues

Props "locale" is not well explained #ButtonsBar

The description of the props locale is not sufficient. You are saying that the props locale is a locale, you are not explaining what it's used for, what is the default value and what are the available values.

Moreover, you should add a link to the method which gets the locale from the browser webStorage.locale and how to format it

export function formatLocale (locale: string): string { return locale.substring(0, locale.indexOf('-')).toUpperCase() }

Create a new method to handle a service's item name duplication

The current signature of the method is:

function handleDuplicateNameFromArray( name: string, container: string[]): string;

I think it would be better if the method takes in argument the item's id and the current facade list. The method should be more specific to Platform 6 services.

I suggest the following method (of course it's just a suggestion, you may choose a different method's name or logic).

/**
 * Increment an item's name
 *
 * @param {ServiceItemFacades} facades
 * @param {Interfaces.Id} id
 * @returns {string}
 */
export function incrementName (facades: ServiceItemFacades, id: Interfaces.Id): string {
	const { name } = id
	let index = 1

	const facadesWithSameAppKey = facades.filter(f => f.appKey === id.appKey)

	if (facadesWithSameAppKey.length === 0) return name

	while (!facadesWithSameAppKey.every(f => f.name !== `${name}_${index}`)) index++

	return `${name}_${index}`
}

with the following interfaces

    interface Id {
        name: string
        appKey: string
    }
	interface ServiceItemFacade extends Id {
		description: string
		calculatedContentMode: string
		appInfo?: string
		lastModifiedBy?: string
		lastModifiedDate?: number
		revisionId?: string
	}

It's difficult to read the type of some props

The width of the column for the type of the props is too small.
The method's signature is on 3 lines, which doesn't ease the reading.
Moreover, there are lots of space on the right and the left of the main column.

screen shot 2018-03-29 at 14 11 42

Add a link to "webStorage"

In the documentation, for the component "Restricted", it's written:
"No live example will be provided because we don't have access to the webStorage."

You need to add a link to the webStorage.

Incoherent import `ScopeHelpers`

The import of the ServiceHelpers is import * as ScopeHelpers from '@amalto/service-helpers'.

It should be something like import * as serviceHelpers from '@amalto/service-helpers'

Create a new component to display multi processing errors

Create a modal to display clearly the errors generated during multi-process.

The endpoints concerned are import and deleteItems (for export, the errors are logged).

The object looks like:
{ "processed": 0, "errors": "Map[string,B2ResourceException]", "message": "" }

  • processed: the number of items processed
  • message: the global message of the errors (eg: "Unexpected error deleting the items!")
  • errors: a map of errors created during the process (key: item's id, value: error)

B2ResourceException consists of:

  • cause
  • stackTrace
  • status
  • code
  • message
  • localizedMessage
  • suppressed

If there are no errors (one processed item), the response will look like this:
{ "processed" : 1, "errors" : { }, "message" : "" }

If there are errors, the response will look this:

{ 
    "processed" : 1,
    "errors" : { 
        "ClassExample" : { 
            "cause" : null,
            "stackTrace" : [ 
                { "methodName" : "upsertItem", "fileName" : "DAOServiceConfigurationManager.java", "lineNumber" : 110, "className" : "com.amalto.b2box.core.impl.servicecomponent.configuration.DAOServiceConfigurationManager", "nativeMethod" : false },
                { "methodName" : "upsertItem", "fileName" : "ScriptsConfigurationManager.java", "lineNumber" : 27, "className" : "com.amalto.service.scripts.ScriptsConfigurationManager", "nativeMethod" : false },
                { "methodName" : "handle", "fileName" : "StatisticsHandler.java", "lineNumber" : 169, "className" : "org.eclipse.jetty.server.handler.StatisticsHandler", "nativeMethod" : false },
                { "methodName" : "handle", "fileName" : "HandlerWrapper.java", "lineNumber" : 134, "className" : "org.eclipse.jetty.server.handler.HandlerWrapper", "nativeMethod" : false },
                { "methodName" : "handle", "fileName" : "RewriteHandler.java", "lineNumber" : 335, "className" : "org.eclipse.jetty.rewrite.handler.RewriteHandler", "nativeMethod" : false },
                { "methodName" : "run", "fileName" : "HttpChannel.java", "lineNumber" : 267, "className" : "org.eclipse.jetty.server.HttpChannel", "nativeMethod" : false },
                { "methodName" : "run", "fileName" : "Thread.java", "lineNumber" : 748, "className" : "java.lang.Thread", "nativeMethod" : false }
            ], 
            "status" : 409,
            "code" : -1,
            "link" : null,
            "developerMessage" : null,
            "conflictInformation" : [{ "itemId" : "ClassExample", "lastAuthor" : "[email protected]", "lastModificationDate" : 1520599965330 }],
            "message" : "Conflict on saving the item 'ClassExample'. This item has been modified by [email protected] at Fri Mar 09 12:52:45 GMT 2018 since this item was read.",
            "localizedMessage" : "Conflict on saving the item 'ClassExample'. This item has been modified by [email protected] at Fri Mar 09 12:52:45 GMT 2018 since this item was read.", 
            "suppressed" : [ ] 
        } 
    },
    "message" : "Unexpected error importing the items!" 
}

Fix spelling mistakes

I'll add all the spelling mistakes I saw in the documentation

  • Add a link to Font Awesome each time you write.
  • It's not FontAwesome but Font Awesome.
  • This documentation regroup all the component available for you to develop your own service on Platform6. => regroups, Platform 6
  • Edit the code and see the exemple being edited for each component. => example
  • Add a dot at the end of sentence: All the components provided by Platform 6
  • Small button with an icon instead of text. => A small ...
  • Set the icon color class. Do not use if you don't need it, otherwise btnClass will have trouble handeling hover color. => Set the icon colour class. Do not use if you don't need it, otherwise, btnClass will have trouble handling hover colour.
  • Modal use to confirm a file upload. => used
  • Commons classes => Common classes
  • otherwise the class wont work. => otherwise the class won't work.
  • return the same object passed as param but with ASC ordered keys. => Return
  • return the same object passed as param but with DESC ordered keys. => Return
  • It uses an TreeNodeDataModel object => It uses a ...
  • ScopeValue interface is not editable and usable by user, it regroup the user's actions he is able to perform. => by the user, regroups
  • "This component is not a stand alone component because his functionnalities uses actions from the core." -> "This component is not a stand-alone component because its functionalities use actions from the core."

Incoherent import `b2portal`

For the package @amalto/platform6-ui, it is displayed:
import * as b2portal from '@amalto/platform6-ui'.

b2portal means nothing for the external developers, it should be something like import * as platform6 from '@amalto/platform6-ui'.

Check that it doesn't break the code of the Portal.

Clean the wordings

Should replace all the keys to camelCase and replace it whenever you find it.

You should look into the services and the core ui.

Default column is not correctly filled

The default column doesn't present the default values. Required is no a default value, it should be in the description cell.
For example, in the example below, the default values are not set: btnClass -> "" ...

screen shot 2018-03-29 at 14 34 36

The property 'locale' in the ButtonsBar component should be optional

The property locale in the ButtonsBar component should be optional and by default to en-EN.

Indeed, if the developer wants to display his UI only in English, he doesn't need to set the local property.

Plus, specify in the documentation that the locale is used for the wordings of the search input.

Typography is not consistent

screen shot 2018-03-29 at 14 24 00

Your typography is not uniform: you use "", or bold or nothing. Any technical term (all term circled) should be like this.

The example above is ActionButton. You should do like this for all the components.

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.