Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite application with form plugin system and new design #18

Open
wants to merge 38 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
10af3d7
Prepare ground for stac-manager
danielfdsilva Oct 30, 2024
63c1fb8
Resolve form structure from schema on plugin initialization
danielfdsilva Oct 31, 2024
cc372c7
Set fixed item number on meta plugin field
danielfdsilva Oct 31, 2024
7652181
Fix array widgets
danielfdsilva Oct 31, 2024
f3511e6
Add base theme
danielfdsilva Oct 31, 2024
127cd35
Style array widget
danielfdsilva Nov 5, 2024
c2a0e59
Style widgets
danielfdsilva Nov 5, 2024
8164b6b
Add test plugin
danielfdsilva Nov 5, 2024
3eef972
Improve build
danielfdsilva Nov 12, 2024
f7b4841
Use Formik for plugin form handling
danielfdsilva Nov 12, 2024
c8b52c0
Improve widgets
danielfdsilva Nov 12, 2024
c9e327c
Add core plugin
danielfdsilva Nov 12, 2024
cb321d7
Add json widget
danielfdsilva Nov 13, 2024
cf190af
Fix radio and checkbox fields
danielfdsilva Nov 13, 2024
3770029
Use json widget for whole document edition
danielfdsilva Nov 13, 2024
1f51e13
Include summaries in core plugin
danielfdsilva Nov 13, 2024
1d59c3f
Use FastField for widget rendering and other improvements
danielfdsilva Nov 19, 2024
78e9699
Improve core plugin
danielfdsilva Nov 19, 2024
45bc17f
Add support for additional properties of objects
danielfdsilva Nov 20, 2024
115b215
Fix JSON editor controls not showing up after load
danielfdsilva Nov 20, 2024
c1d5ad5
Create tags widget with React Select
danielfdsilva Nov 21, 2024
989da5e
Rename test plugin to kitchen sink
danielfdsilva Nov 21, 2024
88ef3a6
Rename WidgetTag to WidgetTagger
danielfdsilva Nov 21, 2024
b73bd2c
Improve rendering of Tagger and Select widgets
danielfdsilva Nov 22, 2024
d69ab98
Add item-assets and render extensions plugins
danielfdsilva Nov 22, 2024
f61b5b3
Update app create collection form
danielfdsilva Nov 22, 2024
cea94b8
Add gh-pages workflow
danielfdsilva Nov 22, 2024
97621d9
Add stac api env var
danielfdsilva Nov 22, 2024
3e9a234
Add env and 400 gh file
danielfdsilva Nov 22, 2024
70bcd51
Implement global page structure
danielfdsilva Dec 11, 2024
aae6d58
Add required option to array fields
danielfdsilva Dec 12, 2024
d81b079
Add extension check function
danielfdsilva Dec 12, 2024
b1d988d
Add error message to widgets
danielfdsilva Dec 17, 2024
7a3851a
Add allowOther support to enum string type
danielfdsilva Dec 17, 2024
ac6412a
Add jest test runner
danielfdsilva Dec 17, 2024
93918f9
Add form/json toggle instead of tabs
danielfdsilva Dec 17, 2024
22d8528
Add form validation
danielfdsilva Dec 17, 2024
cfcba5c
Include REACT_APP_STAC_BROWSER env variable
danielfdsilva Dec 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .env.example

This file was deleted.

63 changes: 0 additions & 63 deletions .eslintrc

This file was deleted.

77 changes: 77 additions & 0 deletions .github/workflows/deploy-gh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Deploy Github Pages

on:
push:
branches:
- 'stac-manager'

env:
PUBLIC_URL: ${{ vars.PUBLIC_URL }}
REACT_APP_STAC_API: ${{ vars.REACT_APP_STAC_API }}
REACT_APP_STAC_BROWSER: ${{ vars.REACT_APP_STAC_BROWSER }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'

- name: Cache node_modules
uses: actions/cache@v3
id: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}

- name: Cache dist
uses: actions/cache@v3
id: cache-dist
with:
path: packages/client/dist
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }}

- name: Install
run: npm install

- name: Build
run: npm run all:build

deploy:
runs-on: ubuntu-latest
needs: build

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Restore dist cache
uses: actions/cache@v3
id: cache-dist
with:
path: packages/client/dist
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }}

- name: Copy index as 400 file for github pages
run: cp packages/client/dist/index.html packages/client/dist/400.html

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
clean: true
single-commit: true
folder: packages/client/dist
56 changes: 0 additions & 56 deletions .github/workflows/deploy.yml

This file was deleted.

