Skip to content

Commit

Permalink
TerriaJS Pin functionality Added feature
Browse files Browse the repository at this point in the history
  • Loading branch information
PplArinModi committed Mar 13, 2024
0 parents commit b16ec99
Show file tree
Hide file tree
Showing 2,186 changed files with 553,349 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"presets": [
[
"@babel/preset-env",
{
"corejs": 3,
"useBuiltIns": "usage"
}
],
["@babel/preset-react", { "runtime": "automatic" }],
["@babel/typescript", { "allowNamespaces": true }]
],
"plugins": [
"@babel/plugin-transform-modules-commonjs",
["@babel/plugin-proposal-decorators", { "legacy": true }],
"@babel/plugin-proposal-class-properties",
"@babel/proposal-object-rest-spread",
"babel-plugin-styled-components",
"@babel/plugin-syntax-dynamic-import",
"babel-plugin-lodash"
],
"assumptions": {
"setPublicClassFields": false
}
}
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[doc/**.md]
# mkdocs requires 4 spaces. With 2 space indents, nested lists do not work
indent_size = 4

[*.scss]
indent_size = 2
133 changes: 133 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
{
"root": true,
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"requireConfigFile": false,
"ecmaVersion": 2019,
"ecmaFeatures": {
"jsx": true,
"modules": true,
"legacyDecorators": true
}
},
"env": {
"browser": true,
"commonjs": true,
"es6": true
},
"ignorePatterns": ["*.scss.d.ts"],
"plugins": ["react", "react-hooks", "@typescript-eslint"],
"globals": {
"process": true
},
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
"react-hooks/exhaustive-deps": "error",
"react/jsx-boolean-value": ["error", "never", { "always": [] }],
"react/no-arrow-function-lifecycle": "error",
"react/no-invalid-html-attribute": "error",
"react/jsx-no-useless-fragment": "error",
"react/jsx-no-constructed-context-values": "error",
"react/jsx-fragments": ["error", "syntax"],
"react/jsx-no-duplicate-props": ["error", { "ignoreCase": true }],
"react/jsx-pascal-case": [
"error",
{
"allowAllCaps": true,
"ignore": []
}
],
"react/no-danger": "warn",
"react/no-did-update-set-state": "error",
"react/no-will-update-set-state": "error",
"react/self-closing-comp": "error",
"react/jsx-no-undef": ["error", { "allowGlobals": true }],

/*Possible Errors */
"no-console": "off",
"no-inner-declarations": [1, "functions"],

/* Best Practices */
"eqeqeq": ["error"],
"no-alert": ["error"],
"no-caller": ["error"],
"no-div-regex": ["error"],
"no-eval": ["error"],
"no-extend-native": ["error"],
"no-fallthrough": 0,
"no-implied-eval": ["error"],
"no-iterator": ["error"],
"no-labels": ["error"],
"no-lone-blocks": ["error"],
"no-loop-func": ["error"],
"no-new-func": ["error"],
"no-new-wrappers": ["error"],
"no-new": ["error"],
"no-octal-escape": ["error"],
"no-proto": ["error"],
"no-return-assign": ["error"],
"no-script-url": ["error"],
"no-sequences": ["error"],
"radix": "error",

/* Strict Mode */
"strict": [0, "global"],

/* Variables */
"no-label-var": 1,
"no-unused-vars": [
1,
{
"vars": "local",
"args": "none"
}
],

"camelcase": [
0,
{
"properties": "always"
}
],
"no-array-constructor": "error",
"no-new-object": 1,
"no-unneeded-ternary": 1 /* ECMAScript 6 */,
"prefer-const": "error",
/* See https://stackoverflow.com/questions/64646248/eslintrc-js-for-react-17-and-jsx-without-import-react/64646593#64646593 */
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off"
},
"overrides": [
{
"files": ["**/*.ts", "**/*.tsx"],
"rules": {
// @TODO: revise these rules
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}
],
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/no-loss-of-precision": "warn",
"@typescript-eslint/no-unsafe-declaration-merging": "warn",
"react-hooks/exhaustive-deps": "warn",
"react/prop-types": "warn"
}
}
]
}
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CHANGES.md merge=union
*.enc binary
16 changes: 16 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
### What this PR does

Fixes #<insert issue number here if relevant>

This is a description of what I've done in this PR, especially explaining choices made to make the reviewer's job easier. If I don't replace this paragraph with an actual description, my PR will probably be ignored.

### Test me

How should reviewers test this? (Hint: If you want to provide a test catalog item, [create a Gist](https://gist.github.com/) of its catalog JSON, add its url and your branch name to this url: `http://ci.terria.io/<branch name>/#clean&<raw url of your gist>` , and then paste that in the body of this PR)

### Checklist

- [ ] There are unit tests to verify my changes are correct or unit tests aren't applicable (if so, write quick reason why unit tests don't exist)
- [ ] I've updated relevant documentation in `doc/`.
- [ ] I've updated CHANGES.md with what I changed.
- [ ] I've provided instructions in the PR description on how to test this PR.
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This is a basic workflow to help you get started with Actions

name: CI
env:
NODE_OPTIONS: "--max_old_space_size=4096"

# Controls when the action will run.
on: [push, pull_request]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- run: npm install -g yarn@^1.19.0 && yarn install

- name: Check formatting with prettier
run: yarn prettier-check

- name: Build TerriaJS tests
run: yarn gulp lint release -- --continue
env:
NODE_OPTIONS: --max_old_space_size=4096

- name: Run tests using xvfb
uses: GabrielBB/xvfb-action@v1
with:
run: yarn gulp test-firefox
36 changes: 36 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Deploy TerriaMap

on: push

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- uses: google-github-actions/[email protected]
with:
service_account_key: ${{ secrets.GCP_CREDENTIALS }}
export_default_credentials: true
- uses: google-github-actions/[email protected]
with:
cluster_name: ${{ secrets.GKE_CLUSTER }}
location: ${{ secrets.GKE_LOCATION }}
- uses: azure/[email protected]
with:
version: "v3.3.1"
- run: bash ./buildprocess/ci-deploy.sh
env:
NODE_OPTIONS: --max_old_space_size=4096
SHARE_S3_ACCESS_KEY_ID: ${{ secrets.SHARE_S3_ACCESS_KEY_ID }}
SHARE_S3_SECRET_ACCESS_KEY: ${{ secrets.SHARE_S3_SECRET_ACCESS_KEY }}
FEEDBACK_GITHUB_TOKEN: ${{ secrets.FEEDBACK_GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Upload new yarn.lock file (as it may change after `sync-dependencies`)
- uses: actions/upload-artifact@v3
if: always()
with:
name: yarn.lock
path: yarn.lock
34 changes: 34 additions & 0 deletions .github/workflows/find-region-mapping-alias-duplicates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Find region mapping alias duplicates

# Run when regionMapping.json file or is updated
on:
push:
paths:
- "wwwroot/data/regionMapping.json"
- "buildprocess/find-region-mapping-alias-duplicates.js"
pull_request:
paths:
- "wwwroot/data/regionMapping.json"
- "buildprocess/find-region-mapping-alias-duplicates.js"

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job
find-alias-duplicates:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Check out only 2 files
# Use without cone mode as no git operations are executed past checkout
- uses: actions/checkout@v4
with:
sparse-checkout: |
wwwroot/data/regionMapping.json
buildprocess/find-region-mapping-alias-duplicates.js
sparse-checkout-cone-mode: false

- name: Check aliases
run: |
node buildprocess/find-region-mapping-alias-duplicates.js
Loading

0 comments on commit b16ec99

Please sign in to comment.