GithubHelp home page GithubHelp logo

sebgroup / frontend-tools Goto Github PK

View Code? Open in Web Editor NEW
3.0 7.0 1.0 3.14 MB

A set of frontend tools written in Typescript

Home Page: https://github.com/sebgroup/frontend-tools/wiki

License: Apache License 2.0

JavaScript 1.39% TypeScript 39.43% HTML 59.18%
typescipt javascript javascript-utils javascript-tools frontend frontend-tools frontend-utils

frontend-tools's People

Contributors

dansallau avatar dependabot-preview[bot] avatar dependabot[bot] avatar eweseong avatar kaylesaintjohn avatar kherp avatar mario-subo avatar yousifalraheem avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

kaylesaintjohn

frontend-tools's Issues

The OpenAPI generator is not generating correctly with ts-angular

Describe the bug
The OpenAPI generator is not generating correctly with ts-angular

To Reproduce
Steps to reproduce the behavior:

  1. Use this swagger file to generate using ts-angular.
  2. Go to any of the generated API files
  3. Find that there are missing types causing compilation errors
    • Observable<>
    • this.makeCall<>

Expected behavior
It should generate the correct type or at least use type any if there is not type found in the swagger.json file

Additional information
If you fix the issues manually you will have another issue when using the generated APIs. The browser with through an error in the base.ts file line 319 about accessing headers of undefined. The options must be initialized with an empty object ({}) inside the initOptions function.

isDateAfter returning incorrect value

Describe the bug
When comparing dateA with dateB where dateA is older date than dateB, it should return false, but it return true

Expected behavior
it should return false when dateA is older date than dateB

Screenshots
If applicable, add screenshots to help explain your problem.
image

OpenAPI generate simulate data does not match the real API response

Describe the bug
Using the mocks generated by OpenAPI utility will not return the real API response. Currently the simulateData will return an HttpResponse while the API will return the body instead.

Expected changes
Before:

export function simulateData<T>(subscriber: Subscriber<HttpResponse<T>>, body: T, status: number, timeout: number): NodeJS.Timeout {
    return setTimeout(() => {
        subscriber.next(
            new HttpResponse<T>({ status, body })
        );
        subscriber.complete();
    }, timeout);
}

After

export function simulateData<T>(subscriber: Subscriber<T>, body: T, timeout: number): NodeJS.Timeout {
    return setTimeout(() => {
        subscriber.next(body);
        subscriber.complete();
    }, timeout);
}

Add unit test

Description

  • Setup unit test with Jest (and Enzyme if needed). Make all the configurations point to a new folder in root directory named test
  • Add unit test file for each of the utilities with this naming convention utilityname.test.ts
  • All function utilities should be tested with an array of test cases inside the describe method that renders an it or test function for each test case. This will allow adding more cases in the future easily
  • All class utilities should have each of its methods tested individually as units like described earlier, and then have the whole class tested as a single unit to make sure all its functions are working with each other as expected

Important

  • Make sure that unit test coverage is at least 75%

Setup automation

Description

  • Setup Travis-CI integration (Should be added as status check for pull requests)
  • Setup Coveralls (Should be added as status check for pull requests)
  • Add badges to README.md
    • Commitizen Friendly Commitizen friendly
    • Semantic-release semantic-release
    • Travis Build Build Status
    • Coveralls Coverage Status

Swagger codegen

Description

  • Should have node CLI
  • Considering our implementation currently works with Gradle, the CLI must verify that Gradle is installed in the machine. Otherwise, throw a warning/error with proper explanation
  • It should require a JSON config file to exist in the root directory defining the following:
    • API URL: The URL to be used when making API calls
    • Swagger URL: The URL to the Swagger schema JSON object
    • Path to response and/or request interceptors: The path to response and/or request interceptor methods
    • HTTP type: XMLHTTPRequest, Axios, RxJS, Fetch
    • Default Headers: The default headers, if any
    • Any other information needed by the Codegen
  • Both API URL and Swagger URL must be overridable since this feature is important when trying to inject these during a build pipeline
  • Unit test

OpenAPI Generator not generating correct model for arrays

Describe the bug
OpenAPI Generator is not generating correct model for some api responses (example: arrays)

To Reproduce
Steps to reproduce the behavior:

  1. Generate api with swagger.json which included an api response of type Array<SomeModel>
  2. Inspeact the generated API
  3. The api in question is generated as AxiosResponse instead of AxiosResponse<Array>

Expected behavior
Should generate correct models.

Additional context
I changes the template from typescript-axios to typescript-fetch and it generates correctly

should show decimal when showDecimal is set to true in toCurrencyOption

Is your feature request related to a problem? Please describe.
for now, when setting showDecimal: true, currency is displayed without decimal. this is confusing.

Describe the solution you'd like
show decimal when showDecimal: true

Describe alternatives you've considered
rename parameter

Additional context
Add any other context or screenshots about the feature request here.

Set up Docs

Description

Set up a project and configure it with Github Pages. The project should have the following:

  • A description of what it does
  • Arguments and returned value
    • Name
    • Type
    • Description
  • Example code snippets

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.