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

Tree front end #8

Closed
wants to merge 43 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
fe78669
Proof of concept of retrieving concept trees
jacobtylerwalls Feb 29, 2024
20fc31d
Add unit test for concept_trees GET
jacobtylerwalls Mar 1, 2024
14b1afd
Declare arches requirement
jacobtylerwalls Mar 1, 2024
a3db6ac
Get label types
jacobtylerwalls Mar 1, 2024
6116f8d
Use language node as source of truth
jacobtylerwalls Mar 5, 2024
eada2dc
Add iterator()
jacobtylerwalls Mar 6, 2024
0284d72
Move views out of submodule
jacobtylerwalls Mar 6, 2024
be8ab9b
Mount a vue app outside arches
jacobtylerwalls Mar 6, 2024
de3915d
manage.py updateproject
jacobtylerwalls Mar 6, 2024
2f1efcd
Move package.json and add scripts
jacobtylerwalls Mar 6, 2024
b62c899
Add typescript and stub out login
jacobtylerwalls Mar 6, 2024
d0a871b
Add basic login functionality
jacobtylerwalls Mar 7, 2024
76967be
Initial tree UI
jacobtylerwalls Mar 8, 2024
6f97577
Gingerly add some auto-expansion
jacobtylerwalls Mar 8, 2024
672279b
Add icons and search term bolding
jacobtylerwalls Mar 11, 2024
5090c29
Add expand, collapse, language buttons
jacobtylerwalls Mar 12, 2024
c0ae8d7
Add splitter and detail pane
jacobtylerwalls Mar 12, 2024
5c6182e
Add toolbar
jacobtylerwalls Mar 12, 2024
ffe0f2e
Improve filter placeholder
jacobtylerwalls Mar 12, 2024
db24efd
Fix "behind by one" templating issue
jacobtylerwalls Mar 12, 2024
df7955f
Add ScrollTop
jacobtylerwalls Mar 12, 2024
6161702
Add focusing mechanism
jacobtylerwalls Mar 12, 2024
6ab7465
Update concept values
jacobtylerwalls Mar 13, 2024
10c0cc4
Update concept values
jacobtylerwalls Mar 13, 2024
25faafa
Extend node focusing to schemes themselves
jacobtylerwalls Mar 13, 2024
f350674
Improve scrolling
jacobtylerwalls Mar 13, 2024
43f5d84
Improve icons
jacobtylerwalls Mar 13, 2024
d6113b4
Return identifiers
jacobtylerwalls Mar 13, 2024
ef07c08
Guard against missing identifier for concept
jacobtylerwalls Mar 13, 2024
e4759f2
Update tests with identifier nodes
jacobtylerwalls Mar 14, 2024
0b4f446
Improve focusing
jacobtylerwalls Mar 14, 2024
c4fda05
DRY out focusing mechanism
jacobtylerwalls Mar 14, 2024
02a2e38
Fix scheme focusing; improve names
jacobtylerwalls Mar 14, 2024
671b9cd
Display identifer in detail pane
jacobtylerwalls Mar 14, 2024
f552958
Move app to standalone plugin
jacobtylerwalls Mar 14, 2024
5050d76
Add leading slash to URL
jacobtylerwalls Mar 14, 2024
ecbfc85
Remove separate front end readme steps
jacobtylerwalls Mar 14, 2024
46fe533
updates tree filter placeholder
robgaston Mar 15, 2024
a8ec1ff
updates tree filter placeholder
robgaston Mar 15, 2024
1cfc5b4
Remove fontawesome stylesheet
jacobtylerwalls Mar 18, 2024
6d42291
Remove tabindex on Tree (not supported)
jacobtylerwalls Apr 4, 2024
6c96943
Merge pull request #9 from archesproject/tree-as-plugin
robgaston May 21, 2024
bea2144
Merge branch 'retrieve-tree' into tree-front-end
jacobtylerwalls May 21, 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
71 changes: 71 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: CI

on:
# push: -- just run on PRs for now
pull_request:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgis/postgis:13-3.0
env:
POSTGRES_PASSWORD: postgis
POSTGRES_DB: arches
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- name: Check out arches
uses: actions/checkout@v3
with:
repository: archesproject/arches
ref: dev/7.6.x
path: arches

