Skip to content
Prev Previous commit
Next Next commit
FOUR-20583-A: Tasks Main change to new layout , update with async fsc…
…ripts
  • Loading branch information
hjonathan committed Dec 17, 2024
commit 863d4cfc4ca56a40e3be909d9f990ceed2238554
2 changes: 1 addition & 1 deletion resources/js/components/TreeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default {
},
},
mounted() {
const jsonCrackEmbed = this.$refs.jsonCrackEmbed;
const { jsonCrackEmbed } = this.$refs;
const json = this.jsonData === "" ? "{}" : this.jsonData;
const options = {
theme: "light",
Expand Down
95 changes: 95 additions & 0 deletions resources/js/next/components/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
import { getGlobalVariable } from "../globalVariables";

// Multiselect

const Vue = getGlobalVariable("Vue");

const pmComponents = {
// Components folder
AvatarImage: () => import("../../components/AvatarImage.vue"),
Breadcrumbs: () => import("../../components/Breadcrumbs.vue"),
Confirm: () => import("../../components/Confirm.vue"),
CustomActions: () => import("../../components/CustomActions.vue"),
DetailRow: () => import("../../components/DetailRow.vue"),
FilterBar: () => import("../../components/FilterBar.vue"),
Menu: () => import("../../components/Menu.vue"),
Message: () => import("../../components/Message.vue"),
NavbarProfile: () => import("../../components/NavbarProfile.vue"),
PMBadgesFilters: () => import("../../components/PMBadgesFilters.vue"),
PMDatetimePicker: () => import("../../components/PMDatetimePicker.vue"),
PMDropdownSuggest: () => import("../../components/PMDropdownSuggest.vue"),
PMFloatingButtons: () => import("../../components/PMFloatingButtons.vue"),
PMFormSelectSuggest: () => import("../../components/PMFormSelectSuggest.vue"),
PMMessageResults: () => import("../../components/PMMessageResults.vue"),
PMMessageScreen: () => import("../../components/PMMessageScreen.vue"),
PMPanelWithCustomHeader: () => import("../../components/PMPanelWithCustomHeader.vue"),
PMPopoverConfirmation: () => import("../../components/PMPopoverConfirmation.vue"),
PMSearchBar: () => import("../../components/PMSearchBar.vue"),
PMTable: () => import("../../components/PMTable.vue"),
PMTabs: () => import("../../components/PMTabs.vue"),
Recommendations: () => import("../../components/Recommendations.vue"),
SelectFromApi: () => import("../../components/SelectFromApi.vue"),
SelectLanguage: () => import("../../components/SelectLanguage.vue"),
SelectScreen: () => import("../../components/SelectScreen.vue"),
SelectStatus: () => import("../../components/SelectStatus.vue"),
SelectUser: () => import("../../components/SelectUser.vue"),
SelectUserGroup: () => import("../../components/SelectUserGroup.vue"),
Session: () => import("../../components/Session.vue"),
Sidebaricon: () => import("../../components/Sidebaricon.vue"),
Timeline: () => import("../../components/Timeline.vue"),
TimelineItem: () => import("../../components/TimelineItem.vue"),
TreeView: () => import("../../components/TreeView.vue"),
// Shared components folder
AddToBundle: () => import("../../components/shared/AddToBundle"),
AddToProjectModal: () => import("../../components/shared/AddToProjectModal"),
AssetDependentTreeModal: () => import("../../components/shared/AssetDependentTreeModal.vue"),
AssetTreeModal: () => import("../../components/shared/AssetTreeModal.vue"),
BackendSelect: () => import("../../components/shared/BackendSelect.vue"),
BasicSearch: () => import("../../components/shared/BasicSearch.vue"),
CategorySelect: () => import("../../components/shared/CategorySelect.vue"),
ChangeLog: () => import("../../components/shared/ChangeLog.vue"),
ColorSchemeSelector: () => import("../../components/shared/ColorSchemeSelector.vue"),
Column: () => import("../../components/shared/Column.vue"),
ColumnChooser: () => import("../../components/shared/ColumnChooser.vue"),
ColumnConfig: () => import("../../components/shared/ColumnConfig.vue"),
DataCard: () => import("../../components/shared/DataCard.vue"),
DataFormatSelector: () => import("../../components/shared/DataFormatSelector.vue"),
DataMaskSelector: () => import("../../components/shared/DataMaskSelector.vue"),
DataNode: () => import("../../components/shared/DataNode.vue"),
DataTree: () => import("../../components/shared/DataTree.vue"),
DownloadSvgButton: () => import("../../components/shared/DownloadSvgButton.vue"),
DraggableFileUpload: () => import("../../components/shared/DraggableFileUpload.vue"),
EllipsisMenu: () => import("../../components/shared/EllipsisMenu.vue"),
FileUploadButton: () => import("../../components/shared/FileUploadButton.vue"),
FilterTable: () => import("../../components/shared/FilterTable.vue"),
IconDropdown: () => import("../../components/shared/IconDropdown.vue"),
IconSelector: () => import("../../components/shared/IconSelector.vue"),
InputImageCarousel: () => import("../../components/shared/InputImageCarousel.vue"),
LaunchpadSettingsModal: () => import("../../components/shared/LaunchpadSettingsModal.vue"),
Modal: () => import("../../components/shared/Modal.vue"),
ModalSaveVersion: () => import("../../components/shared/ModalSaveVersion.vue"),
MultiThumbnailFileUploader: () => import("../../components/shared/MultiThumbnailFileUploader.vue"),
PaginationTable: () => import("../../components/shared/PaginationTable.vue"),
PmqlInput: () => import("../../components/shared/PmqlInput.vue"),
PmqlInputFilters: () => import("../../components/shared/PmqlInputFilters.vue"),
ProjectSelect: () => import("../../components/shared/ProjectSelect.vue"),
PTab: () => import("../../components/shared/PTab.vue"),
PTabs: () => import("../../components/shared/PTabs.vue"),
Required: () => import("../../components/shared/Required.vue"),
SidebarButton: () => import("../../components/shared/SidebarButton.vue"),
SidebarNav: () => import("../../components/shared/SidebarNav.vue"),
SliderWithInput: () => import("../../components/shared/SliderWithInput.vue"),
// Common components folder
DataTreeToggle: () => import("../../components/common/data-tree-toggle.vue"),
};

Object.entries(pmComponents).forEach(([key, component]) => {
Vue.component(key, component);
});

// Multiselect
Vue.component("Multiselect", (resolve, reject) => {
import("@processmaker/vue-multiselect").then((Multiselect) => {
resolve(Multiselect.Multiselect);
}).catch(reject);
});
1 change: 0 additions & 1 deletion resources/js/next/config/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const removeNotifications = (messageIds = [], urls = []) => apiClient.put("/read

const unreadNotifications = (messageIds = [], urls = []) => apiClient.put("/unread_notifications", { message_ids: messageIds, routes: urls });

console.log("$notifications");
const $notifications = {
icons: {},
};
Expand Down
14 changes: 13 additions & 1 deletion resources/js/next/config/user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { setGlobalPMVariable } from "../globalVariables";
import { setGlobalPMVariable, getGlobalVariable } from "../globalVariables";

import datetime_format from "../../data/datetime_formats.json";

const moment = getGlobalVariable("moment");
const userID = document.head.querySelector("meta[name=\"user-id\"]");
const userFullName = document.head.querySelector("meta[name=\"user-full-name\"]");
const userAvatar = document.head.querySelector("meta[name=\"user-avatar\"]");
Expand Down Expand Up @@ -30,5 +31,16 @@ if (userID) {
}
});

if (user) {
moment.tz.setDefault(user.timezone);
moment.defaultFormat = user.datetime_format;
moment.defaultFormatUtc = user.datetime_format;
}

if (document.documentElement.lang) {
moment.locale(document.documentElement.lang);
user.lang = document.documentElement.lang;
}

setGlobalPMVariable("user", user);
}
4 changes: 0 additions & 4 deletions resources/js/next/libraries/vueFormElements.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,3 @@ const Vue = getGlobalVariable("Vue");
Vue.use(VueFormElements);

