updated front end controller scripts

pull/84/head
Ro 3 years ago
parent e40e566302
commit ebdda2c089

File diff suppressed because one or more lines are too long

@ -93,7 +93,7 @@ export default class Base {
let api = new FipamoUtilityAPI(); let api = new FipamoUtilityAPI();
this.processing = true; this.processing = true;
api api
.restore(setUpForm) .create(setUpForm)
.then((response) => { .then((response) => {
if (response.type === DataEvent.API_INIT_LAME) { if (response.type === DataEvent.API_INIT_LAME) {
self.processing = false; self.processing = false;

@ -4,10 +4,11 @@ import FipamoAdminAPI, {
TASK_PAGE_EDIT, TASK_PAGE_EDIT,
TASK_PAGE_DELETE TASK_PAGE_DELETE
} from "../../libraries/FipamoAdminAPI"; } from "../../libraries/FipamoAdminAPI";
import FipamoUtilityAPI from "../../libraries/FipamoUtilityAPI";
import * as DataEvent from "../events/DataEvent"; import * as DataEvent from "../events/DataEvent";
import PageActions from "../actions/PageActions"; import PageActions from "../actions/PageActions";
import * as EditorEvent from "../events/EditorEvent"; import * as EditorEvent from "../events/EditorEvent";
//import TinyDatePicker from 'tiny-date-picker'; //import TinyDatePicker from 'tiny-date-picker'; TODO: Reactivate for scheduled publishing
import TextEditor from "../ui/TextEditor"; import TextEditor from "../ui/TextEditor";
import Notfications from "../ui/Notifications"; import Notfications from "../ui/Notifications";
const notify = new Notfications(); const notify = new Notfications();
@ -249,7 +250,8 @@ export default class PostEditor {
handleImageUpload(type, files) { handleImageUpload(type, files) {
let self = this; let self = this;
notify.alert("Uploading Image", null); notify.alert("Uploading Image", null);
this.admin let utils = new FipamoUtilityAPI();
utils
.imageUpload(type, files) .imageUpload(type, files)
.then((r) => { .then((r) => {
if (r.type == DataEvent.POST_IMAGE_ADDED) if (r.type == DataEvent.POST_IMAGE_ADDED)

@ -1,5 +1,6 @@
import SettingsActions from "../actions/SettingsActions"; import SettingsActions from "../actions/SettingsActions";
import FipamoAdminAPI from "../../libraries/FipamoAdminAPI"; import FipamoAdminAPI from "../../libraries/FipamoAdminAPI";
import FipamoUtilityAPI from "../../libraries/FipamoUtilityAPI";
import * as DataEvent from "../../../src/com/events/DataEvent"; import * as DataEvent from "../../../src/com/events/DataEvent";
import Mailer from "../actions/Mailer"; import Mailer from "../actions/Mailer";
import Notifications from "../ui/Notifications"; import Notifications from "../ui/Notifications";
@ -88,10 +89,12 @@ export default class SettingsIndex {
for (i = 0, length = mailBtn.length; i < length; i++) { for (i = 0, length = mailBtn.length; i < length; i++) {
mailBtn[i].addEventListener("click", (e) => this.handleMailOptions(e)); mailBtn[i].addEventListener("click", (e) => this.handleMailOptions(e));
} }
//handle backup //handle backup from settings [disabled]
/*
document document
.getElementById("create-backup") .getElementById("create-backup")
.addEventListener("click", (e) => this.handleBackup(e)); .addEventListener("click", (e) => this.handleBackup(e));
*/
/* /*
document document
@ -165,7 +168,8 @@ export default class SettingsIndex {
} }
handleImageUpload(type, files) { handleImageUpload(type, files) {
notify.alert("Uploading Image... ", null); notify.alert("Uploading Image... ", null);
this.admin let utils = new FipamoAdminAPI();
utils
.imageUpload(type, files) .imageUpload(type, files)
.then((r) => { .then((r) => {
if (r.type == DataEvent.AVATAR_UPLOADED) { if (r.type == DataEvent.AVATAR_UPLOADED) {
@ -199,24 +203,6 @@ export default class SettingsIndex {
notify.alert(err, false); notify.alert(err, false);
}); });
} }
handleBackup(e) {
if (this.processing) return;
let self = this;
e.preventDefault();
e.stopPropagation();
notify.alert("Creating backup", null);
this.processing = true;
this.admin
.handleBackup(e.target.id, e.target.files)
.then((r) => {
self.processing = false;
notify.alert(r.message, true);
})
.catch((err) => {
self.processing = false;
notify.alert(err, false);
});
}
handleReindex(e) { handleReindex(e) {
if (this.processing) return; if (this.processing) return;

@ -20,8 +20,6 @@ export const API_SEND_MAIL = "/api/v1/mailer";
export const API_LOGIN = "/api/v1/login"; export const API_LOGIN = "/api/v1/login";
//** API TASKS **// //** API TASKS **//
export const AUTH_STATUS = "getAuthStatus"; export const AUTH_STATUS = "getAuthStatus";
export const API_ACCESS_GOOD = "apiConnected";
export const API_ACCESS_BAD = "apiNotConnected";
export const TASK_SETTINGS_WRITE = "writeSettings"; export const TASK_SETTINGS_WRITE = "writeSettings";
export const TASK_PUBLISH_SITE = "publishSite"; export const TASK_PUBLISH_SITE = "publishSite";
export const TASK_PAGE_CREATE = "createNewPage"; export const TASK_PAGE_CREATE = "createNewPage";
@ -29,6 +27,9 @@ export const TASK_PAGE_EDIT = "editPage";
export const TASK_PAGE_DELETE = "deletePage"; export const TASK_PAGE_DELETE = "deletePage";
export const TASK_SEND_MAIL = "sendMail"; export const TASK_SEND_MAIL = "sendMail";
export const TASK_REINDEX_PAGE = "reIndexPages"; export const TASK_REINDEX_PAGE = "reIndexPages";
//** API STATUS **//
export const API_ACCESS_GOOD = "apiConnected";
export const API_ACCESS_BAD = "apiNotConnected";
/** /**
* Fipamo Administration API * Fipamo Administration API

Loading…
Cancel
Save