Skip to content

Commit

Permalink
rough out Vue app
Browse files Browse the repository at this point in the history
  • Loading branch information
chrabyrd committed Jan 3, 2024
1 parent d29b58b commit 39d2fb5
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
*.egg-info
*.egg-info
*.pyc
*.log
*.DS_Store
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import ko from 'knockout';
import { createApp } from 'vue';
import PrimeVue from 'primevue/config';
import RDMApp from '@/App.vue';
import RDMAppTepmlate from 'templates/views/components/plugins/reference-data-manager.htm';

ko.components.register('reference-data-manager', {
viewModel: function() {
const app = createApp(RDMApp);
app.use(PrimeVue);
app.mount('#rdm-mounting-point');
},
template: RDMAppTepmlate,
});
37 changes: 37 additions & 0 deletions arches_rdm/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from arches.app.models import models


from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
("models", "10121_workflowhistory"),
]

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

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

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()

operations = [
migrations.RunPython(add_plugins, remove_plugin),
]
7 changes: 7 additions & 0 deletions arches_rdm/src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<script setup>
import Foo from "@/components/Foo.vue"
</script>

<template>
<Foo />
</template>
7 changes: 7 additions & 0 deletions arches_rdm/src/components/Foo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<script setup>
console.log('hello world!')
</script>

<template>
<h1>Hello World!</h1>
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div id="rdm-mounting-point"></div>
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "arches_rdm",
"version": "0.0.1",
"dependencies": {
"primevue": "^3.35.0"
},
"devDependencies": {
},
Expand Down

0 comments on commit 39d2fb5

Please sign in to comment.