Skip to content

Commit

Permalink
Merge branch 'dev-2.11'
Browse files Browse the repository at this point in the history
  • Loading branch information
laurenwalker committed May 15, 2020
2 parents efe776d + 8dd897b commit 33c4445
Show file tree
Hide file tree
Showing 223 changed files with 2,259 additions and 2,203 deletions.
48 changes: 21 additions & 27 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing to MetacatUI

:tada: First off, thanks for contributing!:tada:
:tada: First off, thanks for contributing! :tada:

- [Types of contributions](#types-of-contributions)
- [Pull Requests](#pull-requests)
Expand All @@ -18,8 +18,9 @@ bug reports, documentation, graphics, and many others. You might consider contr
- Report a bug or request a new feature in our [issue tracker](https://github.com/NCEAS/metacatui/issues)
- Fix a bug and contribute the code with a Pull Request
- Write or edit some documentation
- Develop a screencast tutorial
- Answer questions on our mailing list or Slack team
- Sharing helpful tips or FAQ-type answers to users or future contributors
- Create screenshots or tutorials of features of MetacatUI
- Answer questions on our mailing list or [Slack team](https://slack.dataone.org/)
- ...

MetacatUI is an open source project, and we welcome full
Expand All @@ -38,8 +39,9 @@ In short:
- on your computer, clone your forked copy of the MetacatUI repository
- checkout a development branch and commit your changes
- push your branch to your forked repository, and submit a pull-request
- go through the review process, making changes until your pull-request can be merged
- describe your changes in the issue, and close your issue.
- our team will be notified of your Pull Request and will review your changes
- our team may request changes before we will approve the Pull Request, or we will make them for you
- once the code is reviewed, our team will merge in your changes and you're done!

## Development Workflow

Expand All @@ -58,18 +60,17 @@ create one `dev-x.y` branch for integrated development and testing of the set of
targeting a particular release. Much of the development happens directly on these *dev*
branches, but when needed a separate feature branch can be created to isolate development
on a specific set of capabilities, especially if it may be disruptive to other developers
working on the main dev-* branch.
working on the main `dev-*` branch.

**feature**. Feature branches should be named with a prefix of the `dev` branch
that they are targeting,
**feature**. Feature branches should be named with a prefix of `feature`
and should include a short descriptive label reflecting their purpose. For example,
`dev-2.9-indexing` might be a new feature being developed independently but intended to be merged into the `dev-2.9` branch. If a feature is being developed for an uncertain future
release, the branch should be prefixed with `feature-` and contain a descriptive label.
For example, a `feature-globus_auth` might target some unknown future release.
`feature-new-search` may be a branch name for a feature related to a new search tool.
You may also want to include the release version that you are targeting, such `feature-2.11.2-new-search`, or the branch you are targeting to merge into, such as `feature-dev-2.11-new-search`.
You may also want to include the issue number that describes the feature, such as `feature-#1456-new-search`.

All development branches should be frequently merged with changes from `master` to
ensure that the development branch stays up to date with other features that have
been tested and are awaiting release. Thus, each `dev-*` branch represents an opportunity
been tested and are awaiting release. Thus, each `feature-*` branch represents an opportunity
for integration testing of the set of features intended to work together for a
particular release.

Expand All @@ -81,22 +82,15 @@ particular release.

## Release process

The release process starts with integration testing in a `dev*` branch. Once all
changes that are desired in a release are merged into the `dev` branch, we run
the full set of tests on a clean checkout of the `dev` branch.

Second, create a pull request to merge those changes from the `metacatui/dev-*` branch
to the `metacatui/master` branch. This pull request should be done from the `dev*`
branch within the MetacatUI repository in order to make it simple for others to
review the changes, and to maintain a record of the development branch commits.
This pull request will be reviewed by another developer, and, after issues and
feedback have been resolved, the pull request can be merged into master. This
cycle can be repeated multiple times until all features have been tested and
merged into master. At this point, if all features for the planned release
have been merged to master, then the master branch can be merged to the
`releases` branch, and tagged with the new release tag for that release. At
1. Our release process starts with integration testing in a `dev-*` branch. Once all
changes that are desired in a release are merged into the `dev-` branch, we run
the full set of tests on a clean checkout of the `dev-` branch.
2. After testing, the `dev-` branch is merged to master.
3. Then the master branch can be merged to the `releases` branch, and tagged with
the new version number (e.g. `2.11.2`). At
this point, the tip of the `releases` branch will reflect the new release and
the master branch is ready for work on the next release.
4. Releases can be downloaded from the [Github releases page for the MetacatUI repository](https://github.com/NCEAS/metacatui/releases).

## Testing

Expand All @@ -106,7 +100,7 @@ Any new code developed should include a robust set of unit tests for each public
method, as well as integration tests from new feature sets. Tests should fully
exercise the feature to ensure that it responds correctly to both good data inputs
as well as various classes of corrupt or bad data. All tests should pass before
a `dev` branch is merged to master, and all tests should pass before the `master`
a `dev-` branch is merged to master, and all tests should pass before the `master`
branch is merged to `releases` and tagged for a release.

## Code style
Expand Down
172 changes: 13 additions & 159 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,182 +1,36 @@
## MetacatUI: A client-side web interface for DataONE data repositories

- **Author**: Matthew B. Jones, Chris Jones, Ben Leinfelder, Lauren Walker, Bryce Mecum, Peter Slaughter, Rushiraj Nenuji, Robyn Thiessen-Bock ([NCEAS](http://www.nceas.ucsb.edu))
- **Author**: Matthew B. Jones, Chris Jones, Ben Leinfelder, Lauren Walker, Bryce Mecum, Peter Slaughter, Rushiraj Nenuji, Robyn Thiessen-Bock ([NCEAS](https://www.nceas.ucsb.edu))
- **License**: [Apache 2](http://opensource.org/licenses/Apache-2.0)
- [Package source code on Github](https://github.com/NCEAS/metacatui)
- [**Submit Bugs and feature requests**](https://github.com/NCEAS/metacatui/issues)
- [Task Board](https://waffle.io/NCEAS/metacatui)
- Discussion list: [email protected]
- [**Submit Bugs and feature requests**](https://github.com/NCEAS/metacatui/issues/new/choose)
- Contact us: [email protected]

MetacatUI is a client-side web interface for querying Metacat servers and other servers that implement the DataONE REST API. Currently, it is used as the basis for the [KNB Data Repository](http://knb.ecoinformatics.org), the [NSF Arctic Data Center](https://arcticdata.io/catalog/), the [DataONE federation](https://search.dataone.org), and other repositories.

MetacatUI is an open source, community project. We welcome contributions in many forms, including code, graphics, documentation, bug reports, testing, etc. Use the [discussion list](https://github.com/NCEAS/metacatui/issues) to discuss these contributions with project contributors.
MetacatUI is an open source, community project. We [welcome contributions](https://github.com/NCEAS/metacatui/blob/master/CONTRIBUTING.md) in many forms, including code, graphics, documentation, bug reports, testing, etc. Use the [discussion list](https://github.com/NCEAS/metacatui/issues) to discuss these contributions with us.

## Screenshots

The main search screen, as configured for the KNB Repository:
The main search view
![KNB Search](https://raw.githubusercontent.com/NCEAS/metacatui/master/docs/screenshots/metacatui-knb-1200w.png)

A metadata view, as configured for the Arctic Data Center:
The dataset landing page
![Arctic Data Center Metadata View](https://raw.githubusercontent.com/NCEAS/metacatui/master/docs/screenshots/metacatui-arctic-1200w.png)

## Installation

### Using MetacatUI with your own Metacat repository
See the [Metacat documentation](https://github.com/NCEAS/metacat) for full installation instructions. In particular, the [`themes` section](https://github.com/NCEAS/metacat/blob/master/docs/user/metacat/source/themes.rst) of the Metacat documentation gives installation instructions for using MetacatUI with your Metacat repository.

### Using MetacatUI locally with a remote Metacat repository
To run MetacatUI, you will need to first install a web server such as [Apache](https://httpd.apache.org/). The following instructions are for Mac OS X. Apache comes pre-installed on Mac OS X.

#### Step 1. Set up Apache
- Choose a location from which to serve *all* your Apache website files. A good location is `/Users/{username}/Sites`
- Make a subdirectory in `~/Sites` specifically for MetacatUI. The default directory name for MetacatUI is `metacatui`.

```
mkdir ~/Sites/metacatui
```

- Configure Apache to serve files from your `Sites` directory by opening `/etc/apache2/httpd.conf` and changing the `DocumentRoot` pathname. Example:

```
DocumentRoot "/Users/walker/Sites"
<Directory "/Users/walker/Sites/metacatui">
```

#### Step 2. Configure a VirtualHost in Apache for MetacatUI
- First, create a backup of the default httpd-vhosts.conf file:

```
sudo cp /etc/apache2/extra/httpd-vhosts.conf /etc/apache2/extra/httpd-vhosts.conf.bak
```

- Clear out the example VirtualHost configuration if it is there, and add a VirtualHost for the `~/Sites/metacatui` directory (make sure `walker` is replaced with your username):

```
<VirtualHost *:80>
DocumentRoot "/Users/walker/Sites"
ServerName metacatui.localhost
ErrorLog "/private/var/log/apache2/metacatui-error_log"
CustomLog "/private/var/log/apache2/metacatui-access_log" common
# Allow encoded slashes in URLs so encoded identifiers can be sent in MetacatUI URLs
AllowEncodedSlashes On
<Directory "/Users/walker/Sites/metacatui">
FallbackResource /metacatui/index.html
</Directory>
</VirtualHost>
```

The FallbackResource configuration is how MetacatUI is able to use real pathnames like `/data/page/2` for a single-page application.

The FallbackResource directive requires your Apache version to be `2.2.16` and above. If you're using the earlier versions of Apache, you'll require `mod_rewrite` in your configuration. Example:

```
<Directory "/Users/walker/Sites/metacatui">
...
...
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
</Directory>
```

- Create a host name for `metacatui.locahost`. First, open `/etc/hosts`:

```
sudo vi /etc/hosts
```

- Add `metacatui.localhost` to the bottom of the file. **Be careful not to change any other part of this file!**:
-----------------

```
# metacatui local site
127.0.0.1 metacatui.localhost
```

- Save your `/etc/hosts` changes and start (or restart) Apache:

```
sudo apachectl start
```

#### Step 3. Configure MetacatUI
- Download the [latest MetacatUI release .zip file](https://github.com/NCEAS/metacatui/releases) and unzip it
- Open `src/index.html` in a text editor and change the following values:
- Set the `data-theme` to your chosen theme name, e.g. `default`, `knb`, `arctic`.
- Set `data-metacat-context` to match the Metacat directory name of the remote Metacat you will be using. For example, Metacat is installed at https://dev.nceas.ucsb.edu/knb so the `data-metacat-context` would be set to `knb`. Most Metacat installations are at `metacat` since that is the default.
- Optional: Replace `YOUR-GOOGLE-MAPS-API-KEY` with your [Google Maps API key](https://developers.google.com/maps/documentation/javascript/get-api-key) to enable the Google Map features of MetacatUI. If no API key is given, MetacatUI will still work, it just will not include the map features.
- Open `src/js/models/AppModel.js`, or if using a theme other than the default theme, `src/js/themes/{theme name}/models/AppModel.js` and change the following values:
- Set `baseUrl` to the URL where the remote Metacat is (e.g. `https://dev.nceas.ucsb.edu`)
- Set `d1CNBaseUrl` to the URL of the DataONE Coordinating Node that the Metacat Member Node is a part of. (e.g. the Member Node `urn:node:mnTestKNB` is in the `urn:node:cnStage` Coordinating Node, so this attribute would be set to `https://cn-stage.test.dataone.org/`)

- *Note: If you installed MetacatUI somewhere other than the location in step 2 above:* you will need to change the `loader.js` pathname in `index.html` and the `MetacatUI.root` pathname in `loader.js` to the custom location where MetacatUI is located. For example, if you installed MetacatUI at root instead of in a `metacatui` subdirectory, your `loader.js` pathname in `index.html` would be `/loader.js` and `MetacatUI.root` would be `/`.

#### Step 4. Move MetacatUI files to Apache
- Move the MetacatUI application code to the directory we chose in Step 2.

```
cp -rf metacatui-2.0.0/src/* ~/Sites/metacatui/
```

- Open a web browser and navigate to `metacatui.localhost/metacatui` and your MetacatUI application should be ready to go!

### Using MetacatUI locally with a remote DataONE Coordinating Node

#### Step 1.
- Follow Step 1-2 above to configure the Apache web server on your local machine.

#### Step 2. Configure MetacatUI
- Download the [latest MetacatUI release .zip file](https://github.com/NCEAS/metacatui/releases) and unzip it
- Open `src/index.html` in a text editor and change the following values:
- Set the `data-theme` to `dataone`.
- Remove the value of `data-metacat-context` since DataONE CN URLs do not have a metacat directory
- Optional: Replace `YOUR-GOOGLE-MAPS-API-KEY` with your [Google Maps API key](https://developers.google.com/maps/documentation/javascript/get-api-key) to enable the Google Map features of MetacatUI. If no API key is given, MetacatUI will still work, it just will not include the map features.
- Open `src/js/themes/dataone/models/AppModel.js` and change the following values:
- Set `baseUrl` and `d1CNBaseUrl` to the URL where the remote DataONE CN is (e.g. `https://cn-stage.test.dataone.org`)
- Open `src/loader.js` and set the value for the following property:
- Set `MetacatUI.root` based on the location off of its top directory. Example:
- If the source code is located at `~/Sites/metacatui` (as detailed in Step 1), set the `MetacatUI.root = "/metacatui"`.

#### Step 3. Move MetacatUI files to Apache
- Move the MetacatUI application code to the directory we chose in Step 1.

```
cp -rf metacatui-2.0.0/src/* ~/Sites/metacatui/
```

- Open a web browser and navigate to `metacatui.localhost/metacatui` and your MetacatUI application should be ready to go!

## Development

### Running

While developing on MetacatUI, it's necessary to run a web server of some sort in order for the application to work completely.
You can set up a web server such as Apache as described above in the Installation section but MetacatUI also comes with a simple [Express.js](https://expressjs.com) application that uses [node.js](https://nodejs.org).

Pre-requisites:
## Installation

1. [node.js](https://nodejs.org) and `npm`
2. [Express.js](https://expressjs.com): Install with `npm install express`
See the [installation instructions](https://nceas.github.io/metacatui/install) on the MetacatUI website.

Steps:
-----------------

1. Set up `index.html` and `loader.js` as described above in the Installation section.
2. Run the folowing commands in a terminal:
## Documentation

```sh
# from this repository's top level directory
npm install express
node server.js
```
Documentation can be found on the [MetacatUI website](https://nceas.github.io/metacatui).

Now MetacatUI should be serving at http://localhost:3000 and you should be able to visit it in your web browser.
-----------------

## License
```
Expand Down
26 changes: 15 additions & 11 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
# MetacatUI Github Pages website
This folder of the MetacatUI repository houses the files for a simple website about MetacatUI. This website contains:
- Basic information about MetacatUI
- Installation instructions
- Developer documentation for the MetacatUI application

## Building documentation
To build the MetacatUI JSDoc documentation HTML files, run the following commands:
You can view the last published version of the Github site here: https://nceas.github.io/metacatui/

### Step 1. Install jsdoc
```bash
npm install jsdoc
```
## Building Developer documentation
MetacatUI uses [JSDoc](https://github.com/jsdoc/jsdoc) comments to provide inline documentation of classes, methods, and variables. A JSDoc documentation generator will collect all those comments and generate HTML webpages for easier reading and navigation.

### Step 2. Build docs
```bash
cd /path/to/git/datadepot
jsdoc -r -d docs/docs/ -c docs/jsdoc-templates/metacatui/conf.js src/js/
```
The MetacatUI git repository already contains these generated HTML pages in the `docs/docs` directory. However, if you have made changes to the MetacatUI code and documentation and want to update the HTML doc pages, you will need to run the JSDoc generator.

To build a fresh version of the MetacatUI developer docs, simply run the `docs/build.sh` script. This script must be run from the root directory of MetacatUI (`datadepot`) or from the first `docs` directory (`datadepot/docs`)

To view the JSDoc documentation, you can navigate to the file in your browser. E.g. file:///Users/walker/git/datadepot/docs/docs/index.html

Once your changes to the JSDocs are merged into the `master` branch, they will go live on the Github pages site at https://nceas.github.io/metacatui/docs/index.html

## Adding to this site
Feel free to add webpages to the MetacatUI website by adding markdown files to this `docs` directory. Use subdirectories
as much as possible to keep things organized.
Loading

0 comments on commit 33c4445

Please sign in to comment.