Copyright (C) 2016-2019 The Open Library Foundation
This software is distributed under the terms of the Apache License, Version 2.0. See the file "LICENSE" for more information.
This is a Stripes UI module for finding the location of an item on a map.
-
Load the Stripes platform configuration file into an editor.
code ~/Desktop/folio/ui/platform-complete/stripes.config.js -
Add
@folio/wayfinderand@folio/plugin-find-itemas an entry to themodulessection.modules: { ... '@folio/plugin-find-vendor' : {}, '@folio/vendors' : {}, '@folio/wayfinder': {}, ... }
-
Download
ui-wayfinderto thenode_modules/@foliodirectory and rename the directory.cd ~/Desktop/folio/ui/platform-complete/node_modules/@folio git clone https://github.com/minrva/ui-wayfinder.git mv ui-wayfinder wayfinder
In order for plugin-find-instance to work properly, Instances.js from the inventory module has to be modified.
cp ~/Desktop/folio/ui/platform-complete/node_modules/@folio/wayfinder/artifacts/Instances.js.bak ~/Desktop/folio/ui/platform-complete/node_modules/@folio/inventory/src/Instances.jsA suitable Okapi gateway will need to be running. The Folio testing-backend Vagrant box is one way to quickly deploy an Okapi gateway locally.
Once you have your Okapi instance deployed, you will need to register meta-data about your UI Module.
Stripes CLI is the easiest way to make the appropriate HTTP requests to the Okapi gateway, so we will assume you have installed the command line tool.
- After deploying your Okapi gateway, then change to your UI Module root directory.
cd ~/Desktop/folio/ui/platform-complete/node_modules/@folio/wayfinder- Login to the Okapi gateway using the
diku_adminuser and thedikutenant.
stripes okapi login diku_admin --okapi http://localhost:9130 --tenant diku- Generate and add a UI Module Descriptor to the Okapi gateway automatically, based on the permission set found in
package.json.
stripes mod add --okapi http://localhost:9130 --tenant diku- Enable UI Module for
dikutenant.
stripes mod enable --okapi http://localhost:9130 --tenant diku- Assign default permissions for
dikutenant.
stripes perm assign --name module.wayfinder.enabled --okapi http://localhost:9130 --tenant diku --user diku_admin
stripes perm assign --name settings.wayfinder.enabled --okapi http://localhost:9130 --tenant diku --user diku_admin- Logout
stripes okapi logout --okapi http://localhost:9130 --tenant dikuFurther material on adding permissions can be found at Adding new permissions to FOLIO UI modules and Stripes CLI User Guide.
- Deploy the corresponding Okapi services by following mod-wayfinder README.
- Deploy the
platform-complete.cd ~/Desktop/folio/ui/platform-complete yarn start
Read the Stripes Module Developer's Guide.