diff --git a/src/api/repository.js b/src/api/repository.js index 2859c164b9b211cf9bbc0903235e4a511e649b8a..741b68f5c18a9f2c2d9df486603d9e1bc497cf1f 100644 --- a/src/api/repository.js +++ b/src/api/repository.js @@ -1,11 +1,6 @@ import axios from 'axios' import { unique } from '.' -// List or search available repositories for given credentials -export const listAvailableRepositories = unique( - async (credential, search = null) => (await axios.get(`/process/repos/search/${credential}/`, { params: { search } })).data -) - // List repositories imported on Arkindex export const listRepositories = unique(async params => (await axios.get('/process/repos/', { params })).data) diff --git a/src/components/Process/Status/Status.vue b/src/components/Process/Status/Status.vue index 0b33cb8a944e9c2d9ab89d8d5a71c4a7bcdc14bd..c962c4482cb191c314dfc6fcc49d02bdd457bc8e 100644 --- a/src/components/Process/Status/Status.vue +++ b/src/components/Process/Status/Status.vue @@ -14,11 +14,6 @@ <div class="column"> <strong>Mode</strong><br />{{ processMode }} </div> - <div class="column" v-if="process.revision"> - <strong>Revision</strong><br /> - <a :href="process.revision.commit_url" target="_blank"><samp>{{ process.revision.hash.substr(0, 8) }}</samp></a> - {{ process.revision.message }} · <small>{{ process.revision.author }}</small><br /> - </div> <div class="column" v-if="process.farm"> <strong>Farm</strong><br />{{ process.farm.name }} </div> diff --git a/src/config.ts b/src/config.ts index af597d0248648a1520e296a153638b74347298c2..f5fb10ccef328587647122ca34f6fbc25f5e4e93 100644 --- a/src/config.ts +++ b/src/config.ts @@ -165,7 +165,6 @@ export const PROCESS_FINAL_STATES: Array<keyof typeof PROCESS_STATES> = ['comple export const PROCESS_MODES = { files: 'Files', - repository: 'Git', iiif: 'IIIF', workers: 'Workers', template: 'Template', diff --git a/src/store/repos.js b/src/store/repos.js index 9eb99af40036aac07ba5f8cdcfd700bce407fd4d..e24317eeff30bb44097c44ef7deafa7daf48d207 100644 --- a/src/store/repos.js +++ b/src/store/repos.js @@ -1,13 +1,10 @@ -import { clone, assign } from 'lodash' +import { assign } from 'lodash' import * as api from '@/api' -import { errorParser } from '@/helpers' import { useWorkerStore } from '@/stores' export const initialState = () => ({ // { [repoId]: repo } - repositories: {}, - // Available but not yet imported repositories (from user credentials) - available: null + repositories: {} }) export const mutations = { @@ -20,9 +17,6 @@ export const mutations = { removeRepo (state, id) { delete state.repositories[id] }, - setAvailable (state, available) { - state.available = clone(available) - }, reset (state) { assign(state, initialState()) } @@ -49,15 +43,6 @@ export const actions = { return data }, - async listAvailable ({ commit }, { credential, search = null }) { - try { - commit('setAvailable', await api.listAvailableRepositories(credential, search)) - } catch (err) { - commit('setAvailable', null) - commit('notifications/notify', { type: 'error', text: errorParser(err) }, { root: true }) - } - }, - async delete ({ commit }, id) { const data = await api.deleteRepository(id) commit('removeRepo', id) diff --git a/tests/unit/samples.js b/tests/unit/samples.js index 4245fb1f069a17768dfec6483a62dfd5eaf226e2..b04af15a70adf27b01523bd33e3f7875bdeade65 100644 --- a/tests/unit/samples.js +++ b/tests/unit/samples.js @@ -224,14 +224,6 @@ export const repoSample = { export const reposSample = makeSampleResults([repoSample]) -export const availableReposSample = makeSampleResults([ - { - id: 'repoid', - url: 'http://repo', - name: 'user / repo' - } -]) - export const providersSample = [ { name: 'GitLabProvider', diff --git a/tests/unit/store/repos.spec.js b/tests/unit/store/repos.spec.js index 2782542ee5beb5ffffc75874a5352f7b22b58f69..6061a4f01ce69391e7bf9015709fd14c0f99cede 100644 --- a/tests/unit/store/repos.spec.js +++ b/tests/unit/store/repos.spec.js @@ -4,7 +4,7 @@ import { initialState, mutations } from '@/store/repos.js' import store from './index.spec.js' import { useWorkerStore } from '@/stores' import { createPinia, setActivePinia } from 'pinia' -import { repoSample, reposSample, availableReposSample } from '../samples.js' +import { repoSample, reposSample } from '../samples.js' import { FakeAxios } from '../testhelpers.js' describe('repos', () => { @@ -29,14 +29,10 @@ describe('repos', () => { assert.deepStrictEqual(state.repositories, {}) }) - it('setAvailable', () => { - const state = initialState() - mutations.setAvailable(state, availableReposSample) - assert.deepStrictEqual(state.available, availableReposSample) - }) - it('reset', () => { - const state = { available: availableReposSample } + const state = { + repositories: { repoid: repoSample } + } mutations.reset(state) assert.deepStrictEqual(state, initialState()) }) @@ -95,55 +91,6 @@ describe('repos', () => { }) }) - describe('listAvailable', () => { - it('lists available repositories', async () => { - mock.onGet('/process/repos/search/credid/').reply(200, availableReposSample) - - await store.dispatch('repos/listAvailable', { credential: 'credid' }) - - assert.deepStrictEqual(store.history, [ - { - action: 'repos/listAvailable', - payload: { credential: 'credid' } - }, - { - mutation: 'repos/setAvailable', - payload: availableReposSample - } - ]) - - assert.deepStrictEqual(store.state.repos, { - repositories: {}, - available: availableReposSample - }) - }) - - it('searches with search terms', async () => { - mock.onGet('/process/repos/search/credid/', { params: { search: 'blah' } }).reply(200, availableReposSample) - - await store.dispatch('repos/listAvailable', { credential: 'credid', search: 'blah' }) - - assert.deepStrictEqual(store.history, [ - { - action: 'repos/listAvailable', - payload: { - credential: 'credid', - search: 'blah' - } - }, - { - mutation: 'repos/setAvailable', - payload: availableReposSample - } - ]) - - assert.deepStrictEqual(store.state.repos, { - repositories: {}, - available: availableReposSample - }) - }) - }) - describe('delete', () => { it('deletes a repo', async () => { mock.onDelete('/process/repos/repoid/').reply(204)