diff --git a/README.md b/README.md index d98c163a3b36eb522b113f83cb12664886562cba..a9ae336d174999ce85877caf9512e65f6e42a07e 100644 --- a/README.md +++ b/README.md @@ -1,222 +1,17 @@ -# pharma-v1 +# FAIR-v1 -## Example usage -Create a new Vue project -```bash -vue create testrmaidra-components ``` -Install additional dependencies - -```bash -npm install --save-dev stylus -npm install --save-dev stylus-loader -npm install --save vuetify -npm install --save vuex -npm install --save vue-i18n -npm install --save pharma-v1 -``` - -main.js - -```js -import Vue from "vue"; -import "./plugins/vuetify"; -import Vuetify from "vuetify"; -import VueI18n from "vue-i18n"; -import store from "pharma-v1/src/store"; -import eng from "pharma-v1/src/i18n/eng"; -import deu from "pharma-v1/src/i18n/deu"; -import ita from "pharma-v1/src/i18n/ita"; -import PharmaVueComponents from "pharma-v1"; -import App from "./App.vue"; - -Vue.config.productionTip = false; - -Vue.use(Vuetify); -Vue.use(VueI18n); -Vue.use(PharmaVueComponents); - -const messages = { eng, deu, ita }; -const i18n = new VueI18n({ - locale: "en", - messages: messages -}); - -new Vue({ - store, - i18n, - render: h => h(App) -}).$mount("#app"); -``` - -Add material icons and font to public/index.html - -```html -<link - rel="stylesheet" - href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900" -/> -<link - rel="stylesheet" - href="https://fonts.googleapis.com/css?family=Material+Icons" -/> -``` - -Create src/plugins/vuetify.js - -``` -import Vue from 'vue' -import Vuetify from 'vuetify/lib' -import 'vuetify/src/stylus/app.styl' - -Vue.use(Vuetify, { - iconfont: 'md', -}) -``` - -Copy the template of App.vue from pharma-v1 library, in the template remove `{{version}}` from heading, as for the js part, use this js instead: - -```js -import fields from "pharma-v1/src/utils/fields"; - -export default { - name: "app", - computed: { - user: function() { - return this.$store.state.user.lastname - ? this.$store.state.user.firstname + - " " + - this.$store.state.user.lastname - : null; - } - }, - data() { - return { - alerts: [], - window: 0, - loadedform: {}, - form: { - sections: [ - { - title: "General metadata", - id: 1, - fields: [] - }, - { - title: "Digitized object", - type: "phaidra:DigitizedObject", - id: 2, - fields: [] - }, - { - title: "Subject", - type: "phaidra:Subject", - id: 3, - multiplicable: true, - fields: [] - } - ] - }, - pid: "", - solrbaseurl: "https://app01.cc.univie.ac.at:8983/solr/phaidra_sandbox", - apibaseurl: "https://services.phaidra-sandbox.univie.ac.at/api", - credentials: { - username: "", - password: "" - }, - contentmodel: "unknown", - contentmodels: [ - { text: "Data", value: "unknown" }, - { text: "Picture", value: "picture" } - ], - psvis: true - }; - }, - methods: { - loadDisplay: function() { - this.$refs.display.loadMetadata(this.pid); - }, - loadEdit: function() { - this.$refs.edit.loadMetadata(this.pid); - }, - login: function() { - this.$store.dispatch("login", this.credentials); - }, - logout: function() { - this.$store.dispatch("logout"); - }, - objectCreated: function(event) { - alert("Object " + event + " created"); - }, - objectSaved: function(event) { - alert("Metadata for object " + event + " saved"); - }, - toggleVisibility: function() { - this.psvis = !this.psvis; - }, - dismiss: function(alert) { - this.$store.commit("clearAlert", alert); - } - }, - mounted: function() { - this.$store.commit("setInstanceApi", this.apibaseurl); - this.$store.commit("setInstanceSolr", this.solrbaseurl); - - this.form.sections[0].fields.push(fields.getField("file")); - this.form.sections[0].fields.push(fields.getField("resource-type")); - this.form.sections[0].fields.push(fields.getField("title")); - this.form.sections[0].fields.push(fields.getField("language")); - this.form.sections[0].fields.push(fields.getField("description")); - this.form.sections[0].fields.push(fields.getField("keyword")); - this.form.sections[0].fields.push(fields.getField("project")); - this.form.sections[0].fields.push(fields.getField("funder")); - this.form.sections[0].fields.push(fields.getField("role")); - this.form.sections[0].fields.push(fields.getField("license")); - - this.form.sections[1].fields.push(fields.getField("title")); - this.form.sections[1].fields.push(fields.getField("description")); - this.form.sections[1].fields.push(fields.getField("inscription")); - this.form.sections[1].fields.push(fields.getField("height")); - this.form.sections[1].fields.push(fields.getField("shelf-mark")); - this.form.sections[1].fields.push( - fields.getField("technique-getty-aat-select") - ); - this.form.sections[1].fields.push(fields.getField("digitization-note")); - this.form.sections[1].fields.push(fields.getField("reproduction-note")); - - this.form.sections[2].fields.push(fields.getField("title")); - this.form.sections[2].fields.push(fields.getField("description")); - this.form.sections[2].fields.push(fields.getField("temporal-coverage")); - this.form.sections[2].fields.push(fields.getField("spatial-text")); - } -}; -``` +Issue -If you are using a store in your app, you need to add the necessary pharma-v1 store modules to your store: -store/index.js +There are still some bugs in diplay. Bioassay not fully working. -```js -import vocabulary from 'pharma-v1/src/store/modules/vocabulary' -... -export default new Vuex.Store({ -... - modules: { -... , - vocabulary - } -}) -``` +TO DOs: Edit, templates, search -Issue - -``` -npm run serve ``` -or use 'vue ui' to start your application. # dev diff --git a/package-lock.json b/package-lock.json index 4c7d4b0c0a26c5060ede383834ba79b04cedf45c..53ef6545c6a4af7690456fe427581fabbc86502b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "pharma-0.1.0", + "name": "FAIR-0.1.0", "version": "0.1.0", "lockfileVersion": 1, "requires": true, @@ -12073,4 +12073,4 @@ } } } -} +} \ No newline at end of file diff --git a/package.bak.json b/package.bak.json index d7ecc9cf92904a36ff684beea631b6486b13da71..f00e4e7e8bfbf1a455947b1a353209e4776c513d 100644 --- a/package.bak.json +++ b/package.bak.json @@ -1,5 +1,5 @@ { - "name": "pharma-v1", + "name": "FAIR-v1", "version": "1.0.0", "scripts": { "serve": "vue-cli-service serve --open ", @@ -9,7 +9,13 @@ "svg": "vsvg -s ./src/svg-icons -t ./src/compiled-icons" }, "main": "./dist/pharma-v1.common.js", - "files": ["dist/*", "src/*", "public/*", "*.json", "*.js"], + "files": [ + "dist/*", + "src/*", + "public/*", + "*.json", + "*.js" + ], "dependencies": { "base-64": "^0.1.0", "moment": "^2.24.0", @@ -40,7 +46,10 @@ "env": { "node": true }, - "extends": ["plugin:vue/essential", "eslint:recommended"], + "extends": [ + "plugin:vue/essential", + "eslint:recommended" + ], "rules": { "vue/no-use-v-if-with-v-for": 0 }, @@ -53,10 +62,14 @@ "autoprefixer": {} } }, - "browserslist": ["> 1%", "last 2 versions", "not ie <= 8"], + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ], "license": "Apache-2.0", "repository": { "type": "git", "url": "git://ghe.phaidra.org/isah/pharma-v1.git" } -} +} \ No newline at end of file diff --git a/package.json b/package.json index f919a651a10a7ba2cf497dd1d34e883252ff7351..31c65f330e25e38109eefbad6ebc78f3f0ac8b23 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "pharma-0.1.0", + "name": "FAIR-0.1.0", "version": "0.1.0", "scripts": { "serve": "vue-cli-service serve --open ", @@ -73,6 +73,6 @@ "license": "Apache-2.0", "repository": { "type": "git", - "url": "git://ghe.phaidra.org/isah/pharma-0.1.0.git" + "url": "gitlab.phaidra.org:fairness/FAIR-v1.git" } -} +} \ No newline at end of file