Space Editing Guide - uol-library/spacefinder-ui GitHub Wiki

Spaces can be edited directly by editing the JSON files in the spaces directory of the repository, or they can be edited using a lightweight Content Management System (CMS) which presents the data in an online form. Using the CMS is the recommended method as editing JSON by hand can be error-prone.

Setup

First you will need to have a GitHub account - set one up here if you don't have one yet. Please enable 2-factor authentication and fill out your profile details.

Create a new Issue in the repository asking to be added as a contributor. When your request has been approved, you will be sent an invite via email which you will need to respond to.

Accessing the CMS

The CMS is located in the admin directory of the site at https://spacefinder.leeds.ac.uk/admin/. You should first see the "Login with GitHub" button - when you have authenticated with the system you will be presented with the main CMS page.

Screenshot of the initial Netlify CMS screen

This shows a list of spaces which you can edit. Clicking on one of them will take you to the space editing form:

Screenshot of the main editor in Netlify CMS

Editing space data

Some of the fields in the form are required, as they are used in the UI for something (like the location and title) - all fields should be completed if possible.

  • The field for the location of the space (the map) is very important and should be entered as accurately as possible.
  • Make sure you enter all relevant filter properties for the space (space type, facilities, noise level, work environment, atmosphere).
  • Add opening hours for the space - 24 hour opening should be entered in the form as from 00:00 to 24:00.

Images for spaces should all be 500px x 280px, in JPEG format, and use a compression of 70 or lower. If you don't have access to an image editor, try https://freetoolonline.com/imagemagick-online.html and use the following parameters (in the "Enter params (optional)" field under the uploaded image name):

-resize 500x280^ -gravity center -extent 500x280 -quality 70

Improving the location data for spaces

Locations should be as accurate as possible to identify individual rooms within buildings. If the room has a single entrance, the location should be set here, and if it has multiple entrances, it should be set to the centre of the room.

If you can enter the what3words location, these can be more accurate - what3words locations are accurate to 3 metre squares. They can be found using a phone app for Android or iPhone or through the what3words website. Although the map location will be used as the primary source, what3words may be used to update the map locations in future.

Deleting spaces and adding new spaces

The CMS cannot be used to add or delete spaces - this must be done either in the GitHub UI or by cloning the repository, making changes and issuing a pull request. When adding a new space, first determine the next ID by looking at the spaces directory of the repository. At the time of writing, the highest numbered file in this directory was 91.json, so the next ID will be 92. Spaces must also have unique slugs - these form part of the URL for a space and are usually based on the name of the space (turned to lower case with spaces replaced by hyphens and special characters swapped).

Making spaces live

Changes in space data are not made live on the site immediately - an additional step is needed to concatenate the data to make it suitable for use by the application. This step is performed using a GitHub action called concat-spacefinder-data. This action is run manually against the main branch, and will fail if there aren't any changes to the space data.

Editing data using git

If you prefer to edit the data in a text editor, or you want to contribute in other ways to the site, you can fork the repository, make the changes and create a pull request to get your changes incorporated. If you intend to make regular contributions in this way, it would be easier to add you as a Collaborator - please create a new Issue if this is the case.