- name: Check out arches_rdm
uses: actions/checkout@v2
with:
path: arches_rdm

- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install arches_rdm
working-directory: arches_rdm
run: |
python -m pip install --upgrade pip
pip install .
echo Project installed

- name: Install arches dev version
working-directory: arches
run: |
python -m pip uninstall arches -y
python -m pip install .
echo Arches dev version installed

- name: Install Java, GDAL, and other system dependencies
run: |
sudo apt update
sudo apt-get install libxml2-dev libpq-dev openjdk-8-jdk libgdal-dev
echo Postgres and ES dependencies installed

- uses: ankane/setup-elasticsearch@v1
with:
elasticsearch-version: 8

- name: Check for missing migrations
working-directory: arches_rdm
run: |
PYTHONPATH="../arches" python manage.py makemigrations --check --settings=arches_rdm.test_settings

- name: Run arches_rdm unit tests
working-directory: arches_rdm
run: |
PYTHONPATH="../arches" python -W default::DeprecationWarning manage.py test --settings=arches_rdm.test_settings
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.egg-info
*.pyc
*.log
*.DS_Store
*.DS_Store
arches_rdm/node_modules
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# rdm
Arches Reference Data Manager Application
# Lingo
Lingo Application (Vocabulary Management)

##### Setup
1.
Expand All @@ -23,7 +23,7 @@ ARCHES_APPLICATIONS = (
4. Add arches_applications to dependencies in package.json
```
"dependencies": {
"arches": "archesproject/arches#dev/7.5.x",
"arches": "archesproject/arches#dev/7.6.x",
"arches_rdm": "archesproject/arches-rdm"
}
```
Expand All @@ -34,7 +34,7 @@ yarn install
6. Add the application urls to the project's `urls.py`
```
urlpatterns = [
path(r'^', include('arches.urls')),
path(r"^", include("arches_rdm.urls")),
path('', include('arches.urls')),
path('', include("arches_rdm.urls")),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
```
16 changes: 16 additions & 0 deletions arches_rdm/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"presets": [
[
"@babel/preset-env"
]
],
"plugins": [
// "@babel/plugin-syntax-dynamic-import",
// "@babel/plugin-proposal-class-properties",
// "@babel/plugin-transform-runtime",
// {
// "regenerator": true,
// "corejs": 3 // or 2; if polyfills needed
// }
]
}
10 changes: 10 additions & 0 deletions arches_rdm/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[production staging]
>5%
last 2 versions
Firefox ESR
not ie < 11

[development]
last 1 chrome version
last 1 firefox version
last 1 edge version
1 change: 1 addition & 0 deletions arches_rdm/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!.eslintrc.js
63 changes: 63 additions & 0 deletions arches_rdm/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
module.exports = {
"extends": [
"eslint:recommended",
'plugin:@typescript-eslint/recommended',
'plugin:vue/vue3-recommended',
],
"root": true,
"env": {
"browser": true,
"es6": true,
"node": true
},
"parser": "vue-eslint-parser",
"parserOptions": {
"ecmaVersion": 11,
"sourceType": "module",
"requireConfigFile": false,
"parser": {
"ts": "@typescript-eslint/parser"
}
},
"globals": {
"define": false,
"require": false,
"window": false,
"console": false,
"history": false,
"location": false,
"Promise": false,
"setTimeout": false,
"URL": false,
"URLSearchParams": false,
"fetch": false
},
"rules": {
"semi": ["error", "always"],
},
"overrides": [
{
"files": [ "*.vue" ],
"rules": {
"vue/html-indent": [2, 4],
}
},
{
"files": [ "*.js" ],
"rules": {
"indent": ["error", 4],
"space-before-function-paren": ["error", "never"],
"no-extra-boolean-cast": 0, // 0=silence, 1=warning, 2=error
// allow async-await
'generator-star-spacing': 'off',
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-unused-vars': [1, {
argsIgnorePattern: '^_'
}],
"camelcase": [1, {"properties": "always"}],
}
}
]
};

