diff --git a/.env b/.env index 7ad6586f2ae69b399af257aaf8723ddf77422318..7a5ad00825e8aba8e27e51799ba1ad4b40d58c75 100644 --- a/.env +++ b/.env @@ -1,2 +1,5 @@ VUE_APP_APP_NAME=Zotero Client VUE_APP_URL_PATH=/zotero-vue-client/ +VUE_APP_DEFAULT_USER_GROUP_ID=475425 +VUE_APP_DEFAULT_TYPE=user + diff --git a/README.md b/README.md index 5e2cb21f44c0311d2eb483c2f53a6701ca80694b..bfec3057d143e75a67601c24847756f7129d186b 100644 --- a/README.md +++ b/README.md @@ -23,16 +23,17 @@ yarn lint ## component usage example ``` -<zotero-query-component :default-id="1234" @entrySelected="selectedEntryCallback"/> +<zotero-query-component :default-type="user" :default-id="1234" @entrySelected="selectedEntryCallback"/> ``` -where default-id is a group or user id (https://www.zotero.org/support/dev/web_api/v3/basics) +where default-type is "user" or "group" and default-id is a group or user id (https://www.zotero.org/support/dev/web_api/v3/basics) Another example with custom options : ``` <zotero-query-component - :default-id="1234" + :default-type="user" + :default-id="475425" :options="{ pageLength: 10, editableConfig: false, diff --git a/src/App.vue b/src/App.vue index 42e734c980a6eabebb053f9a3ab1115a9cf50fb3..54a09778527bf0c90c87c97df83e1ec76f7abe23 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,5 +1,5 @@ <template> - <zotero-query-component :default-id="groupOrUserId" @entrySelected="selectedEntry"/> + <zotero-query-component :default-type="resourceType" :default-id="groupOrUserId" @entrySelected="selectedEntry"/> </template> <script> @@ -12,6 +12,7 @@ }, data(){ return { + resourceType: config.RESOURCE_TYPE, groupOrUserId: config.USER_GROUP_ID } }, diff --git a/src/components/ZoteroQueryComponent.vue b/src/components/ZoteroQueryComponent.vue index d1aed273ce1d884a6f307e9132d3bc4177caa18e..6a4474ba589adc050b6677b76a48ef91a11d3a6d 100644 --- a/src/components/ZoteroQueryComponent.vue +++ b/src/components/ZoteroQueryComponent.vue @@ -70,7 +70,7 @@ defaultId : String, defaultType : { type : String, - default : 'group' + default : 'users' }, options : { type: Object, diff --git a/src/config/config.js b/src/config/config.js index 9a73fc015aee499d1a004dc1539e124d50c3f8d3..2ac6462f452411c56079ef589a90816af230ea91 100644 --- a/src/config/config.js +++ b/src/config/config.js @@ -1,4 +1,5 @@ var config = { + RESOURCE_TYPE : process.env.VUE_APP_DEFAULT_TYPE, USER_GROUP_ID: process.env.VUE_APP_DEFAULT_USER_GROUP_ID, API_KEY: process.env.VUE_APP_ZOTERO_API_KEY,