74 changes: 56 additions & 18 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,61 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
################################################
############### .gitignore ##################
################################################
#
# This file is only relevant if you are using git.
#
# Files which match the splat patterns below will
# be ignored by git. This keeps random crap and
# and sensitive credentials from being uploaded to
# your repository. It allows you to configure your
# app for your machine without accidentally
# committing settings which will smash the local
# settings of other developers on your team.
#
# Some reasonable defaults are included below,
# but, of course, you should modify/extend/prune
# to fit your needs!
################################################

# dependencies
/node_modules
/.pnp
.pnp.js
node_modules

# testing
/coverage

# production
/build
################################################
# Node.js / NPM
#
# Common files generated by Node, NPM, and the
# related ecosystem.
################################################

lib-cov
*.seed
*.log
*.out
*.pid
npm-debug.log
yarn-error.log
.parcel-cache

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
################################################
# Miscellaneous
#
# Common files generated by text editors,
# operating systems, file systems, etc.
################################################

*~
*#
.DS_STORE
.DS_Store
.netbeans
nbproject
.idea
.resources
.node_history
temp
tmp
.tmp
dist
parcel-bundle-reports
.nx
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": true,
"trailingComma": "none",
"singleQuote": true,
"jsxSingleQuote": true,
"printWidth": 80
}
2 changes: 1 addition & 1 deletion LICENSE.md → LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
66 changes: 31 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,59 +1,59 @@
# STAC-Admin :satellite: :page_facing_up:
# STAC-Manager :satellite: :page_facing_up:

## Introduction
The STAC-Admin is a tool designed for managing the values of a STAC (SpatioTemporal Asset Catalog) collection and its items. This interface provides a user-friendly way to modify and update the properties of collections and items within a STAC catalog.
The STAC-Manager is a tool designed for managing the values of a STAC (SpatioTemporal Asset Catalog) collection and its items. This interface provides a user-friendly way to modify and update the properties of collections and items within a STAC catalog.

## Getting Started
## Repository structure

### Prerequisites
- Node
- Yarn
This repository is a monorepo for the STAC-Manager project managed using [lerna](https://lerna.js.org/).
It contains the stac-manager web app along with the form build plugin system that powers it.

### Installation
All the packages are located in the `packages` directory structured as follows:

Install Yarn packages:
```
yarn install
```
- `@stac-manager/client` - STAC-Manager web app.
- `@stac-manager/data-core` - Core functionality of the form builder plugin system.
- `@stac-manager/data-widgets` - Form components to be used by the form builder plugin system, when custom ones are not provided.
- `@stac-manager/data-plugins` - Data plugins for the forms. Each plugin defines how a section of the data structure is displayed and edited.

### Configuration
Before running the application, create a `.env.local` file with the required environment variable:
- `REACT_APP_STAC_API`: Set this to the API endpoint of your STAC server.
## Installation and Usage
The steps below will walk you through setting up your own instance of the project.

:warning: *The current implementation of `stac-admin` works against the APIs provided by `stac-fastapi`'s **Transaction Extension**. Make sure the extension is enabled and the server accepts `PUT` requests.*
### Install Project Dependencies
To set up the development environment for this website, you'll need to install the following on your system:

- [Node](http://nodejs.org/) v20 (To manage multiple node versions we recommend [nvm](https://github.com/creationix/nvm))

### Install Application Dependencies

If you use [`nvm`](https://github.com/creationix/nvm), activate the desired Node version:

For example, you can use the local deployment of [`eoAPI`](https://github.com/developmentseed/eoAPI) with `docker-compose` to get up and running in minutes:
```
cd eoAPI
docker-compose up
nvm install
```

In your `.env.local` file:
Install Node modules:

```
REACT_APP_STAC_API=http://localhost:8081
npm install
```

:bulb: *See `eoAPI` directly for its getting started instruction and getting some sample data ingested.*

### Running the App

### Running the Application
To start the application in development mode:
To run the client app in development mode:
```
yarn start
npm run plugins:build
npm run client:serve
```
Open [http://localhost:3000](http://localhost:3000) to view it in your browser. The page will reload if you make edits, and lint errors will appear in the console.

### Running Tests
Launch the test runner in interactive watch mode:
If you're going to work on the form builder plugin system as well, you may want to run the watch mode on the packages:
```
yarn test
npm run plugins:watch
```
More details can be found in the [Create React App testing documentation](https://facebook.github.io/create-react-app/docs/running-tests).

### Building for Production
Build the app for production:
```
yarn build
npm run all:build
```
This bundles the app in production mode, optimizing the build for performance. The build is minified, and filenames include hashes.

Expand All @@ -62,7 +62,3 @@ Contributions are welcome. Please read [CONTRIBUTING.md](CONTRIBUTING.md) for de

## License
This project is licensed under the MIT license - see the LICENSE.md file for details.

## Learn More
- For more information on React, visit the [React documentation](https://reactjs.org/).
- Check out the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started) to learn more about Create React App.
Loading
Loading