3 changes: 3 additions & 0 deletions arches_rdm/.stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "stylelint-config-standard"
}
27 changes: 27 additions & 0 deletions arches_rdm/const.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
CONCEPTS_GRAPH_ID = "bf73e576-4888-11ee-8a8d-11afefc4bff7"
SCHEMES_GRAPH_ID = "56788995-423b-11ee-8a8d-11afefc4bff7"

TOP_CONCEPT_OF_NODE_AND_NODEGROUP = "bf73e5b9-4888-11ee-8a8d-11afefc4bff7"

BROADER_NODE_AND_NODEGROUP = "bf73e5f5-4888-11ee-8a8d-11afefc4bff7"

CONCEPT_NAME_NODEGROUP = "bf73e616-4888-11ee-8a8d-11afefc4bff7"
CONCEPT_NAME_CONTENT_NODE = "bf73e695-4888-11ee-8a8d-11afefc4bff7"
CONCEPT_NAME_TYPE_NODE = "b08eebb4-d44c-11ee-a986-0242ac130005"
CONCEPT_NAME_LANGUAGE_NODE = "444b7de6-d44c-11ee-8fe3-0242ac130005"
CONCEPT_IDENTIFIER_NODEGROUP = "bf73e5d1-4888-11ee-8a8d-11afefc4bff7"
CONCEPT_IDENTIFIER_CONTENT_NODE = "bf73e6ba-4888-11ee-8a8d-11afefc4bff7"

SCHEME_NAME_NODEGROUP = "749a27cf-423c-11ee-8a8d-11afefc4bff7"
SCHEME_NAME_CONTENT_NODE = "749a27d5-423c-11ee-8a8d-11afefc4bff7"
SCHEME_NAME_TYPE_NODE = "1330cc4c-d44d-11ee-9261-0242ac130005"
SCHEME_NAME_LANGUAGE_NODE = "2deaf45e-d44d-11ee-b78d-0242ac130005"
SCHEME_IDENTIFIER_NODEGROUP = "8e34b47f-423c-11ee-8a8d-11afefc4bff7"
SCHEME_IDENTIFIER_CONTENT_NODE = "8e34b483-423c-11ee-8a8d-11afefc4bff7"

PREF_LABEL_VALUE_ID = "3b8a03f1-9047-48e4-9ca0-b3fe887f6f9d"
ALT_LABEL_VALUE_ID = "c02f97c5-da16-4ff0-864a-92c34da84e38"

# Old RDM concepts, values
LANGUAGE_CONCEPT_ID = "845cc417-ef77-4582-9271-ffba5e4cabc9"
ENGLISH_VALUE_ID = "de978fd0-2819-4855-8858-8c089780f32c"
43 changes: 43 additions & 0 deletions arches_rdm/gettext.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

module.exports = {
input: {
path: "./src", // only files in this directory are considered for extraction
include: ["**/*.vue"], // glob patterns to select files for extraction
exclude: [], // glob patterns to exclude files from extraction
jsExtractorOpts:[ // custom extractor keyword. default empty.
{
keyword: "__", // only extractor default keyword such as $gettext,use keyword to custom
options: { // see https://github.com/lukasgeiter/gettext-extractor
content: {
replaceNewLines: "\n",
},
arguments: {
text: 0,
},
},
},
{
keyword: "_n", // $ngettext
options: {
content: {
replaceNewLines: "\n",
},
arguments: {
text: 0,
textPlural: 1,
},
},
},
],
compileTemplate: false, // do not compile <template> tag when its lang is not html
},
output: {
path: "./locale", // output path of all created files
potPath: "./messages.pot", // relative to output.path, so by default "./src/language/messages.pot"
jsonPath: "./", // relative to output.path, so by default "./src/language/translations.json"
locales: ["en"],
flat: false, // don't create subdirectories for locales
linguas: false, // create a LINGUAS file
splitJson: true, // create separate json files for each locale. If used, jsonPath must end with a directory, not a file
},
};
File renamed without changes.
28 changes: 12 additions & 16 deletions arches_rdm/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from arches.app.models import models


from django.db import migrations, models
from django.db import migrations
from django.utils.translation import gettext as _


