From 961637773139593d7ff27e783d392158844ae2ce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Dec 2024 13:51:33 +0000 Subject: [PATCH 1/7] Bump lowcoder-sdk from 0.0.41 to 2.4.16 in /server/node-service Bumps lowcoder-sdk from 0.0.41 to 2.4.16. --- updated-dependencies: - dependency-name: lowcoder-sdk dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- server/node-service/package.json | 2 +- server/node-service/yarn.lock | 25 ++++++++++++++++++------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/server/node-service/package.json b/server/node-service/package.json index 4cd6aa058..4c7d0cd82 100644 --- a/server/node-service/package.json +++ b/server/node-service/package.json @@ -62,7 +62,7 @@ "lodash": "^4.17.21", "loglevel": "^1.8.1", "lowcoder-core": "^0.0.8", - "lowcoder-sdk": "0.0.41", + "lowcoder-sdk": "2.4.16", "morgan": "^1.10.0", "node-fetch": "2", "node-firebird": "^1.1.9", diff --git a/server/node-service/yarn.lock b/server/node-service/yarn.lock index 03d63ef0f..608c8d086 100644 --- a/server/node-service/yarn.lock +++ b/server/node-service/yarn.lock @@ -7744,7 +7744,7 @@ __metadata: lodash: ^4.17.21 loglevel: ^1.8.1 lowcoder-core: ^0.0.8 - lowcoder-sdk: 0.0.41 + lowcoder-sdk: 2.4.16 morgan: ^1.10.0 nock: ^13.3.0 node-fetch: 2 @@ -7765,13 +7765,15 @@ __metadata: languageName: unknown linkType: soft -"lowcoder-sdk@npm:0.0.41": - version: 0.0.41 - resolution: "lowcoder-sdk@npm:0.0.41" +"lowcoder-sdk@npm:2.4.16": + version: 2.4.16 + resolution: "lowcoder-sdk@npm:2.4.16" + dependencies: + prettier: ^3.1.1 peerDependencies: - react: ">=17" - react-dom: ">=17" - checksum: f7820b8ddfc9e86c3c36923347a686325b449a9d01cad761c0800e27d6f3408e76668664a24667eeb19eb6674f5024113da7a9fc3881cf5ce28d6f9304444c79 + react: ">=18" + react-dom: ">=18" + checksum: d22d03e928f4f0743eba4a0568cd942cece308eb592741dd9247fc959739d22178ffab59710d27817a4d1ac1ba78a09c0aaacaf525511e37b03147cfccc6275c languageName: node linkType: hard @@ -8984,6 +8986,15 @@ __metadata: languageName: node linkType: hard +"prettier@npm:^3.1.1": + version: 3.4.1 + resolution: "prettier@npm:3.4.1" + bin: + prettier: bin/prettier.cjs + checksum: f83ae83e38ae38f42c0b174833f58f820ed6eb063abfc5aa6725e8f9c1d626b54b1cb9d595cace525f8d59de89e186285f6bbcb460dc644ea9d8a7823cc54aca + languageName: node + linkType: hard + "pretty-format@npm:^29.0.0, pretty-format@npm:^29.7.0": version: 29.7.0 resolution: "pretty-format@npm:29.7.0" From 3bbf61b539fe27779572f4fea18bfe178890c239 Mon Sep 17 00:00:00 2001 From: RAHEEL Date: Wed, 4 Dec 2024 00:23:05 +0500 Subject: [PATCH 2/7] remove lazyloading from common components --- .../comps/containerComp/containerView.tsx | 5 +- .../lowcoder/src/comps/comps/rootComp.tsx | 4 +- client/packages/lowcoder/src/comps/index.tsx | 62 ++++++++----------- 3 files changed, 33 insertions(+), 38 deletions(-) diff --git a/client/packages/lowcoder/src/comps/comps/containerComp/containerView.tsx b/client/packages/lowcoder/src/comps/comps/containerComp/containerView.tsx index 9af5096d3..ff00f7fc7 100644 --- a/client/packages/lowcoder/src/comps/comps/containerComp/containerView.tsx +++ b/client/packages/lowcoder/src/comps/comps/containerComp/containerView.tsx @@ -225,9 +225,10 @@ const onDrop = async ( const nameGenerator = editorState.getNameGenerator(); const compInfo = parseCompType(compType); const compName = nameGenerator.genItemName(compInfo.compName); + const isLazyLoadComp = uiCompRegistry[compType as UICompType]?.lazyLoad; let defaultDataFn = undefined; - if (!compInfo.isRemote) { + if (isLazyLoadComp) { const { defaultDataFnName, defaultDataFnPath, @@ -237,6 +238,8 @@ const onDrop = async ( const module = await import(`../../${defaultDataFnPath}.tsx`); defaultDataFn = module[defaultDataFnName]; } + } else if(!compInfo.isRemote) { + defaultDataFn = uiCompRegistry[compType as UICompType]?.defaultDataFn; } const widgetValue: GridItemDataType = { diff --git a/client/packages/lowcoder/src/comps/comps/rootComp.tsx b/client/packages/lowcoder/src/comps/comps/rootComp.tsx index 83fe577c9..b28e4c045 100644 --- a/client/packages/lowcoder/src/comps/comps/rootComp.tsx +++ b/client/packages/lowcoder/src/comps/comps/rootComp.tsx @@ -1,5 +1,5 @@ -import "comps/comps/layout/navLayout"; -import "comps/comps/layout/mobileTabLayout"; +// import "comps/comps/layout/navLayout"; +// import "comps/comps/layout/mobileTabLayout"; import { CompAction, CompActionTypes } from "lowcoder-core"; import { EditorContext, EditorState } from "comps/editorState"; diff --git a/client/packages/lowcoder/src/comps/index.tsx b/client/packages/lowcoder/src/comps/index.tsx index a90262fd7..6f5293193 100644 --- a/client/packages/lowcoder/src/comps/index.tsx +++ b/client/packages/lowcoder/src/comps/index.tsx @@ -1,3 +1,6 @@ +import "comps/comps/layout/navLayout"; +import "comps/comps/layout/mobileTabLayout"; + import cnchar from "cnchar"; import { trans } from "i18n"; import { remoteComp } from "./comps/remoteComp/remoteComp"; @@ -113,6 +116,17 @@ import { KanbanCompIcon, } from "lowcoder-design"; +import { ModuleComp } from "./comps/moduleComp/moduleComp"; +import { TableComp } from "./comps/tableComp/tableComp"; +import { defaultTableData } from "./comps/tableComp/mockTableComp"; +import { ContainerComp, defaultContainerData } from "./comps/containerComp/containerComp"; +import { ColumnLayoutComp } from "./comps/columnLayout/columnLayout"; +import { TabbedContainerComp } from "./comps/tabs/tabbedContainerComp"; +import { ButtonComp } from "./comps/buttonComp/buttonComp"; +import { TextComp } from "./comps/textComp"; +import { SelectComp } from "./comps/selectInputComp/selectComp"; +import { InputComp } from "./comps/textInputComp/inputComp"; +import { TextAreaComp } from "./comps/textInputComp/textAreaComp"; type Registry = { [key in UICompType]?: UICompManifest; @@ -340,19 +354,16 @@ export var uiCompMap: Registry = { name: trans("uiComp.tableCompName"), enName: "Table", description: trans("uiComp.tableCompDesc"), - categories: ["dashboards"], + categories: ["dashboards", "projectmanagement"], icon: TableCompIcon, keywords: trans("uiComp.tableCompKeywords"), - lazyLoad: true, - compName: "TableComp", - compPath: "comps/tableComp/index", + comp: TableComp, layoutInfo: { w: 12, h: 40, }, withoutLoading: true, - defaultDataFnName: "defaultTableData", - defaultDataFnPath: "comps/tableComp/mockTableComp", + defaultDataFn: defaultTableData, }, pivotTable: { @@ -450,9 +461,7 @@ export var uiCompMap: Registry = { categories: ["layout"], icon: ColumnLayoutCompIcon, keywords: trans("uiComp.responsiveLayoutCompKeywords"), - lazyLoad: true, - compName: "ColumnLayoutComp", - compPath: "comps/columnLayout/index", + comp: ColumnLayoutComp, withoutLoading: true, layoutInfo: { w: 24, @@ -502,9 +511,7 @@ export var uiCompMap: Registry = { categories: ["layout"], icon: TabbedContainerCompIcon, keywords: trans("uiComp.tabbedContainerCompKeywords"), - lazyLoad: true, - compName: "TabbedContainerComp", - compPath: "comps/tabs/index", + comp: TabbedContainerComp, withoutLoading: true, layoutInfo: { w: 12, @@ -540,9 +547,7 @@ export var uiCompMap: Registry = { categories: ["layout"], icon: ContainerCompIcon, keywords: trans("uiComp.containerCompKeywords"), - lazyLoad: true, - compName: "ContainerComp", - compPath: "comps/containerComp/containerComp", + comp: ContainerComp, withoutLoading: true, layoutInfo: { w: 12, @@ -550,8 +555,7 @@ export var uiCompMap: Registry = { // static: true, delayCollision: true, }, - defaultDataFnName: "defaultContainerData", - defaultDataFnPath: "comps/containerComp/containerComp", + defaultDataFn: defaultContainerData, }, listView: { name: trans("uiComp.listViewCompName"), @@ -927,9 +931,7 @@ export var uiCompMap: Registry = { categories: ["forms"], icon: InputCompIcon, keywords: trans("uiComp.inputCompKeywords"), - lazyLoad: true, - compName: "InputComp", - compPath: "comps/textInputComp/inputComp", + comp: InputComp, layoutInfo: { w: 6, h: 6, @@ -972,9 +974,7 @@ export var uiCompMap: Registry = { categories: ["forms"], icon: TextAreaCompIcon, keywords: trans("uiComp.textAreaCompKeywords"), - lazyLoad: true, - compName: "TextAreaComp", - compPath: "comps/textInputComp/textAreaComp", + comp: TextAreaComp, layoutInfo: { w: 6, h: 12, @@ -1141,9 +1141,7 @@ export var uiCompMap: Registry = { categories: ["forms"], icon: ButtonCompIcon, keywords: trans("uiComp.buttonCompKeywords"), - lazyLoad: true, - compName: "ButtonComp", - compPath: "comps/buttonComp/buttonComp", + comp: ButtonComp, layoutInfo: { w: 6, h: 6, @@ -1563,9 +1561,7 @@ export var uiCompMap: Registry = { categories: ["forms", "itemHandling"], icon: SelectCompIcon, keywords: trans("uiComp.selectCompKeywords"), - lazyLoad: true, - compName: "SelectComp", - compPath: "comps/selectInputComp/selectComp", + comp: SelectComp, layoutInfo: { w: 6, h: 5, @@ -1705,9 +1701,7 @@ export var uiCompMap: Registry = { description: trans("uiComp.moduleCompDesc"), categories: [], keywords: trans("uiComp.moduleCompKeywords"), - lazyLoad: true, - compName: "ModuleComp", - compPath: "comps/moduleComp/moduleComp", + comp: ModuleComp, layoutInfo: { w: 12, h: 40, @@ -1723,9 +1717,7 @@ export var uiCompMap: Registry = { categories: ["dashboards", "layout", "multimedia"], icon: TextCompIcon, keywords: trans("uiComp.textCompKeywords"), - compName: "TextComp", - lazyLoad: true, - compPath: "comps/textComp", + comp: TextComp, layoutInfo: { w: 6, h: 24, From 62c5decc15b3cbf0fdc1a69c17e1c8a1ec6cbbeb Mon Sep 17 00:00:00 2001 From: RAHEEL Date: Mon, 2 Dec 2024 18:44:56 +0500 Subject: [PATCH 3/7] expose inserted,updated and deleted events + added startTime,endTime and allDay in edit modal + event dragging fixes --- .../src/comps/calendarComp/calendarComp.tsx | 184 +++++++++++++++--- .../comps/calendarComp/calendarConstants.tsx | 19 ++ .../src/i18n/comps/locales/en.ts | 3 + 3 files changed, 178 insertions(+), 28 deletions(-) diff --git a/client/packages/lowcoder-comps/src/comps/calendarComp/calendarComp.tsx b/client/packages/lowcoder-comps/src/comps/calendarComp/calendarComp.tsx index 5021ee568..477729146 100644 --- a/client/packages/lowcoder-comps/src/comps/calendarComp/calendarComp.tsx +++ b/client/packages/lowcoder-comps/src/comps/calendarComp/calendarComp.tsx @@ -1,6 +1,7 @@ import { default as Form } from "antd/es/form"; import { default as Input } from "antd/es/input"; import { default as ColorPicker } from "antd/es/color-picker"; +import { default as Switch } from "antd/es/switch"; import { trans, getCalendarLocale } from "../../i18n/comps"; import { createRef, useContext, useRef, useState, useEffect, useCallback, useMemo, Suspense } from "react"; import dayjs from "dayjs"; @@ -19,6 +20,7 @@ import momentPlugin from "@fullcalendar/moment"; import ErrorBoundary from "./errorBoundary"; import { default as Tabs } from "antd/es/tabs"; +import { differenceBy, differenceWith, isEqual, filter, includes } from "lodash"; import { isValidColor, @@ -54,6 +56,8 @@ import { migrateOldData, controlItem, depsConfig, + stateComp, + JSONObject, } from 'lowcoder-sdk'; import { @@ -196,6 +200,10 @@ let childrenMap: any = { currentPremiumView: dropdownControl(DefaultWithPremiumViewOptions, "resourceTimelineDay"), animationStyle: styleControl(AnimationStyle, 'animationStyle'), showVerticalScrollbar: withDefault(BoolControl, false), + initialData: stateComp({}), + updatedEvents: stateComp({}), + insertedEvents: stateComp({}), + deletedEvents: stateComp({}), }; // this should ensure backwards compatibility with older versions of the SDK @@ -233,8 +241,9 @@ let CalendarBasicComp = (function () { currentFreeView?: string; currentPremiumView?: string; animationStyle?:any; - modalStyle?:any - showVerticalScrollbar?:boolean + modalStyle?:any; + showVerticalScrollbar?:boolean; + initialData: Array; }, dispatch: any) => { const comp = useContext(EditorContext)?.getUICompByName( useContext(CompNameContext) @@ -243,11 +252,13 @@ let CalendarBasicComp = (function () { const theme = useContext(ThemeContext); const ref = createRef(); const editEvent = useRef(); + const initData = useRef(false); const [form] = Form.useForm(); const [left, setLeft] = useState(undefined); const [licensed, setLicensed] = useState(props.licenseKey !== ""); const [currentSlotLabelFormat, setCurrentSlotLabelFormat] = useState(slotLabelFormat); - + const [initDataMap, setInitDataMap] = useState>({}); + useEffect(() => { setLicensed(props.licenseKey !== ""); }, [props.licenseKey]); @@ -290,27 +301,53 @@ let CalendarBasicComp = (function () { start: dayjs(item.start, DateParser).format(), end: dayjs(item.end, DateParser).format(), allDay: item.allDay, - resourceId: item.resourceId ? item.resourceId : null, - groupId: item.groupId ? item.groupId : null, + ...(item.resourceId ? { resourceId: item.resourceId } : {}), + ...(item.groupId ? { groupId: item.groupId } : {}), backgroundColor: item.backgroundColor, - extendedProps: { - color: isValidColor(item.color || "") ? item.color : theme?.theme?.primary, - ...(item.groupId ? { groupId: item.groupId } : {}), // Ensure color is in extendedProps - detail: item.detail, - titleColor:item.titleColor, - detailColor:item.detailColor, - titleFontWeight:item.titleFontWeight, - titleFontStyle:item.titleFontStyle, - detailFontWeight:item.detailFontWeight, - detailFontStyle:item.detailFontStyle, - animation:item?.animation, - animationDelay:item?.animationDelay, - animationDuration:item?.animationDuration, - animationIterationCount:item?.animationIterationCount - }} + extendedProps: { // Ensure color is in extendedProps + color: isValidColor(item.color || "") ? item.color : theme?.theme?.primary, + detail: item.detail, + titleColor:item.titleColor, + detailColor:item.detailColor, + titleFontWeight:item.titleFontWeight, + titleFontStyle:item.titleFontStyle, + detailFontWeight:item.detailFontWeight, + detailFontStyle:item.detailFontStyle, + animation:item?.animation, + animationDelay:item?.animationDelay, + animationDuration:item?.animationDuration, + animationIterationCount:item?.animationIterationCount + } + } }) : [currentEvents]; }, [currentEvents, theme]) + useEffect(() => { + const mapData: Record = {}; + events?.forEach((item: any, index: number) => { + mapData[`${item.id}`] = index; + }) + + if (initData.current) { + const difference = differenceWith(events, props.initialData, isEqual); + const inserted = differenceBy(difference, Object.keys(initDataMap)?.map(id => ({ id })), 'id') + const updated = filter(difference, obj => includes(Object.keys(initDataMap), String(obj.id))); + const deleted = differenceBy(props.initialData, Object.keys(mapData)?.map(id => ({ id })), 'id') + + comp.children?.comp.children?.updatedEvents.dispatchChangeValueAction(updated); + comp.children?.comp.children?.insertedEvents.dispatchChangeValueAction(inserted); + comp.children?.comp.children?.deletedEvents.dispatchChangeValueAction(deleted); + } + + if (!initData.current && events?.length && comp?.children?.comp?.children?.initialData) { + setInitDataMap(mapData); + comp?.children?.comp?.children?.initialData?.dispatch?.( + comp?.children?.comp?.children?.initialData?.changeValueAction?.([...events]) + ); + initData.current = true; + } + }, [JSON.stringify(events), comp?.children?.comp?.children?.initialData]); + const resources = useMemo(() => props.resources.value, [props.resources.value]); // list all plugins for Fullcalendar @@ -370,12 +407,12 @@ let CalendarBasicComp = (function () { }, [slotLabelFormat, slotLabelFormatWeek, slotLabelFormatMonth]); const handleEventDataChange = useCallback((data: Array>) => { - comp.children?.comp.children.events.children.manual.children.manual.dispatch( - comp.children?.comp.children.events.children.manual.children.manual.setChildrensAction( + comp?.children?.comp.children.events.children.manual.children.manual.dispatch( + comp?.children?.comp.children.events.children.manual.children.manual.setChildrensAction( data ) ); - comp.children?.comp.children.events.children.mapData.children.data.dispatchChangeValueAction( + comp?.children?.comp.children.events.children.mapData.children.data.dispatchChangeValueAction( JSON.stringify(data) ); props.onEvent("change"); @@ -506,6 +543,24 @@ let CalendarBasicComp = (function () { > + + + + + + + + + @@ -768,12 +823,21 @@ let CalendarBasicComp = (function () { showModal(event, false); }, [editEvent, showModal]); - const handleDrop = useCallback(() => { + const handleDrop = useCallback((eventInfo: EventType) => { + let eventsList = [...props.events]; + const eventIdx = eventsList.findIndex( + (item: EventType) => item.id === eventInfo.id + ); + if (eventIdx > -1) { + eventsList[eventIdx] = eventInfo; + handleEventDataChange(eventsList); + } + if (typeof props.onDropEvent === 'function') { props.onDropEvent("dropEvent"); } }, [props.onDropEvent]); - + return ( { + eventDrop={(info) => { + const {extendedProps, ...event} = info.event.toJSON(); if (info.view) { - handleDrop(); + handleDrop({ + ...event, + ...extendedProps, + }); } }} /> @@ -1007,6 +1075,30 @@ const TmpCalendarComp = withExposingConfigs(CalendarBasicComp, [ return input.events.filter(event => Boolean(event.resourceId)); }, }), + depsConfig({ + name: "toUpdatedEvents", + desc: trans("calendar.updatedEvents"), + depKeys: ["updatedEvents"], + func: (input: { updatedEvents: any[]; }) => { + return input.updatedEvents; + }, + }), + depsConfig({ + name: "toInsertedEvents", + desc: trans("calendar.insertedEvents"), + depKeys: ["insertedEvents"], + func: (input: { insertedEvents: any[]; }) => { + return input.insertedEvents; + }, + }), + depsConfig({ + name: "toDeletedEvents", + desc: trans("calendar.deletedEvents"), + depKeys: ["deletedEvents"], + func: (input: { deletedEvents: any[]; }) => { + return input.deletedEvents; + }, + }), ]); let CalendarComp = withMethodExposing(TmpCalendarComp, [ @@ -1124,7 +1216,43 @@ let CalendarComp = withMethodExposing(TmpCalendarComp, [ const viewKey = comp.children.licenseKey.getView() === "" ? 'defaultFreeView' : 'defaultPremiumView'; comp.children["viewKey"].dispatchChangeValueAction("multiMonthYear"); } - } + }, + { + method: { + name: "clearUpdatedEvents", + detail: "Clear updated events list", + params: [], + }, + execute: (comp) => { + comp?.children?.updatedEvents.dispatch( + comp?.children?.updatedEvents.changeValueAction([]) + ); + } + }, + { + method: { + name: "clearInsertedEvents", + detail: "Clear inserted events list", + params: [], + }, + execute: (comp) => { + comp?.children?.insertedEvents.dispatch( + comp?.children?.insertedEvents.changeValueAction([]) + ); + } + }, + { + method: { + name: "clearDeletedEvents", + detail: "Clear deleted events list", + params: [], + }, + execute: (comp) => { + comp?.children?.deletedEvents.dispatch( + comp?.children?.deletedEvents.changeValueAction([]) + ); + } + }, ]); diff --git a/client/packages/lowcoder-comps/src/comps/calendarComp/calendarConstants.tsx b/client/packages/lowcoder-comps/src/comps/calendarComp/calendarConstants.tsx index e8602a8fe..a88ab756a 100644 --- a/client/packages/lowcoder-comps/src/comps/calendarComp/calendarConstants.tsx +++ b/client/packages/lowcoder-comps/src/comps/calendarComp/calendarConstants.tsx @@ -988,6 +988,25 @@ export const defaultEvents = [ end: dayjs().hour(21).minute(30).second(0).format(DATE_TIME_FORMAT), color: "#079968", }, + { + id: "6", + label: "Coding", + start: dayjs().hour(15).minute(0).second(0).format(DATE_TIME_FORMAT), + end: dayjs().hour(17).minute(30).second(0).format(DATE_TIME_FORMAT), + color: "#079968", + backgroundColor:"#ffffff", + detail: 'Discuss project milestones and deliverables.', + titleColor:"#000000", + detailColor:"#000000", + titleFontWeight:"normal", + titleFontStyle:"italic", + detailFontWeight:"normal", + detailFontStyle:"italic", + animation:"none", + animationDelay:"0s", + animationDuration:"0s", + animationIterationCount:"0", + }, ]; export const resourcesEventsDefaultData = [ { diff --git a/client/packages/lowcoder-comps/src/i18n/comps/locales/en.ts b/client/packages/lowcoder-comps/src/i18n/comps/locales/en.ts index f6261b84f..f8d5f77f7 100644 --- a/client/packages/lowcoder-comps/src/i18n/comps/locales/en.ts +++ b/client/packages/lowcoder-comps/src/i18n/comps/locales/en.ts @@ -271,6 +271,9 @@ export const en = { resourcesDefault: "Rooms", resourcesName: "Resource Name", resourcesEvents : "Resources Events Data", + deletedEvents : "List of deleted events", + updatedEvents : "List of updated events", + insertedEvents : "List of inserted events", editable: "Editable", license: "Licence Key", licenseTooltip: "Get your licence key from https://fullcalendar.io/purchase to enable premium views like Resource Timeline and Resource Grid.", From 3d1e09e9123f8de9ef55d90b376a37fb19faac6b Mon Sep 17 00:00:00 2001 From: RAHEEL Date: Mon, 2 Dec 2024 23:23:20 +0500 Subject: [PATCH 4/7] update data on events drag/drop --- .../src/comps/calendarComp/calendarComp.tsx | 40 +++++++++++-------- .../comps/calendarComp/calendarConstants.tsx | 19 --------- 2 files changed, 24 insertions(+), 35 deletions(-) diff --git a/client/packages/lowcoder-comps/src/comps/calendarComp/calendarComp.tsx b/client/packages/lowcoder-comps/src/comps/calendarComp/calendarComp.tsx index 477729146..06eead610 100644 --- a/client/packages/lowcoder-comps/src/comps/calendarComp/calendarComp.tsx +++ b/client/packages/lowcoder-comps/src/comps/calendarComp/calendarComp.tsx @@ -12,10 +12,10 @@ import adaptivePlugin from "@fullcalendar/adaptive"; import dayGridPlugin from "@fullcalendar/daygrid"; import multiMonthPlugin from '@fullcalendar/multimonth'; import timeGridPlugin from "@fullcalendar/timegrid"; -import interactionPlugin from "@fullcalendar/interaction"; +import interactionPlugin, { EventResizeDoneArg } from "@fullcalendar/interaction"; import listPlugin from "@fullcalendar/list"; import allLocales from "@fullcalendar/core/locales-all"; -import { EventContentArg, DateSelectArg } from "@fullcalendar/core"; +import { EventContentArg, DateSelectArg, EventDropArg } from "@fullcalendar/core"; import momentPlugin from "@fullcalendar/moment"; import ErrorBoundary from "./errorBoundary"; @@ -83,6 +83,7 @@ import { resourceTimeGridHeaderToolbar, } from "./calendarConstants"; import { EventOptionControl } from "./eventOptionsControl"; +import { EventImpl } from "@fullcalendar/core/internal"; function fixOldData(oldData: any) { if(!Boolean(oldData)) return; @@ -823,20 +824,34 @@ let CalendarBasicComp = (function () { showModal(event, false); }, [editEvent, showModal]); - const handleDrop = useCallback((eventInfo: EventType) => { + const updateEventsOnDragOrResize = useCallback((eventInfo: EventImpl) => { + const {extendedProps, title, ...event} = eventInfo.toJSON(); + let eventsList = [...props.events]; const eventIdx = eventsList.findIndex( - (item: EventType) => item.id === eventInfo.id + (item: EventType) => item.id === event.id ); if (eventIdx > -1) { - eventsList[eventIdx] = eventInfo; + eventsList[eventIdx] = { + label: title, + ...event, + ...extendedProps, + }; handleEventDataChange(eventsList); } + }, [props.events, handleEventDataChange]); + + const handleDrop = useCallback((eventInfo: EventDropArg) => { + updateEventsOnDragOrResize(eventInfo.event); if (typeof props.onDropEvent === 'function') { props.onDropEvent("dropEvent"); } - }, [props.onDropEvent]); + }, [props.onDropEvent, updateEventsOnDragOrResize]); + + const handleResize = useCallback((eventInfo: EventResizeDoneArg) => { + updateEventsOnDragOrResize(eventInfo.event); + }, [props.onDropEvent, updateEventsOnDragOrResize]); return ( { - const {extendedProps, ...event} = info.event.toJSON(); - if (info.view) { - handleDrop({ - ...event, - ...extendedProps, - }); - } - }} + eventDrop={handleDrop} + eventResize={handleResize} /> diff --git a/client/packages/lowcoder-comps/src/comps/calendarComp/calendarConstants.tsx b/client/packages/lowcoder-comps/src/comps/calendarComp/calendarConstants.tsx index a88ab756a..e8602a8fe 100644 --- a/client/packages/lowcoder-comps/src/comps/calendarComp/calendarConstants.tsx +++ b/client/packages/lowcoder-comps/src/comps/calendarComp/calendarConstants.tsx @@ -988,25 +988,6 @@ export const defaultEvents = [ end: dayjs().hour(21).minute(30).second(0).format(DATE_TIME_FORMAT), color: "#079968", }, - { - id: "6", - label: "Coding", - start: dayjs().hour(15).minute(0).second(0).format(DATE_TIME_FORMAT), - end: dayjs().hour(17).minute(30).second(0).format(DATE_TIME_FORMAT), - color: "#079968", - backgroundColor:"#ffffff", - detail: 'Discuss project milestones and deliverables.', - titleColor:"#000000", - detailColor:"#000000", - titleFontWeight:"normal", - titleFontStyle:"italic", - detailFontWeight:"normal", - detailFontStyle:"italic", - animation:"none", - animationDelay:"0s", - animationDuration:"0s", - animationIterationCount:"0", - }, ]; export const resourcesEventsDefaultData = [ { From 3a00b2197c14851ea72024fea1f06e05d3cccdb2 Mon Sep 17 00:00:00 2001 From: RAHEEL Date: Wed, 4 Dec 2024 12:43:24 +0500 Subject: [PATCH 5/7] fix drag/drop event triggers --- .../lowcoder-comps/src/comps/calendarComp/calendarComp.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/packages/lowcoder-comps/src/comps/calendarComp/calendarComp.tsx b/client/packages/lowcoder-comps/src/comps/calendarComp/calendarComp.tsx index 06eead610..da34b5610 100644 --- a/client/packages/lowcoder-comps/src/comps/calendarComp/calendarComp.tsx +++ b/client/packages/lowcoder-comps/src/comps/calendarComp/calendarComp.tsx @@ -845,7 +845,7 @@ let CalendarBasicComp = (function () { updateEventsOnDragOrResize(eventInfo.event); if (typeof props.onDropEvent === 'function') { - props.onDropEvent("dropEvent"); + props.onDropEvent("drop"); } }, [props.onDropEvent, updateEventsOnDragOrResize]); @@ -959,6 +959,11 @@ let CalendarBasicComp = (function () { props.onEvent("change"); } }} + eventDragStart={() => { + if (typeof props.onDropEvent === 'function') { + props.onDropEvent("drag"); + } + }} eventDrop={handleDrop} eventResize={handleResize} /> From 691a16850cdc60ec1fd9c740e4aa84d68139d1fd Mon Sep 17 00:00:00 2001 From: Thomasr Date: Wed, 4 Dec 2024 01:09:54 -0500 Subject: [PATCH 6/7] Add search by category feature --- .../domain/application/model/Application.java | 12 ++++++++++++ .../api/application/ApplicationApiService.java | 2 +- .../application/ApplicationApiServiceImpl.java | 4 ++-- .../api/application/ApplicationController.java | 17 +++++++++-------- .../api/application/ApplicationEndpoints.java | 3 ++- .../org/lowcoder/api/home/FolderApiService.java | 2 +- .../lowcoder/api/home/FolderApiServiceImpl.java | 8 ++++---- .../org/lowcoder/api/home/FolderController.java | 3 ++- .../org/lowcoder/api/home/FolderEndpoints.java | 1 + .../lowcoder/api/home/UserHomeApiService.java | 2 +- .../api/home/UserHomeApiServiceImpl.java | 7 ++++--- .../api/service/FolderApiServiceTest.java | 2 +- 12 files changed, 40 insertions(+), 23 deletions(-) diff --git a/server/api-service/lowcoder-domain/src/main/java/org/lowcoder/domain/application/model/Application.java b/server/api-service/lowcoder-domain/src/main/java/org/lowcoder/domain/application/model/Application.java index cce006b66..57ad9d720 100644 --- a/server/api-service/lowcoder-domain/src/main/java/org/lowcoder/domain/application/model/Application.java +++ b/server/api-service/lowcoder-domain/src/main/java/org/lowcoder/domain/application/model/Application.java @@ -179,6 +179,18 @@ public Map getEditingApplicationDSL() { return dsl; } + public String getCategory() { + if(editingApplicationDSL == null || editingApplicationDSL.get("settings") == null) return ""; + Object settingsObject = editingApplicationDSL.get("settings"); + if (settingsObject instanceof Map) { + @SuppressWarnings("unchecked") + Map settings = (Map) editingApplicationDSL.get("settings"); + return (String) settings.get("category"); + } else { + return ""; + } + } + public Map getEditingApplicationDSLOrNull() {return editingApplicationDSL; } public Object getLiveContainerSize() { diff --git a/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/application/ApplicationApiService.java b/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/application/ApplicationApiService.java index 88d14e210..e0990e134 100644 --- a/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/application/ApplicationApiService.java +++ b/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/application/ApplicationApiService.java @@ -17,7 +17,7 @@ public interface ApplicationApiService { Mono create(ApplicationEndpoints.CreateApplicationRequest createApplicationRequest); - Flux getRecycledApplications(String name); + Flux getRecycledApplications(String name, String category); Mono delete(String applicationId); diff --git a/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/application/ApplicationApiServiceImpl.java b/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/application/ApplicationApiServiceImpl.java index 25d772cdb..e7ae4e0dd 100644 --- a/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/application/ApplicationApiServiceImpl.java +++ b/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/application/ApplicationApiServiceImpl.java @@ -169,8 +169,8 @@ private Mono autoGrantPermissionsByFolderDefault(String applicationId, @Nu } @Override - public Flux getRecycledApplications(String name) { - return userHomeApiService.getAllAuthorisedApplications4CurrentOrgMember(null, ApplicationStatus.RECYCLED, false, name); + public Flux getRecycledApplications(String name, String category) { + return userHomeApiService.getAllAuthorisedApplications4CurrentOrgMember(null, ApplicationStatus.RECYCLED, false, name, category); } private Mono checkCurrentUserApplicationPermission(String applicationId, ResourceAction action) { diff --git a/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/application/ApplicationController.java b/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/application/ApplicationController.java index 3c91f7ce7..1fe9788e2 100644 --- a/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/application/ApplicationController.java +++ b/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/application/ApplicationController.java @@ -78,8 +78,8 @@ public Mono> restore(@PathVariable String applicationId) { } @Override - public Mono>> getRecycledApplications(@RequestParam(required = false) String name) { - return applicationApiService.getRecycledApplications(name) + public Mono>> getRecycledApplications(@RequestParam(required = false) String name, @RequestParam(required = false) String category) { + return applicationApiService.getRecycledApplications(name, category) .collectList() .map(ResponseView::success); } @@ -159,13 +159,14 @@ public Mono> getUserHomePage(@RequestParam(requir @Override public Mono>> getApplications(@RequestParam(required = false) Integer applicationType, - @RequestParam(required = false) ApplicationStatus applicationStatus, - @RequestParam(defaultValue = "true") boolean withContainerSize, - @RequestParam(required = false) String name, - @RequestParam(required = false, defaultValue = "1") Integer pageNum, - @RequestParam(required = false, defaultValue = "0") Integer pageSize) { + @RequestParam(required = false) ApplicationStatus applicationStatus, + @RequestParam(defaultValue = "true") boolean withContainerSize, + @RequestParam(required = false) String name, + @RequestParam(required = false) String category, + @RequestParam(required = false, defaultValue = "1") Integer pageNum, + @RequestParam(required = false, defaultValue = "0") Integer pageSize) { ApplicationType applicationTypeEnum = applicationType == null ? null : ApplicationType.fromValue(applicationType); - var flux = userHomeApiService.getAllAuthorisedApplications4CurrentOrgMember(applicationTypeEnum, applicationStatus, withContainerSize, name).cache(); + var flux = userHomeApiService.getAllAuthorisedApplications4CurrentOrgMember(applicationTypeEnum, applicationStatus, withContainerSize, name, category).cache(); Mono countMono = flux.count(); var flux1 = flux.skip((long) (pageNum - 1) * pageSize); if(pageSize > 0) flux1 = flux1.take(pageSize); diff --git a/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/application/ApplicationEndpoints.java b/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/application/ApplicationEndpoints.java index cef119847..78121eec4 100644 --- a/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/application/ApplicationEndpoints.java +++ b/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/application/ApplicationEndpoints.java @@ -71,7 +71,7 @@ public interface ApplicationEndpoints description = "List all the recycled Lowcoder Applications in the recycle bin where the authenticated or impersonated user has access." ) @GetMapping("/recycle/list") - public Mono>> getRecycledApplications(@RequestParam(required = false) String name); + public Mono>> getRecycledApplications(@RequestParam(required = false) String name, @RequestParam(required = false) String category); @Operation( tags = TAG_APPLICATION_MANAGEMENT, @@ -167,6 +167,7 @@ public Mono>> getApplications(@RequestPar @RequestParam(required = false) ApplicationStatus applicationStatus, @RequestParam(defaultValue = "true") boolean withContainerSize, @RequestParam(required = false) String name, + @RequestParam(required = false) String category, @RequestParam(required = false, defaultValue = "1") Integer pageNum, @RequestParam(required = false, defaultValue = "0") Integer pageSize); diff --git a/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/home/FolderApiService.java b/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/home/FolderApiService.java index de161bb19..81678ea78 100644 --- a/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/home/FolderApiService.java +++ b/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/home/FolderApiService.java @@ -27,7 +27,7 @@ public interface FolderApiService { Mono upsertLastViewTime(@Nullable String folderId); - Flux getElements(@Nullable String folderId, @Nullable ApplicationType applicationType, @Nullable String name); + Flux getElements(@Nullable String folderId, @Nullable ApplicationType applicationType, @Nullable String name, @Nullable String category); Mono grantPermission(String folderId, Set userIds, Set groupIds, ResourceRole role); diff --git a/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/home/FolderApiServiceImpl.java b/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/home/FolderApiServiceImpl.java index 3fb44e611..0d93a2e3b 100644 --- a/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/home/FolderApiServiceImpl.java +++ b/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/home/FolderApiServiceImpl.java @@ -233,8 +233,8 @@ public Mono upsertLastViewTime(@Nullable String folderId) { * @return flux of {@link ApplicationInfoView} or {@link FolderInfoView} */ @Override - public Flux getElements(@Nullable String folderId, @Nullable ApplicationType applicationType, @Nullable String name) { - return buildApplicationInfoViewTree(applicationType, name) + public Flux getElements(@Nullable String folderId, @Nullable ApplicationType applicationType, @Nullable String name, @Nullable String category) { + return buildApplicationInfoViewTree(applicationType, name, category) .flatMap(tree -> { FolderNode folderNode = tree.get(folderId); if (folderNode == null) { @@ -278,13 +278,13 @@ private Mono> buildFolderTree(String orgId) { .map(folders -> new Tree<>(folders, Folder::getId, Folder::getParentFolderId, Collections.emptyList(), null, null)); } - private Mono> buildApplicationInfoViewTree(@Nullable ApplicationType applicationType, @Nullable String name) { + private Mono> buildApplicationInfoViewTree(@Nullable ApplicationType applicationType, @Nullable String name, @Nullable String category) { Mono orgMemberMono = sessionUserService.getVisitorOrgMemberCache() .cache(); Flux applicationInfoViewFlux = - userHomeApiService.getAllAuthorisedApplications4CurrentOrgMember(applicationType, ApplicationStatus.NORMAL, false, name) + userHomeApiService.getAllAuthorisedApplications4CurrentOrgMember(applicationType, ApplicationStatus.NORMAL, false, name, category) .cache(); Mono> application2FolderMapMono = applicationInfoViewFlux diff --git a/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/home/FolderController.java b/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/home/FolderController.java index 24a77dd29..1eb541567 100644 --- a/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/home/FolderController.java +++ b/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/home/FolderController.java @@ -70,10 +70,11 @@ public Mono> update(@RequestBody Folder folder) { public Mono> getElements(@RequestParam(value = "id", required = false) String folderId, @RequestParam(value = "applicationType", required = false) ApplicationType applicationType, @RequestParam(required = false) String name, + @RequestParam(required = false) String category, @RequestParam(required = false, defaultValue = "1") Integer pageNum, @RequestParam(required = false, defaultValue = "0") Integer pageSize) { String objectId = gidService.convertFolderIdToObjectId(folderId); - var flux = folderApiService.getElements(objectId, applicationType, name).cache(); + var flux = folderApiService.getElements(objectId, applicationType, name, category).cache(); var countMono = flux.count(); var flux1 = flux.skip((long) (pageNum - 1) * pageSize); if(pageSize > 0) flux1 = flux1.take(pageSize); diff --git a/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/home/FolderEndpoints.java b/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/home/FolderEndpoints.java index 2c6279084..3e3bdb083 100644 --- a/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/home/FolderEndpoints.java +++ b/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/home/FolderEndpoints.java @@ -71,6 +71,7 @@ public interface FolderEndpoints public Mono> getElements(@RequestParam(value = "id", required = false) String folderId, @RequestParam(value = "applicationType", required = false) ApplicationType applicationType, @RequestParam(required = false) String name, + @RequestParam(required = false) String category, @RequestParam(required = false, defaultValue = "1") Integer pageNum, @RequestParam(required = false, defaultValue = "0") Integer pageSize); diff --git a/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/home/UserHomeApiService.java b/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/home/UserHomeApiService.java index e711304a4..64aa09240 100644 --- a/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/home/UserHomeApiService.java +++ b/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/home/UserHomeApiService.java @@ -24,7 +24,7 @@ public interface UserHomeApiService { Mono getUserHomePageView(ApplicationType applicationType); Flux getAllAuthorisedApplications4CurrentOrgMember(@Nullable ApplicationType applicationType, - @Nullable ApplicationStatus applicationStatus, boolean withContainerSize, @Nullable String name); + @Nullable ApplicationStatus applicationStatus, boolean withContainerSize, @Nullable String name, @Nullable String category); Flux getAllAuthorisedBundles4CurrentOrgMember(@Nullable BundleStatus bundleStatus); diff --git a/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/home/UserHomeApiServiceImpl.java b/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/home/UserHomeApiServiceImpl.java index ae5f22fcf..421e451cc 100644 --- a/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/home/UserHomeApiServiceImpl.java +++ b/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/home/UserHomeApiServiceImpl.java @@ -157,7 +157,7 @@ public Mono getUserHomePageView(ApplicationType applicationTyp } return organizationService.getById(currentOrgId) - .zipWith(folderApiService.getElements(null, applicationType, null).collectList()) + .zipWith(folderApiService.getElements(null, applicationType, null, null).collectList()) .map(tuple2 -> { Organization organization = tuple2.getT1(); List list = tuple2.getT2(); @@ -189,7 +189,7 @@ public Mono getUserHomePageView(ApplicationType applicationTyp @Override public Flux getAllAuthorisedApplications4CurrentOrgMember(@Nullable ApplicationType applicationType, - @Nullable ApplicationStatus applicationStatus, boolean withContainerSize, @Nullable String name) { + @Nullable ApplicationStatus applicationStatus, boolean withContainerSize, @Nullable String name, @Nullable String category) { return sessionUserService.getVisitorOrgMemberCache() .flatMapMany(orgMember -> { @@ -204,7 +204,8 @@ public Flux getAllAuthorisedApplications4CurrentOrgMember(@ }) .filter(application -> (isNull(applicationType) || application.getApplicationType() == applicationType.getValue()) && (isNull(applicationStatus) || application.getApplicationStatus() == applicationStatus) - && (isNull(name) || StringUtils.containsIgnoreCase(application.getName(), name))) + && (isNull(name) || StringUtils.containsIgnoreCase(application.getName(), name)) + && (isNull(category) || StringUtils.containsIgnoreCase(application.getCategory(), category))) .cache() .collectList() .flatMapIterable(Function.identity()); diff --git a/server/api-service/lowcoder-server/src/test/java/org/lowcoder/api/service/FolderApiServiceTest.java b/server/api-service/lowcoder-server/src/test/java/org/lowcoder/api/service/FolderApiServiceTest.java index c470c11d0..09fa8a2b9 100644 --- a/server/api-service/lowcoder-server/src/test/java/org/lowcoder/api/service/FolderApiServiceTest.java +++ b/server/api-service/lowcoder-server/src/test/java/org/lowcoder/api/service/FolderApiServiceTest.java @@ -137,7 +137,7 @@ public void updateByGid() { public void move() { Mono> mono = folderApiService.move("app01", "folder02") - .then(folderApiService.getElements("folder02", null, null).collectList()); + .then(folderApiService.getElements("folder02", null, null, null).collectList()); StepVerifier.create(mono) .assertNext(list -> { From 45f27a45ebad00e60c7a883f04a5825ca040f38c Mon Sep 17 00:00:00 2001 From: Thomasr Date: Wed, 4 Dec 2024 03:45:34 -0500 Subject: [PATCH 7/7] fix category search --- .../application/repository/ApplicationRepository.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/api-service/lowcoder-domain/src/main/java/org/lowcoder/domain/application/repository/ApplicationRepository.java b/server/api-service/lowcoder-domain/src/main/java/org/lowcoder/domain/application/repository/ApplicationRepository.java index 36f6fc96b..879765287 100644 --- a/server/api-service/lowcoder-domain/src/main/java/org/lowcoder/domain/application/repository/ApplicationRepository.java +++ b/server/api-service/lowcoder-domain/src/main/java/org/lowcoder/domain/application/repository/ApplicationRepository.java @@ -4,6 +4,7 @@ import jakarta.annotation.Nonnull; import org.lowcoder.domain.application.model.Application; import org.lowcoder.domain.application.model.ApplicationStatus; +import org.springframework.data.mongodb.repository.Aggregation; import org.springframework.data.mongodb.repository.Query; import org.springframework.data.mongodb.repository.ReactiveMongoRepository; import org.springframework.stereotype.Repository; @@ -16,16 +17,16 @@ public interface ApplicationRepository extends ReactiveMongoRepository, CustomApplicationRepository { // publishedApplicationDSL : 0 -> excludes publishedApplicationDSL from the return - @Query(fields = "{ publishedApplicationDSL : 0 , editingApplicationDSL : 0 }") + @Aggregation(pipeline = {"{ $project: { 'editingApplicationDSL.settings.category': 1, _id: 1, gid: 1, organizationId: 1, name: 1, applicationType: 1, applicationStatus: 1, publicToAll: 1, publicToMarketplace: 1, agencyProfile: 1, editingUserId: 1, lastEditedAt: 1, createdAt: 1, updatedAt: 1, createdBy: 1, modifiedBy: 1, _class: 1}}"}) Flux findByOrganizationId(String organizationId); @Override @Nonnull - @Query(fields = "{ publishedApplicationDSL : 0 , editingApplicationDSL : 0 }") + @Aggregation(pipeline = {"{ $project: { 'editingApplicationDSL.settings.category': 1, _id: 1, gid: 1, organizationId: 1, name: 1, applicationType: 1, applicationStatus: 1, publicToAll: 1, publicToMarketplace: 1, agencyProfile: 1, editingUserId: 1, lastEditedAt: 1, createdAt: 1, updatedAt: 1, createdBy: 1, modifiedBy: 1, _class: 1}}"}) Mono findById(@Nonnull String id); - @Query(fields = "{ publishedApplicationDSL : 0 , editingApplicationDSL : 0 }") + @Aggregation(pipeline = {"{ $project: { 'editingApplicationDSL.settings.category': 1, _id: 1, gid: 1, organizationId: 1, name: 1, applicationType: 1, applicationStatus: 1, publicToAll: 1, publicToMarketplace: 1, agencyProfile: 1, editingUserId: 1, lastEditedAt: 1, createdAt: 1, updatedAt: 1, createdBy: 1, modifiedBy: 1, _class: 1}}"}) Flux findByGid(@Nonnull String gid); Mono countByOrganizationIdAndApplicationStatus(String organizationId, ApplicationStatus applicationStatus);