updated front end controller scripts

This commit is contained in:
Ro 2021-06-24 11:58:55 -07:00
parent e40e566302
commit ebdda2c089
5 changed files with 18 additions and 29 deletions

File diff suppressed because one or more lines are too long

View file

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

View file

@ -4,10 +4,11 @@ import FipamoAdminAPI, {
TASK_PAGE_EDIT,
TASK_PAGE_DELETE
} from "../../libraries/FipamoAdminAPI";
import FipamoUtilityAPI from "../../libraries/FipamoUtilityAPI";
import * as DataEvent from "../events/DataEvent";
import PageActions from "../actions/PageActions";
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 Notfications from "../ui/Notifications";
const notify = new Notfications();
@ -249,7 +250,8 @@ export default class PostEditor {
handleImageUpload(type, files) {
let self = this;
notify.alert("Uploading Image", null);
this.admin
let utils = new FipamoUtilityAPI();
utils
.imageUpload(type, files)
.then((r) => {
if (r.type == DataEvent.POST_IMAGE_ADDED)

View file

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

View file

@ -20,8 +20,6 @@ export const API_SEND_MAIL = "/api/v1/mailer";
export const API_LOGIN = "/api/v1/login";
//** API TASKS **//
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_PUBLISH_SITE = "publishSite";
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_SEND_MAIL = "sendMail";
export const TASK_REINDEX_PAGE = "reIndexPages";
//** API STATUS **//
export const API_ACCESS_GOOD = "apiConnected";
export const API_ACCESS_BAD = "apiNotConnected";
/**
* Fipamo Administration API