0.4.16 • Published 2 years ago

tib-ts-library v0.4.16

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

TIB-teminology-service-library

Installation

Run the following command: npm install tib-ts-library

Update

Run the following command: npm install tib-ts-library@latest


Usage

Importing the components in your project

Config

Important Note: This library uses AJAX call to fetch the data. In order to avoid CORS error by the browser, you need to set the proxy in the package.json of your project for the backend. For instance if the backend is running on the localhost:8000, add this to the package.json

        "proxy": "http://localhost:8000",

Ontology List Component

  • import:

      import OntologyList from 'tib-ts-library/dist/ontologyList';
  • Usage:

    <OntologyList 
        target = "Target_Identifier"
    />

"target" is the identifier that tells the component to fetch the ontology list (https://git.tib.eu/lab-linked-scientific-knowledge/ols-backend-2.0-poc) based on the project. 


for example for getting the list of ontologies for TIB general:

    <OntologyList 
        target = "general"
    />

Currently supported targets:

| Target    | Project   |
| --------------- | ------------- |
|  "general" | TIB General    |
       

Ontology Detail Page Component

For rendering the detail information about an onyology.

    import OntologyPage from 'tib-ts-library/dist/ontologyDetail';

In order to use it, you have to add this to your Routing configuration:

     <Route exact path="/ontologies/:ontologyId" component={OntologyPage} />

Development

Every time you change the source code, you need to do these steps for publishing the new version in to the npm registry:

  • Change version number You need to change the version number each time you want publish. in the package.json

      "version": "X.Y.Z",
  • Build We need to build the project for production before publishing:

      > cd /project_dir/
      > npm run build
  • Login You need to login with your credentials for the https://www.npmjs.com/

      > npm login 
  • Publish

      > npm publish