Migration redesign (#119)

* migration redesign init

* new color picker

* changelog

* added UI language selection

* fix layout issue on recipe editor

* remove git as dependency

* added UI editor for original URL

* CI/CD Tests

* test: fixed migration routes

Co-authored-by: Hayden <hay-kot@pm.me>
This commit is contained in:
Hayden
2021-01-23 19:53:39 -09:00
committed by GitHub
parent 138093d062
commit 079ebd8ee1
32 changed files with 549 additions and 367 deletions

View File

@@ -2,42 +2,27 @@ import { baseURL } from "./api-utils";
import { apiReq } from "./api-utils";
import { store } from "../store/store";
const migrationBase = baseURL + "migration/";
const migrationBase = baseURL + "migrations/";
const migrationURLs = {
upload: migrationBase + "upload/",
delete: (file) => `${migrationBase}${file}/delete/`,
chowdownURL: migrationBase + "chowdown/repo/",
nextcloudAvaiable: migrationBase + "nextcloud/available/",
nextcloudImport: (selection) =>
`${migrationBase}nextcloud/${selection}/import/`,
// New
all: migrationBase,
delete: (folder, file) => `${migrationBase}/${folder}/${file}/delete/`,
import: (folder, file) => `${migrationBase}/${folder}/${file}/import/`,
};
export default {
async migrateChowdown(repoURL) {
let postBody = { url: repoURL };
let response = await apiReq.post(migrationURLs.chowdownURL, postBody);
async getMigrations() {
let response = await apiReq.get(migrationURLs.all);
return response.data;
},
async delete(folder, file) {
let response = await apiReq.delete(migrationURLs.delete(folder, file));
return response.data;
},
async import(folder, file) {
let response = await apiReq.post(migrationURLs.import(folder, file));
store.dispatch("requestRecentRecipes");
return response.data;
},
async getNextcloudImports() {
let response = await apiReq.get(migrationURLs.nextcloudAvaiable);
return response.data;
},
async importNextcloud(selected) {
let response = await apiReq.post(migrationURLs.nextcloudImport(selected));
return response.data;
},
async uploadFile(form_data) {
let response = await apiReq.post(migrationURLs.upload, form_data, {
headers: {
"Content-Type": "multipart/form-data",
},
});
return response.data;
},
async delete(file_folder_name) {
let response = await apiReq.delete(migrationURLs.delete(file_folder_name));
return response.data;
},
};