Skip to content

Commit

Permalink
feat(spa-collaboration-vue): stash wip
Browse files Browse the repository at this point in the history
  • Loading branch information
odzhychko committed Oct 20, 2023
1 parent 683a18c commit c655f54
Show file tree
Hide file tree
Showing 15 changed files with 626 additions and 15 deletions.
1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ mpsGradlePlugin = "1.7.288.4ea765f"

# modelix
modelixCore = "3.4.0"
mpsModelServerSyncPlugin = "2021.2.145"
mpsModelServerSyncPlugin = "2021.2.157"

# backend 1 / SPA
ktor = "2.3.4"
Expand Down
3 changes: 3 additions & 0 deletions spa-collaboration-vue/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@ module.exports = {
],
rules: {
'vue/multi-word-component-names': 'off',
"vue/valid-v-slot": ["error", {
"allowModifiers": false
}]
},
}
15 changes: 11 additions & 4 deletions spa-collaboration-vue/TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@
* /Users/odzhychko/Documents/arbeit1/modelix/modelix.samples/mps/metamodel-api-ts/package.json
* Set not snapshot version as dependencie for ts-model-api
* Set ts-model-api as peerDependencie

# Visuell/Aufgabe
* Plus an room list/lecture list/tutor list
* In Weekly zeigen
* Edit HOME vue in http://localhost:3000/
* Make title redirect to http://localhost:3000/
* IMPORTANT For demo Document weird syncing behaviour, need to remove and then add binding again (or fix bug)
* Add Icons in Webpage
* Change Favicon of page
* Change Title of page
* Add Name to the varouis list types
* Show loading error in banner
* Reduce maximum widht of data tables
* Implement Table for lectures and tutors
* Resolve bug in references
* Document weird syncing behaviour, need to remove and then add binding again (or fix bug)
* rename collaboration to managment
* /Users/odzhychko/Documents/arbeit1/modelix/modelix.samples/mps/metamodel-api-ts/package.json
* Set not snapshot version as dependencie for ts-model-api
* Set ts-model-api as peerDependencie
32 changes: 32 additions & 0 deletions spa-collaboration-vue/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions spa-collaboration-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"@mdi/font": "7.0.96",
"@modelix/vue-model-api": "^0.0.1-a578470.dirty-SNAPSHOT",
"core-js": "^3.29.0",
"date-fns": "^2.30.0",
"metamodel-api-ts": "file:../mps/metamodel-api-ts/build/packages/metamodel-api-ts-1.0.0.tgz",
"roboto-fontface": "*",
"vue": "^3.2.0",
Expand Down
15 changes: 11 additions & 4 deletions spa-collaboration-vue/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import { useModelClient, useRootNode } from "@modelix/vue-model-api";
import { registerLanguages } from "metamodel-api-ts";
import { N_Module } from "metamodel-api-ts/build/dist/L_org_modelix_model_repositoryconcepts";
import { Ref, computed, provide } from "vue";
import { LOADING_ERROR, MODEL } from "@/InjectionKeys";
import { LOADING_ERROR, MODEL, ROOMS } from "@/InjectionKeys";
import { isOfConcept_RoomList } from "metamodel-api-ts/build/dist/L_University_Schedule";
registerLanguages();
Expand All @@ -34,7 +35,7 @@ const loadingError: Ref<string | null> = computed(() => {
return null;
});
const module = computed(() => {
const model = computed(() => {
if (rootNode.value == null) {
return null;
}
Expand All @@ -43,10 +44,16 @@ const module = computed(() => {
untypedModuleNode,
) as N_Module;
const model = module.models.asArray()[0];
console.log(model)
return model;
});
provide(MODEL, module);
const rooms = computed(() => {
const rootNodes = model.value?.rootNodes.asArray() ?? [];
const roomLists = rootNodes.filter(isOfConcept_RoomList)
return roomLists.flatMap(roomList => roomList.rooms.asArray())
})
provide(MODEL, model);
provide(ROOMS, rooms);
provide(LOADING_ERROR, loadingError);
</script>
2 changes: 2 additions & 0 deletions spa-collaboration-vue/src/InjectionKeys.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { InjectionKey, Ref } from 'vue';
import { N_Model } from 'metamodel-api-ts/build/dist/L_org_modelix_model_repositoryconcepts'
import { N_Room } from 'metamodel-api-ts/build/dist/L_University_Schedule';

export const MODEL: InjectionKey<Readonly<Ref<N_Model | null>>> = Symbol("MODEL")
export const ROOMS: InjectionKey<Readonly<Ref<N_Room[]>>> = Symbol("ROOMS")
export const LOADING_ERROR: InjectionKey<Readonly<Ref<string | null>>> = Symbol("LOADING_ERROR")
Loading

0 comments on commit c655f54

Please sign in to comment.