From 2b68d59e51bda5a4ea2c65de06af833fd1cf21d7 Mon Sep 17 00:00:00 2001 From: FalkWolsky Date: Sun, 24 Mar 2024 19:21:15 +0100 Subject: [PATCH 1/6] Enabling display of Version Number for Remote Components --- client/packages/lowcoder/src/components/CompName.tsx | 1 + .../lowcoder/src/comps/comps/remoteComp/loaders.tsx | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/client/packages/lowcoder/src/components/CompName.tsx b/client/packages/lowcoder/src/components/CompName.tsx index 47d9edea2..78900c80e 100644 --- a/client/packages/lowcoder/src/components/CompName.tsx +++ b/client/packages/lowcoder/src/components/CompName.tsx @@ -83,6 +83,7 @@ export const CompName = (props: Iprops) => { const items: EditPopoverItemType[] = []; + // Falk: TODO - Implement upgrade for individual Version functionality const handleUpgrade = async () => { if (upgrading) { return; diff --git a/client/packages/lowcoder/src/comps/comps/remoteComp/loaders.tsx b/client/packages/lowcoder/src/comps/comps/remoteComp/loaders.tsx index 93011ee73..4353f9fbb 100644 --- a/client/packages/lowcoder/src/comps/comps/remoteComp/loaders.tsx +++ b/client/packages/lowcoder/src/comps/comps/remoteComp/loaders.tsx @@ -10,13 +10,17 @@ import { async function npmLoader( remoteInfo: RemoteCompInfo ): Promise { - const { packageName, packageVersion = "latest", compName } = remoteInfo; + + console.log("remoteInfo: ", remoteInfo); + + // Falk: removed "packageVersion = "latest" as default value fir packageVersion - to ensure no automatic version jumping. + + const { packageName, packageVersion, compName } = remoteInfo; const entry = `${NPM_PLUGIN_ASSETS_BASE_URL}/${packageName}@${packageVersion}/index.js`; // const entry = `../../../../../public/package/index.js`; // console.log("Entry", entry); try { const module = await import(/* webpackIgnore: true */ entry); - // console.log("Entry 1", module); const comp = module.default?.[compName]; if (!comp) { throw new Error(trans("npm.compNotFound", { compName })); From 17abd877c2c6f63535e880d8d798026cf09ef6da Mon Sep 17 00:00:00 2001 From: FalkWolsky Date: Sun, 24 Mar 2024 19:49:47 +0100 Subject: [PATCH 2/6] Update Helmet Tags --- .../lowcoder/src/pages/editor/editorView.tsx | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/client/packages/lowcoder/src/pages/editor/editorView.tsx b/client/packages/lowcoder/src/pages/editor/editorView.tsx index af1981c37..7671920d2 100644 --- a/client/packages/lowcoder/src/pages/editor/editorView.tsx +++ b/client/packages/lowcoder/src/pages/editor/editorView.tsx @@ -329,6 +329,9 @@ function EditorView(props: EditorViewProps) { const hideBodyHeader = useTemplateViewMode(); + // we check if we are on the public cloud + const isLowCoderDomain = window.location.hostname === 'app.lowcoder.cloud'; + if (readOnly && hideHeader) { return ( @@ -341,7 +344,23 @@ function EditorView(props: EditorViewProps) { if (readOnly && !showAppSnapshot) { return ( - {application && {application.name}} + + {application && {application.name}} + {isLowCoderDomain && ( + <> + {/* setting Meta Attributes to be able for embedding via iframely */} + + + + + + + {/* embedding analytics of Cleabits */} + + + )} + {application && {application.name}} + {!hideBodyHeader && } From df8c97ca7c122e8ff57560701626a6ace3230392 Mon Sep 17 00:00:00 2001 From: FalkWolsky Date: Sun, 24 Mar 2024 20:12:43 +0100 Subject: [PATCH 3/6] Fixing Helmet Tags Implementation --- client/packages/lowcoder/src/app.tsx | 25 +++++------- .../lowcoder/src/pages/editor/editorView.tsx | 39 ++++++++++++------- 2 files changed, 34 insertions(+), 30 deletions(-) diff --git a/client/packages/lowcoder/src/app.tsx b/client/packages/lowcoder/src/app.tsx index 838a9665c..b9837726f 100644 --- a/client/packages/lowcoder/src/app.tsx +++ b/client/packages/lowcoder/src/app.tsx @@ -111,21 +111,16 @@ class AppIndex extends React.Component { {{this.props.brandName}} {} - - {isLowCoderDomain && ( - <> - {/* setting Meta Attributes to be able for embedding via iframely */} - - - - - - - {/* embedding analytics of Cleabits */} - - - )} - + {isLowCoderDomain && [ + // Adding Support for iframely to be able to embedd the component explorer in the docu + , + , + , + , + , + // adding Clearbit Support for Analytics + + ]} diff --git a/client/packages/lowcoder/src/pages/editor/editorView.tsx b/client/packages/lowcoder/src/pages/editor/editorView.tsx index 7671920d2..9048c0959 100644 --- a/client/packages/lowcoder/src/pages/editor/editorView.tsx +++ b/client/packages/lowcoder/src/pages/editor/editorView.tsx @@ -346,20 +346,16 @@ function EditorView(props: EditorViewProps) { {application && {application.name}} - {isLowCoderDomain && ( - <> - {/* setting Meta Attributes to be able for embedding via iframely */} - - - - - - - {/* embedding analytics of Cleabits */} - - - )} - {application && {application.name}} + {isLowCoderDomain && [ + // Adding Support for iframely to be able to embedd the component explorer in the docu + , + , + , + , + , + // adding Clearbit Support for Analytics + + ]} {!hideBodyHeader && } @@ -373,6 +369,7 @@ function EditorView(props: EditorViewProps) { ); } + // history mode, display with the right panel, a little trick const showRight = panelStatus.right || showAppSnapshot; let uiCompView; @@ -411,7 +408,19 @@ function EditorView(props: EditorViewProps) { toggleEditorModeStatus={toggleEditorModeStatus} editorModeStatus={editorModeStatus} /> - {application && {application.name}} + + {application && {application.name}} + {isLowCoderDomain && [ + // Adding Support for iframely to be able to embedd the component explorer in the docu + , + , + , + , + , + // adding Clearbit Support for Analytics + + ]} + {showNewUserGuide && } Date: Sun, 24 Mar 2024 20:37:38 +0100 Subject: [PATCH 4/6] Adding DayJS plugins by Default --- .../lowcoder/src/util/dateTimeUtils.ts | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/client/packages/lowcoder/src/util/dateTimeUtils.ts b/client/packages/lowcoder/src/util/dateTimeUtils.ts index 1cfdb99ae..05146f359 100644 --- a/client/packages/lowcoder/src/util/dateTimeUtils.ts +++ b/client/packages/lowcoder/src/util/dateTimeUtils.ts @@ -1,6 +1,58 @@ +import { time } from "console"; import dayjs from "dayjs"; import relativeTime from "dayjs/plugin/relativeTime"; +import timezone from "dayjs/plugin/timezone"; +import duration from "dayjs/plugin/duration"; +import utc from "dayjs/plugin/utc"; +import quarterOfYear from "dayjs/plugin/quarterOfYear"; +import weekOfYear from "dayjs/plugin/weekOfYear"; +import isBetween from "dayjs/plugin/isBetween"; +import isToday from "dayjs/plugin/isToday"; +import isTomorrow from "dayjs/plugin/isTomorrow"; +import isYesterday from "dayjs/plugin/isYesterday"; +import customParseFormat from "dayjs/plugin/customParseFormat"; +import advancedFormat from "dayjs/plugin/advancedFormat"; +import updateLocale from "dayjs/plugin/updateLocale"; +import localeData from "dayjs/plugin/localeData"; +import localizedFormat from "dayjs/plugin/localizedFormat"; +import isLeapYear from "dayjs/plugin/isLeapYear"; +import isSameOrAfter from "dayjs/plugin/isSameOrAfter"; +import isSameOrBefore from "dayjs/plugin/isSameOrBefore"; +import isoWeek from "dayjs/plugin/isoWeek"; +import isoWeeksInYear from "dayjs/plugin/isoWeeksInYear"; +import weekYear from "dayjs/plugin/weekYear"; +import isMoment from "dayjs/plugin/isMoment"; +import calendar from "dayjs/plugin/calendar"; +import buddhistEra from "dayjs/plugin/buddhistEra"; +import minmax from "dayjs/plugin/minMax"; +import relativetime from "dayjs/plugin/relativeTime"; + dayjs.extend(relativeTime); +dayjs.extend(timezone); +dayjs.extend(duration); +dayjs.extend(utc); +dayjs.extend(quarterOfYear); +dayjs.extend(weekOfYear); +dayjs.extend(isBetween); +dayjs.extend(isToday); +dayjs.extend(isTomorrow); +dayjs.extend(isYesterday); +dayjs.extend(customParseFormat); +dayjs.extend(advancedFormat); +dayjs.extend(updateLocale); +dayjs.extend(localeData); +dayjs.extend(localizedFormat); +dayjs.extend(isLeapYear); +dayjs.extend(isSameOrAfter); +dayjs.extend(isSameOrBefore); +dayjs.extend(isoWeek); +dayjs.extend(isoWeeksInYear); +dayjs.extend(weekYear); +dayjs.extend(isMoment); +dayjs.extend(calendar); +dayjs.extend(buddhistEra); +dayjs.extend(minmax); +dayjs.extend(relativetime); export const TIME_FORMAT = "HH:mm:ss"; export const TIME_12_FORMAT = "HH:mm:ss:a"; From 28112a1b86f845e5ee40a5e31b58ea0437356f14 Mon Sep 17 00:00:00 2001 From: FalkWolsky Date: Sun, 24 Mar 2024 20:46:37 +0100 Subject: [PATCH 5/6] Adding all DayJS plugins by Default --- .../lowcoder/src/util/dateTimeUtils.ts | 68 ++++++++++++------- 1 file changed, 42 insertions(+), 26 deletions(-) diff --git a/client/packages/lowcoder/src/util/dateTimeUtils.ts b/client/packages/lowcoder/src/util/dateTimeUtils.ts index 05146f359..13de3d7cb 100644 --- a/client/packages/lowcoder/src/util/dateTimeUtils.ts +++ b/client/packages/lowcoder/src/util/dateTimeUtils.ts @@ -1,31 +1,39 @@ import { time } from "console"; import dayjs from "dayjs"; -import relativeTime from "dayjs/plugin/relativeTime"; -import timezone from "dayjs/plugin/timezone"; -import duration from "dayjs/plugin/duration"; -import utc from "dayjs/plugin/utc"; -import quarterOfYear from "dayjs/plugin/quarterOfYear"; -import weekOfYear from "dayjs/plugin/weekOfYear"; -import isBetween from "dayjs/plugin/isBetween"; -import isToday from "dayjs/plugin/isToday"; -import isTomorrow from "dayjs/plugin/isTomorrow"; -import isYesterday from "dayjs/plugin/isYesterday"; -import customParseFormat from "dayjs/plugin/customParseFormat"; -import advancedFormat from "dayjs/plugin/advancedFormat"; -import updateLocale from "dayjs/plugin/updateLocale"; -import localeData from "dayjs/plugin/localeData"; -import localizedFormat from "dayjs/plugin/localizedFormat"; -import isLeapYear from "dayjs/plugin/isLeapYear"; -import isSameOrAfter from "dayjs/plugin/isSameOrAfter"; -import isSameOrBefore from "dayjs/plugin/isSameOrBefore"; -import isoWeek from "dayjs/plugin/isoWeek"; -import isoWeeksInYear from "dayjs/plugin/isoWeeksInYear"; -import weekYear from "dayjs/plugin/weekYear"; -import isMoment from "dayjs/plugin/isMoment"; -import calendar from "dayjs/plugin/calendar"; -import buddhistEra from "dayjs/plugin/buddhistEra"; -import minmax from "dayjs/plugin/minMax"; -import relativetime from "dayjs/plugin/relativeTime"; +var relativeTime = require ("dayjs/plugin/relativeTime"); +var timezone = require ("dayjs/plugin/timezone"); +var duration = require ("dayjs/plugin/duration"); +var utc = require ("dayjs/plugin/utc"); +var quarterOfYear = require ("dayjs/plugin/quarterOfYear"); +var weekOfYear = require ("dayjs/plugin/weekOfYear"); +var isBetween = require ("dayjs/plugin/isBetween"); +var isToday = require ("dayjs/plugin/isToday"); +var isTomorrow = require ("dayjs/plugin/isTomorrow"); +var isYesterday = require ("dayjs/plugin/isYesterday"); +var customParseFormat = require ("dayjs/plugin/customParseFormat"); +var advancedFormat = require ("dayjs/plugin/advancedFormat"); +var updateLocale = require ("dayjs/plugin/updateLocale"); +var localeData = require ("dayjs/plugin/localeData"); +var localizedFormat = require ("dayjs/plugin/localizedFormat"); +var isLeapYear = require ("dayjs/plugin/isLeapYear"); +var isSameOrAfter = require ("dayjs/plugin/isSameOrAfter"); +var isSameOrBefore = require ("dayjs/plugin/isSameOrBefore"); +var isoWeek = require ("dayjs/plugin/isoWeek"); +var isoWeeksInYear = require ("dayjs/plugin/isoWeeksInYear"); +var weekYear = require ("dayjs/plugin/weekYear"); +var isMoment = require ("dayjs/plugin/isMoment"); +var calendar = require ("dayjs/plugin/calendar"); +var buddhistEra = require ("dayjs/plugin/buddhistEra"); +var minmax = require ("dayjs/plugin/minMax"); +var relativetime = require ("dayjs/plugin/relativeTime"); +var bigIntSupport = require("dayjs/plugin/bigIntSupport"); +var localizedFormat = require('dayjs/plugin/localizedFormat'); +var objectSupport = require("dayjs/plugin/objectSupport"); +var pluralGetSet = require('dayjs/plugin/pluralGetSet'); +var preParsePostFormat = require('dayjs/plugin/preParsePostFormat'); +var toObject = require('dayjs/plugin/toObject'); +var toUnix = require('dayjs/plugin/toUnix'); +var toArray = require('dayjs/plugin/toArray'); dayjs.extend(relativeTime); dayjs.extend(timezone); @@ -53,6 +61,14 @@ dayjs.extend(calendar); dayjs.extend(buddhistEra); dayjs.extend(minmax); dayjs.extend(relativetime); +dayjs.extend(bigIntSupport); +dayjs.extend(localizedFormat); +dayjs.extend(objectSupport); +dayjs.extend(pluralGetSet); +dayjs.extend(preParsePostFormat); +dayjs.extend(toObject); +dayjs.extend(toUnix); +dayjs.extend(toArray); export const TIME_FORMAT = "HH:mm:ss"; export const TIME_12_FORMAT = "HH:mm:ss:a"; From dafdd3a5b3f7f836f41605a4a6f2c416d994e06b Mon Sep 17 00:00:00 2001 From: FalkWolsky Date: Sun, 24 Mar 2024 20:55:08 +0100 Subject: [PATCH 6/6] Fixing - adding all DayJS plugins by Default --- .../lowcoder/src/util/dateTimeUtils.ts | 68 +++++++++---------- 1 file changed, 32 insertions(+), 36 deletions(-) diff --git a/client/packages/lowcoder/src/util/dateTimeUtils.ts b/client/packages/lowcoder/src/util/dateTimeUtils.ts index 13de3d7cb..4ec6cea67 100644 --- a/client/packages/lowcoder/src/util/dateTimeUtils.ts +++ b/client/packages/lowcoder/src/util/dateTimeUtils.ts @@ -1,39 +1,36 @@ import { time } from "console"; import dayjs from "dayjs"; -var relativeTime = require ("dayjs/plugin/relativeTime"); -var timezone = require ("dayjs/plugin/timezone"); -var duration = require ("dayjs/plugin/duration"); -var utc = require ("dayjs/plugin/utc"); -var quarterOfYear = require ("dayjs/plugin/quarterOfYear"); -var weekOfYear = require ("dayjs/plugin/weekOfYear"); -var isBetween = require ("dayjs/plugin/isBetween"); -var isToday = require ("dayjs/plugin/isToday"); -var isTomorrow = require ("dayjs/plugin/isTomorrow"); -var isYesterday = require ("dayjs/plugin/isYesterday"); -var customParseFormat = require ("dayjs/plugin/customParseFormat"); -var advancedFormat = require ("dayjs/plugin/advancedFormat"); -var updateLocale = require ("dayjs/plugin/updateLocale"); -var localeData = require ("dayjs/plugin/localeData"); -var localizedFormat = require ("dayjs/plugin/localizedFormat"); -var isLeapYear = require ("dayjs/plugin/isLeapYear"); -var isSameOrAfter = require ("dayjs/plugin/isSameOrAfter"); -var isSameOrBefore = require ("dayjs/plugin/isSameOrBefore"); -var isoWeek = require ("dayjs/plugin/isoWeek"); -var isoWeeksInYear = require ("dayjs/plugin/isoWeeksInYear"); -var weekYear = require ("dayjs/plugin/weekYear"); -var isMoment = require ("dayjs/plugin/isMoment"); -var calendar = require ("dayjs/plugin/calendar"); -var buddhistEra = require ("dayjs/plugin/buddhistEra"); -var minmax = require ("dayjs/plugin/minMax"); -var relativetime = require ("dayjs/plugin/relativeTime"); -var bigIntSupport = require("dayjs/plugin/bigIntSupport"); -var localizedFormat = require('dayjs/plugin/localizedFormat'); -var objectSupport = require("dayjs/plugin/objectSupport"); -var pluralGetSet = require('dayjs/plugin/pluralGetSet'); -var preParsePostFormat = require('dayjs/plugin/preParsePostFormat'); -var toObject = require('dayjs/plugin/toObject'); -var toUnix = require('dayjs/plugin/toUnix'); -var toArray = require('dayjs/plugin/toArray'); +import relativeTime from "dayjs/plugin/relativeTime"; +import timezone from "dayjs/plugin/timezone"; +import duration from "dayjs/plugin/duration"; +import utc from "dayjs/plugin/utc"; +import quarterOfYear from "dayjs/plugin/quarterOfYear"; +import weekOfYear from "dayjs/plugin/weekOfYear"; +import isBetween from "dayjs/plugin/isBetween"; +import isToday from "dayjs/plugin/isToday"; +import isTomorrow from "dayjs/plugin/isTomorrow"; +import isYesterday from "dayjs/plugin/isYesterday"; +import customParseFormat from "dayjs/plugin/customParseFormat"; +import advancedFormat from "dayjs/plugin/advancedFormat"; +import updateLocale from "dayjs/plugin/updateLocale"; +import localeData from "dayjs/plugin/localeData"; +import localizedFormat from "dayjs/plugin/localizedFormat"; +import isLeapYear from "dayjs/plugin/isLeapYear"; +import isSameOrAfter from "dayjs/plugin/isSameOrAfter"; +import isSameOrBefore from "dayjs/plugin/isSameOrBefore"; +import isoWeek from "dayjs/plugin/isoWeek"; +import isoWeeksInYear from "dayjs/plugin/isoWeeksInYear"; +import weekYear from "dayjs/plugin/weekYear"; +import isMoment from "dayjs/plugin/isMoment"; +import calendar from "dayjs/plugin/calendar"; +import buddhistEra from "dayjs/plugin/buddhistEra"; +import minmax from "dayjs/plugin/minMax"; +import bigIntSupport from "dayjs/plugin/bigIntSupport"; +import objectSupport from "dayjs/plugin/objectSupport"; +import pluralGetSet from 'dayjs/plugin/pluralGetSet'; +import preParsePostFormat from 'dayjs/plugin/preParsePostFormat'; +import toObject from 'dayjs/plugin/toObject'; +import toArray from 'dayjs/plugin/toArray'; dayjs.extend(relativeTime); dayjs.extend(timezone); @@ -60,14 +57,13 @@ dayjs.extend(isMoment); dayjs.extend(calendar); dayjs.extend(buddhistEra); dayjs.extend(minmax); -dayjs.extend(relativetime); +dayjs.extend(relativeTime); dayjs.extend(bigIntSupport); dayjs.extend(localizedFormat); dayjs.extend(objectSupport); dayjs.extend(pluralGetSet); dayjs.extend(preParsePostFormat); dayjs.extend(toObject); -dayjs.extend(toUnix); dayjs.extend(toArray); export const TIME_FORMAT = "HH:mm:ss";