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/wayfinder
and@folio/plugin-find-item
as an entry to themodules
section.modules: { ... '@folio/plugin-find-vendor' : {}, '@folio/vendors' : {}, '@folio/wayfinder': {}, ... }
-
Download
ui-wayfinder
to thenode_modules/@folio
directory 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.js
A 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_admin
user and thediku
tenant.
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
diku
tenant.
stripes mod enable --okapi http://localhost:9130 --tenant diku
- Assign default permissions for
diku
tenant.
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 diku
Further 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.