diff --git a/README.md b/README.md index fa2d5666..baa1e161 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ # OpenConector Provides gateway and service bus functionality like mapping, translation and synchronisation of data - diff --git a/src/store/modules/consumer.js b/src/store/modules/consumer.js index dff0fb11..755d31b0 100644 --- a/src/store/modules/consumer.js +++ b/src/store/modules/consumer.js @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ import { defineStore } from 'pinia' import { Consumer } from '../../entities/index.js' import { MissingParameterError, ValidationError } from '../../services/errors/index.js' @@ -11,13 +10,13 @@ export const useConsumerStore = defineStore('consumer', { actions: { setConsumerItem(consumerItem) { this.consumerItem = consumerItem && new Consumer(consumerItem) - console.log('Active consumer item set to ' + consumerItem) + console.info('Active consumer item set to ' + consumerItem) }, setConsumerList(consumerList) { this.consumerList = consumerList.map( (consumerItem) => new Consumer(consumerItem), ) - console.log('Consumer list set to ' + consumerList.length + ' items') + console.info('Consumer list set to ' + consumerList.length + ' items') }, /* istanbul ignore next */ // ignore this for Jest until moved into a service async refreshConsumerList(search = null) { @@ -59,7 +58,7 @@ export const useConsumerStore = defineStore('consumer', { throw new MissingParameterError('consumerItem') } - console.log('Deleting consumer...') + console.info('Deleting consumer...') const endpoint = `/index.php/apps/openconnector/api/consumers/${this.consumerItem.id}` @@ -90,11 +89,11 @@ export const useConsumerStore = defineStore('consumer', { const validationResult = consumerItem.validate() if (!validationResult.success) { console.error(validationResult.error) - console.log(consumerItem) + console.info(consumerItem) throw new ValidationError(validationResult.error) } - console.log('Saving consumer...') + console.info('Saving consumer...') const isNewConsumer = !consumerItem.id const endpoint = isNewConsumer diff --git a/src/store/modules/consumer.spec.js b/src/store/modules/consumer.spec.js index b7ed0871..30d48d0f 100644 --- a/src/store/modules/consumer.spec.js +++ b/src/store/modules/consumer.spec.js @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ import { setActivePinia, createPinia } from 'pinia' import { useConsumerStore } from './consumer.js' diff --git a/src/store/modules/endpoints.js b/src/store/modules/endpoints.js index a6835462..5a8d4651 100644 --- a/src/store/modules/endpoints.js +++ b/src/store/modules/endpoints.js @@ -1,7 +1,7 @@ -/* eslint-disable no-console */ import { defineStore } from 'pinia' import { Endpoint } from '../../entities/index.js' import { MissingParameterError, ValidationError } from '../../services/errors/index.js' +import { importExportStore } from '../../store/store.js' export const useEndpointStore = defineStore('endpoint', { state: () => ({ @@ -11,13 +11,13 @@ export const useEndpointStore = defineStore('endpoint', { actions: { setEndpointItem(endpointItem) { this.endpointItem = endpointItem && new Endpoint(endpointItem) - console.log('Active endpoint item set to ' + endpointItem) + console.info('Active endpoint item set to ' + endpointItem) }, setEndpointList(endpointList) { this.endpointList = endpointList.map( (endpointItem) => new Endpoint(endpointItem), ) - console.log('Endpoint list set to ' + endpointList.length + ' items') + console.info('Endpoint list set to ' + endpointList.length + ' items') }, /* istanbul ignore next */ // ignore this for Jest until moved into a service async refreshEndpointList(search = null) { @@ -59,7 +59,7 @@ export const useEndpointStore = defineStore('endpoint', { throw new MissingParameterError('endpointItem') } - console.log('Deleting endpoint...') + console.info('Deleting endpoint...') const endpoint = `/index.php/apps/openconnector/api/endpoints/${endpointItem.id}` @@ -88,7 +88,7 @@ export const useEndpointStore = defineStore('endpoint', { throw new ValidationError(validationResult.error) } - console.log('Saving endpoint...') + console.info('Saving endpoint...') const isNewEndpoint = !endpointItem.id const endpoint = isNewEndpoint @@ -117,5 +117,22 @@ export const useEndpointStore = defineStore('endpoint', { return { response, data, entity } }, + // Export an endpoint + exportEndpoint(endpointItem) { + if (!endpointItem) { + throw new Error('No endpoint item to export') + } + importExportStore.exportFile( + endpointItem.id, + 'endpoint', + ) + .then(({ download }) => { + download() + }) + .catch((err) => { + console.error('Error exporting endpoint:', err) + throw err + }) + }, }, }) diff --git a/src/store/modules/endpoints.spec.js b/src/store/modules/endpoints.spec.js index 8b044f02..ce86df45 100644 --- a/src/store/modules/endpoints.spec.js +++ b/src/store/modules/endpoints.spec.js @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ import { setActivePinia, createPinia } from 'pinia' import { useEndpointStore } from './endpoints.js' diff --git a/src/store/modules/importExport.js b/src/store/modules/importExport.js new file mode 100644 index 00000000..f330596b --- /dev/null +++ b/src/store/modules/importExport.js @@ -0,0 +1,49 @@ +import { defineStore } from 'pinia' + +export const useImportExportStore = defineStore( + 'importExport', { + state: () => ({ + exportSource: '', + exportSourceResults: '', + exportSourceError: '', + }), + actions: { + setExportSource(exportSource) { + this.exportSource = exportSource + console.info('Active exportSource set to ' + exportSource) + }, + async exportFile(id, type) { + const apiEndpoint = `/index.php/apps/openconnector/api/export/${type}/${id}` + + if (!id) { + throw Error('Passed id is falsy') + } + const response = await fetch( + apiEndpoint, + { + method: 'GET', + headers: { + Accept: 'application/json', + }, + }, + ) + const filename = response.headers.get('Content-Disposition').split('filename=')[1].replace(/['"]/g, '') + + const blob = await response.blob() + + const download = () => { + const url = window.URL.createObjectURL(new Blob([blob])) + const link = document.createElement('a') + link.href = url + + link.setAttribute('download', `${filename}`) + document.body.appendChild(link) + link.click() + } + + return { response, blob, download } + }, + + }, + }, +) diff --git a/src/store/modules/job.js b/src/store/modules/job.js index f0c5ab40..9524252f 100644 --- a/src/store/modules/job.js +++ b/src/store/modules/job.js @@ -1,6 +1,6 @@ -/* eslint-disable no-console */ import { defineStore } from 'pinia' import { Job } from '../../entities/index.js' +import { importExportStore } from '../../store/store.js' export const useJobStore = defineStore( 'job', { @@ -16,29 +16,29 @@ export const useJobStore = defineStore( actions: { setJobItem(jobItem) { this.jobItem = jobItem && new Job(jobItem) - console.log('Active job item set to ' + jobItem) + console.info('Active job item set to ' + jobItem) }, setJobTest(jobTest) { this.jobTest = jobTest - console.log('Job test set to ' + jobTest) + console.info('Job test set to ' + jobTest) }, setJobRun(jobRun) { this.jobRun = jobRun - console.log('Job run set to ' + jobRun) + console.info('Job run set to ' + jobRun) }, setJobList(jobList) { this.jobList = jobList.map( (jobItem) => new Job(jobItem), ) - console.log('Job list set to ' + jobList.length + ' items') + console.info('Job list set to ' + jobList.length + ' items') }, setJobLogs(jobLogs) { this.jobLogs = jobLogs - console.log('Job logs set to ' + jobLogs.length + ' items') + console.info('Job logs set to ' + jobLogs.length + ' items') }, setJobArgumentKey(jobArgumentKey) { this.jobArgumentKey = jobArgumentKey - console.log('Active job argument key set to ' + jobArgumentKey) + console.info('Active job argument key set to ' + jobArgumentKey) }, /* istanbul ignore next */ // ignore this for Jest until moved into a service async refreshJobList(search = null) { @@ -101,7 +101,7 @@ export const useJobStore = defineStore( throw new Error('No job item to delete') } - console.log('Deleting job...') + console.info('Deleting job...') const endpoint = `/index.php/apps/openconnector/api/jobs/${this.jobItem.id}` @@ -121,7 +121,7 @@ export const useJobStore = defineStore( if (!this.jobItem) { throw new Error('No job item to test') } - console.log('Testing job...') + console.info('Testing job...') const endpoint = `/index.php/apps/openconnector/api/jobs-test/${this.jobItem.id}` @@ -136,7 +136,7 @@ export const useJobStore = defineStore( .then((response) => response.json()) .then((data) => { this.setJobTest(data) - console.log('Job tested') + console.info('Job tested') // Refresh the job list this.refreshJobLogs() }) @@ -151,7 +151,7 @@ export const useJobStore = defineStore( if (!id) { throw new Error('No job item to run') } - console.log('Running job...') + console.info('Running job...') const endpoint = `/index.php/apps/openconnector/api/jobs-test/${id}` @@ -165,7 +165,7 @@ export const useJobStore = defineStore( const data = await response.json() this.setJobRun(data) - console.log('Job run') + console.info('Job run') // Refresh the job list this.refreshJobLogs() @@ -177,7 +177,7 @@ export const useJobStore = defineStore( throw new Error('No job item to save') } - console.log('Saving job...') + console.info('Saving job...') const isNewJob = !jobItem.id const endpoint = isNewJob @@ -206,7 +206,7 @@ export const useJobStore = defineStore( .then((response) => response.json()) .then((data) => { this.setJobItem(data) - console.log('Job saved') + console.info('Job saved') // Refresh the job list return this.refreshJobList() }) @@ -215,6 +215,23 @@ export const useJobStore = defineStore( throw err }) }, + // Export a job + exportJob(jobItem) { + if (!jobItem) { + throw new Error('No job item to export') + } + importExportStore.exportFile( + jobItem.id, + 'job', + ) + .then(({ download }) => { + download() + }) + .catch((err) => { + console.error('Error exporting job:', err) + throw err + }) + }, }, }, ) diff --git a/src/store/modules/job.spec.js b/src/store/modules/job.spec.js index ef955de7..6e9e6af9 100644 --- a/src/store/modules/job.spec.js +++ b/src/store/modules/job.spec.js @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ import { setActivePinia, createPinia } from 'pinia' import { useJobStore } from './job.js' diff --git a/src/store/modules/log.js b/src/store/modules/log.js index 7c26e72a..13a7de02 100644 --- a/src/store/modules/log.js +++ b/src/store/modules/log.js @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ import { defineStore } from 'pinia' import { Log } from '../../entities/index.js' @@ -13,21 +12,21 @@ export const useLogStore = defineStore( actions: { setLogItem(logItem) { this.logItem = logItem && new Log(logItem) - console.log('Active log item set to ' + logItem) + console.info('Active log item set to ' + logItem) }, setLogList(logList) { this.logList = logList.map( (logItem) => new Log(logItem), ) - console.log('Log list set to ' + logList.length + ' items') + console.info('Log list set to ' + logList.length + ' items') }, setViewLogItem(logItem) { this.viewLogItem = logItem - console.log('Active log item set to ' + logItem) + console.info('Active log item set to ' + logItem) }, setActiveLogKey(activeLogKey) { this.activeLogKey = activeLogKey - console.log('Active log key set to ' + activeLogKey) + console.info('Active log key set to ' + activeLogKey) }, /* istanbul ignore next */ // ignore this for Jest until moved into a service async refreshLogList(search = null) { @@ -75,7 +74,7 @@ export const useLogStore = defineStore( throw new Error('No log item to delete') } - console.log('Deleting log...') + console.info('Deleting log...') const endpoint = `/index.php/apps/openconnector/api/logs/${this.logItem.id}` @@ -96,7 +95,7 @@ export const useLogStore = defineStore( throw new Error('No log item to save') } - console.log('Saving log...') + console.info('Saving log...') const isNewLog = !this.logItem.id const endpoint = isNewLog @@ -125,7 +124,7 @@ export const useLogStore = defineStore( .then((response) => response.json()) .then((data) => { this.setLogItem(data) - console.log('Log saved') + console.info('Log saved') // Refresh the log list return this.refreshLogList() }) diff --git a/src/store/modules/log.spec.js b/src/store/modules/log.spec.js index 06deb5ac..f46795c0 100644 --- a/src/store/modules/log.spec.js +++ b/src/store/modules/log.spec.js @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ import { setActivePinia, createPinia } from 'pinia' import { useLogStore } from './log.js' diff --git a/src/store/modules/mapping.js b/src/store/modules/mapping.js index 17b92b85..179ab3f5 100644 --- a/src/store/modules/mapping.js +++ b/src/store/modules/mapping.js @@ -1,6 +1,6 @@ -/* eslint-disable no-console */ import { defineStore } from 'pinia' import { Mapping } from '../../entities/index.js' +import { importExportStore } from '../../store/store.js' export const useMappingStore = defineStore('mapping', { state: () => ({ @@ -13,25 +13,25 @@ export const useMappingStore = defineStore('mapping', { actions: { setMappingItem(mappingItem) { this.mappingItem = mappingItem && new Mapping(mappingItem) - console.log('Active mapping item set to ' + mappingItem) + console.info('Active mapping item set to ' + mappingItem) }, setMappingList(mappingList) { this.mappingList = mappingList.map( (mappingItem) => new Mapping(mappingItem), ) - console.log('Mapping list set to ' + mappingList.length + ' items') + console.info('Mapping list set to ' + mappingList.length + ' items') }, setMappingMappingKey(mappingMappingKey) { this.mappingMappingKey = mappingMappingKey - console.log('Active mapping mapping key set to ' + mappingMappingKey) + console.info('Active mapping mapping key set to ' + mappingMappingKey) }, setMappingCastKey(mappingCastKey) { this.mappingCastKey = mappingCastKey - console.log('Active mapping cast key set to ' + mappingCastKey) + console.info('Active mapping cast key set to ' + mappingCastKey) }, setMappingUnsetKey(mappingUnsetKey) { this.mappingUnsetKey = mappingUnsetKey - console.log('Active mapping unset key set to ' + mappingUnsetKey) + console.info('Active mapping unset key set to ' + mappingUnsetKey) }, /* istanbul ignore next */ // ignore this for Jest until moved into a service async refreshMappingList(search = null) { @@ -73,7 +73,7 @@ export const useMappingStore = defineStore('mapping', { throw new Error('No mapping item to delete') } - console.log('Deleting mapping...') + console.info('Deleting mapping...') const endpoint = `/index.php/apps/openconnector/api/mappings/${this.mappingItem.id}` @@ -94,7 +94,7 @@ export const useMappingStore = defineStore('mapping', { throw new Error('No mapping item to save') } - console.log('Saving mapping...') + console.info('Saving mapping...') const isNewMapping = !mappingItem.id const endpoint = isNewMapping @@ -160,7 +160,7 @@ export const useMappingStore = defineStore('mapping', { mappingTestObject.schema = JSON.parse(mappingTestObject.schema) } - console.log('Testing mapping...') + console.info('Testing mapping...') const response = await fetch( '/index.php/apps/openconnector/api/mappings/test', @@ -186,7 +186,7 @@ export const useMappingStore = defineStore('mapping', { * @return { Promise<{ response: Response, data: object }> } The response and data from the API. */ async getMappingObjects() { - console.log('Fetching mapping objects...') + console.info('Fetching mapping objects...') // Fetch objects related to a mapping from the API endpoint const response = await fetch( @@ -215,7 +215,7 @@ export const useMappingStore = defineStore('mapping', { * @throws Will throw an error if the save operation fails. */ async saveMappingObject(mappingObject) { - console.log('Saving mapping object...') + console.info('Saving mapping object...') // Send the mapping object to the API endpoint to be saved const response = await fetch( @@ -235,5 +235,22 @@ export const useMappingStore = defineStore('mapping', { // Return the response and parsed data return { response, data } }, + // Export a mapping + exportMapping(mappingItem) { + if (!mappingItem) { + throw new Error('No mapping item to export') + } + importExportStore.exportFile( + mappingItem.id, + 'mapping', + ) + .then(({ download }) => { + download() + }) + .catch((err) => { + console.error('Error exporting mapping:', err) + throw err + }) + }, }, }) diff --git a/src/store/modules/mapping.spec.js b/src/store/modules/mapping.spec.js index b77f74b4..67baee25 100644 --- a/src/store/modules/mapping.spec.js +++ b/src/store/modules/mapping.spec.js @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ import { setActivePinia, createPinia } from 'pinia' import { useMappingStore } from './mapping.js' diff --git a/src/store/modules/navigation.js b/src/store/modules/navigation.js index f2fd9d54..c8f832ad 100644 --- a/src/store/modules/navigation.js +++ b/src/store/modules/navigation.js @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ import { defineStore } from 'pinia' export const useNavigationStore = defineStore( @@ -16,19 +15,19 @@ export const useNavigationStore = defineStore( actions: { setSelected(selected) { this.selected = selected - console.log('Active menu item set to ' + selected) + console.info('Active menu item set to ' + selected) }, setSelectedCatalogus(selectedCatalogus) { this.selectedCatalogus = selectedCatalogus - console.log('Active catalogus menu set to ' + selectedCatalogus) + console.info('Active catalogus menu set to ' + selectedCatalogus) }, setModal(modal) { this.modal = modal - console.log('Active modal set to ' + modal) + console.info('Active modal set to ' + modal) }, setDialog(dialog) { this.dialog = dialog - console.log('Active dialog set to ' + dialog) + console.info('Active dialog set to ' + dialog) }, setTransferData(data) { this.transferData = data diff --git a/src/store/modules/navigation.spec.js b/src/store/modules/navigation.spec.js index 73f2e8ff..2a375fb5 100644 --- a/src/store/modules/navigation.spec.js +++ b/src/store/modules/navigation.spec.js @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ import { setActivePinia, createPinia } from 'pinia' import { useNavigationStore } from './navigation.js' diff --git a/src/store/modules/search.js b/src/store/modules/search.js index b039d253..ed3d8eb1 100644 --- a/src/store/modules/search.js +++ b/src/store/modules/search.js @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ import { defineStore } from 'pinia' export const useSearchStore = defineStore( @@ -11,11 +10,11 @@ export const useSearchStore = defineStore( actions: { setSearch(search) { this.search = search - console.log('Active search set to ' + search) + console.info('Active search set to ' + search) }, setSearchResults(searchResults) { this.searchResults = searchResults - console.log('Active search set to ' + searchResults) + console.info('Active search set to ' + searchResults) }, /* istanbul ignore next */ // ignore this for Jest until moved into a service getSearchResults() { @@ -31,7 +30,7 @@ export const useSearchStore = defineStore( (data) => { if (data?.code === 403 && data?.message) { this.searchError = data.message - console.log(this.searchError) + console.info(this.searchError) } else { this.searchError = '' // Clear any previous errors } diff --git a/src/store/modules/search.spec.js b/src/store/modules/search.spec.js index 240ddda6..fac803fb 100644 --- a/src/store/modules/search.spec.js +++ b/src/store/modules/search.spec.js @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ import { createPinia, setActivePinia } from 'pinia' import { useSearchStore } from './search.js' diff --git a/src/store/modules/source.js b/src/store/modules/source.js index 7167d647..83a9a4eb 100644 --- a/src/store/modules/source.js +++ b/src/store/modules/source.js @@ -1,7 +1,6 @@ -/* eslint-disable no-console */ import { defineStore } from 'pinia' import { Source } from '../../entities/index.js' - +import { importExportStore } from '../../store/store.js' export const useSourceStore = defineStore( 'source', { state: () => ({ @@ -15,31 +14,31 @@ export const useSourceStore = defineStore( actions: { setSourceItem(sourceItem) { this.sourceItem = sourceItem && new Source(sourceItem) - console.log('Active source item set to ' + sourceItem) + console.info('Active source item set to ' + sourceItem) this.refreshSourceLogs() }, setSourceTest(sourceTest) { this.sourceTest = sourceTest - console.log('Source test set to ' + sourceTest) + console.info('Source test set to ' + sourceTest) }, setSourceList(sourceList) { this.sourceList = sourceList.map( (sourceItem) => new Source(sourceItem), ) - console.log('Source list set to ' + sourceList.length + ' items') + console.info('Source list set to ' + sourceList.length + ' items') }, setSourceLog(sourceLog) { this.sourceLog = sourceLog - console.log('Source log set') + console.info('Source log set') }, setSourceLogs(sourceLogs) { this.sourceLogs = sourceLogs - console.log('Source logs set to ' + sourceLogs.length + ' items') + console.info('Source logs set to ' + sourceLogs.length + ' items') }, setSourceConfigurationKey(sourceConfigurationKey) { this.sourceConfigurationKey = sourceConfigurationKey - console.log('Source configuration key set to ' + sourceConfigurationKey) + console.info('Source configuration key set to ' + sourceConfigurationKey) }, /** * Refreshes the source list by fetching data from the API. @@ -104,7 +103,7 @@ export const useSourceStore = defineStore( throw new Error('No source item to delete') } - console.log('Deleting source...') + console.info('Deleting source...') const endpoint = `/index.php/apps/openconnector/api/sources/${this.sourceItem.id}` @@ -128,7 +127,7 @@ export const useSourceStore = defineStore( throw new Error('No testobject to test') } - console.log('Testing source...') + console.info('Testing source...') const endpoint = `/index.php/apps/openconnector/api/source-test/${this.sourceItem.id}` @@ -142,7 +141,7 @@ export const useSourceStore = defineStore( .then((response) => response.json()) .then((data) => { this.setSourceTest(data) - console.log('Source tested') + console.info('Source tested') // Refresh the source list this.refreshSourceLogs() }) @@ -158,7 +157,7 @@ export const useSourceStore = defineStore( throw new Error('No source item to save') } - console.log('Saving source...') + console.info('Saving source...') const isNewSource = !sourceItem.id const endpoint = isNewSource @@ -191,7 +190,7 @@ export const useSourceStore = defineStore( .then((response) => response.json()) .then((data) => { this.setSourceItem(data) - console.log('Source saved') + console.info('Source saved') // Refresh the source list return this.refreshSourceList() }) @@ -200,6 +199,23 @@ export const useSourceStore = defineStore( throw err }) }, + // Export a source + exportSource(sourceItem) { + if (!sourceItem) { + throw new Error('No source item to export') + } + importExportStore.exportFile( + sourceItem.id, + 'source', + ) + .then(({ download }) => { + download() + }) + .catch((err) => { + console.error('Error exporting source:', err) + throw err + }) + }, }, }, ) diff --git a/src/store/modules/source.spec.js b/src/store/modules/source.spec.js index d355f88c..7811b908 100644 --- a/src/store/modules/source.spec.js +++ b/src/store/modules/source.spec.js @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ import { setActivePinia, createPinia } from 'pinia' import { useSourceStore } from './source.js' diff --git a/src/store/modules/synchronization.js b/src/store/modules/synchronization.js index afa03f09..3999a080 100644 --- a/src/store/modules/synchronization.js +++ b/src/store/modules/synchronization.js @@ -1,5 +1,6 @@ import { defineStore } from 'pinia' import { Synchronization } from '../../entities/index.js' +import { importExportStore } from '../../store/store.js' export const useSynchronizationStore = defineStore('synchronization', { state: () => ({ @@ -237,5 +238,22 @@ export const useSynchronizationStore = defineStore('synchronization', { return { response, data } }, + // Export a synchronization + exportSynchronization(synchronizationItem) { + if (!synchronizationItem) { + throw new Error('No synchronization item to export') + } + importExportStore.exportFile( + synchronizationItem.id, + 'synchronization', + ) + .then(({ download }) => { + download() + }) + .catch((err) => { + console.error('Error exporting synchronization:', err) + throw err + }) + }, }, }) diff --git a/src/store/modules/synchronization.spec.js b/src/store/modules/synchronization.spec.js index 2fd988cc..ba422947 100644 --- a/src/store/modules/synchronization.spec.js +++ b/src/store/modules/synchronization.spec.js @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ import { setActivePinia, createPinia } from 'pinia' import { useSynchronizationStore } from './synchronization.js' diff --git a/src/store/modules/webhooks.js b/src/store/modules/webhooks.js index 3ce9c523..c1b7c044 100644 --- a/src/store/modules/webhooks.js +++ b/src/store/modules/webhooks.js @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ import { defineStore } from 'pinia' import { Webhook } from '../../entities/index.js' @@ -11,13 +10,13 @@ export const useWebhookStore = defineStore( actions: { setWebhookItem(webhookItem) { this.webhookItem = webhookItem && new Webhook(webhookItem) - console.log('Active webhook item set to ' + webhookItem) + console.info('Active webhook item set to ' + webhookItem) }, setWebhookList(webhookList) { this.webhookList = webhookList.map( (webhookItem) => new Webhook(webhookItem), ) - console.log('Webhook list set to ' + webhookList.length + ' items') + console.info('Webhook list set to ' + webhookList.length + ' items') }, /* istanbul ignore next */ // ignore this for Jest until moved into a service async refreshWebhookList(search = null) { @@ -65,7 +64,7 @@ export const useWebhookStore = defineStore( throw new Error('No webhook item to delete') } - console.log('Deleting webhook...') + console.info('Deleting webhook...') const endpoint = `/index.php/apps/openconnector/api/webhooks/${this.webhookItem.id}` @@ -86,7 +85,7 @@ export const useWebhookStore = defineStore( throw new Error('No webhook item to save') } - console.log('Saving webhook...') + console.info('Saving webhook...') const isNewWebhook = !this.webhookItem.id const endpoint = isNewWebhook @@ -115,7 +114,7 @@ export const useWebhookStore = defineStore( .then((response) => response.json()) .then((data) => { this.setWebhookItem(data) - console.log('Webhook saved') + console.info('Webhook saved') // Refresh the webhook list return this.refreshWebhookList() }) diff --git a/src/store/modules/webhooks.spec.js b/src/store/modules/webhooks.spec.js index 8430fca9..2ac904a5 100644 --- a/src/store/modules/webhooks.spec.js +++ b/src/store/modules/webhooks.spec.js @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ import { setActivePinia, createPinia } from 'pinia' import { useWebhookStore } from './webhooks.js' diff --git a/src/store/store.js b/src/store/store.js index 6e3d38df..65fb55e1 100644 --- a/src/store/store.js +++ b/src/store/store.js @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ // The store script handles app wide variables (or state), for the use of these variables and their governing concepts read the design.md import pinia from '../pinia.js' import { useNavigationStore } from './modules/navigation.js' @@ -11,6 +10,7 @@ import { useSynchronizationStore } from './modules/synchronization.js' import { useWebhookStore } from './modules/webhooks.js' import { useEndpointStore } from './modules/endpoints.js' import { useConsumerStore } from './modules/consumer.js' +import { useImportExportStore } from './modules/importExport.js' const navigationStore = useNavigationStore(pinia) const searchStore = useSearchStore(pinia) @@ -22,6 +22,7 @@ const synchronizationStore = useSynchronizationStore(pinia) const webhookStore = useWebhookStore(pinia) const endpointStore = useEndpointStore(pinia) const consumerStore = useConsumerStore(pinia) +const importExportStore = useImportExportStore(pinia) export { // generic @@ -36,4 +37,5 @@ export { webhookStore, endpointStore, consumerStore, + importExportStore, } diff --git a/src/views/Endpoint/EndpointDetails.vue b/src/views/Endpoint/EndpointDetails.vue index 577fa36a..87dc8c56 100644 --- a/src/views/Endpoint/EndpointDetails.vue +++ b/src/views/Endpoint/EndpointDetails.vue @@ -21,6 +21,12 @@ import { endpointStore, navigationStore } from '../../store/store.js' Bewerken + + + Export endpoint + Bewerken + + + Export endpoint + Run - Refresh Logs + + + Export job + Edit + + + Export job + Test + + + Export mapping + Test + + + Export mapping + Add Authentication + + + Export source + Edit + + + Export source + Run + + + Export synchronization + Edit + + + Export synchronization +