setGlobalVariable("VueFormElements", VueFormElements);

// import("@processmaker/vue-form-elements").then((vueforms) => {
// setGlobalVariable("VueFormElements", vueforms);
// });
26 changes: 13 additions & 13 deletions resources/js/next/monaco.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// import MonacoEditor from "vue-monaco";
import MonacoEditor from "vue-monaco";
import { getGlobalVariable, setGlobalVariable } from "./globalVariables";

// const Vue = getGlobalVariable("Vue");
const Vue = getGlobalVariable("Vue");

// Vue.component("MonacoEditor", MonacoEditor);
// setGlobalVariable("VueMonaco", MonacoEditor);
// setGlobalVariable("monaco", MonacoEditor);
Vue.component("MonacoEditor", MonacoEditor);
setGlobalVariable("VueMonaco", MonacoEditor);
setGlobalVariable("monaco", MonacoEditor);

const Vue = getGlobalVariable("Vue");
// const Vue = getGlobalVariable("Vue");

Vue.component("MonacoEditor", (resolve, reject) => {
console.log("LOADER MONACO %%%%%%%%%%");
// Vue.component("MonacoEditor", (resolve, reject) => {
// console.log("LOADER MONACO %%%%%%%%%%");

import("vue-monaco").then((MonacoEditor) => {
setGlobalVariable("VueMonaco", MonacoEditor.default);
resolve(MonacoEditor.default);
}).catch(reject);
});
// import("vue-monaco").then((MonacoEditor) => {
// setGlobalVariable("VueMonaco", MonacoEditor.default);
// resolve(MonacoEditor.default);
// }).catch(reject);
// });
3 changes: 0 additions & 3 deletions resources/js/next/screenBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,12 @@ const addScriptsToDOM = async function (scripts) {

const componentsScreenBuilder = ["VueFormRenderer", "Task", "TaskView"];

console.log("JONAS", componentsScreenBuilder);
componentsScreenBuilder.forEach((component) => {
Vue.component(component, (resolve, reject) => {
console.log("LOADER SCREEN BUILDER -------------------------");
import("@processmaker/screen-builder/dist/vue-form-builder.css");
if (screenBuilderScripts) {
addScriptsToDOM(screenBuilderScripts).then(() => {
import("@processmaker/screen-builder").then((ScreenBuilder) => {
console.log("ScreenBuilder DESPUES", ScreenBuilder);
Vue.use(ScreenBuilder.default);

const { initializeScreenCache } = ScreenBuilder;
Expand Down
Loading