class Migration(migrations.Migration):
Expand All @@ -15,23 +13,21 @@ class Migration(migrations.Migration):
def add_plugins(apps, schema_editor):
Plugin = apps.get_model("models", "Plugin")

Plugin.objects.update_or_create(
Plugin(
pluginid="29321ce0-bd95-4357-a2a5-822e9cb06f70",
name="Reference Data Manager (RDM)",
name=_("Lingo"),
icon="fa fa-code-fork",
component="views/components/plugins/reference-data-manager",
componentname="reference-data-manager",
config={},
slug="reference-data-manager",
sortorder=0
)
component="App.vue",
componentname="lingo",
config={"show": True, "is_standalone": True},
slug="lingo",
sortorder=0,
).save()

def remove_plugin(apps, schema_editor):
Plugin = apps.get_model("models", "Plugin")

for plugin in Plugin.objects.filter(pluginid__in=["29321ce0-bd95-4357-a2a5-822e9cb06f70"]):
plugin.delete()
Plugin.objects.filter(slug="lingo").delete()

operations = [
migrations.RunPython(add_plugins, remove_plugin),
]
]
5 changes: 5 additions & 0 deletions arches_rdm/nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"events": {
"start": "clear"
}
}
28 changes: 28 additions & 0 deletions arches_rdm/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "arches_rdm",
"version": "0.0.1",
"dependencies": {
"arches": "archesproject/arches#dev/7.6.x"
},
"devDependencies": {
"@vue/cli-service": "~5.0.0",
"@vue/cli-plugin-typescript": "~5.0.8",
"arches-dev-dependencies": "archesproject/arches-dev-dependencies#dev/7.6.x"
},
"license": "AGPL-3.0-only",
"scripts": {
"build_development": "yarn eslint:check && yarn ts:check && ./media/node_modules/.bin/cross-env NODE_PATH=./media/node_modules NODE_OPTIONS=--max-old-space-size=2048 ./media/node_modules/.bin/webpack --config webpack/webpack.config.dev.js",
"build_production": "yarn eslint:check && yarn ts:check && ./media/node_modules/.bin/cross-env NODE_PATH=./media/node_modules NODE_OPTIONS=--max-old-space-size=2048 NODE_ENV=production ./media/node_modules/.bin/webpack --config webpack/webpack.config.prod.js",
"build_test": "yarn eslint:check && yarn ts:check && ./media/node_modules/.bin/cross-env NODE_PATH=./media/node_modules NODE_OPTIONS=--max-old-space-size=2048 ./media/node_modules/.bin/webpack --config webpack/webpack.config.dev.js --env test=true",
"eslint:check": "./media/node_modules/.bin/eslint ./src --resolve-plugins-relative-to ./media --ext .vue,.ts --parser ./media/node_modules/vue-eslint-parser/index.js",
"eslint:watch": "./media/node_modules/.bin/nodemon --watch ./src --ext ts,vue --exec yarn --silent eslint:check",
"gettext:extract": "./media/node_modules/.bin/vue-gettext-extract",
"gettext:compile": "./media/node_modules/.bin/vue-gettext-compile",
"ts:check": "./media/node_modules/.bin/vue-tsc --noEmit",
"ts:watch": "./media/node_modules/.bin/vue-tsc --watch --noEmit",
"start": "./media/node_modules/.bin/cross-env NODE_PATH=./media/node_modules NODE_OPTIONS=--max-old-space-size=2048 ./media/node_modules/.bin/webpack serve --config webpack/webpack.config.dev.js",
"serve": "vue-cli-service serve"
},
"nodeModulesPaths": {
}
}
25 changes: 21 additions & 4 deletions arches_rdm/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
<script setup>
import Foo from "@/components/Foo.vue"
<script setup lang="ts">
import { ref } from "vue";

import HomePage from "@/components/HomePage.vue";
import LoginPage from "@/components/LoginPage.vue";

const isAuthenticated = ref(false);
</script>

<template>
<Foo />
</template>
<component
:is="isAuthenticated ? HomePage : LoginPage"
v-model="isAuthenticated"
/>
</template>

<style>
body {
margin: 0;
}
#app {
height: 100vh;
}
</style>
Loading
Loading