Skip to content

Cherry release - hotfix #770

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 10 additions & 15 deletions client/packages/lowcoder/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,21 +111,16 @@ class AppIndex extends React.Component<AppIndexProps, any> {
{<title>{this.props.brandName}</title>}
{<link rel="icon" href={this.props.favicon} />}
<meta name="description" content={trans("productDesc")} />

{isLowCoderDomain && (
<>
{/* setting Meta Attributes to be able for embedding via iframely */}
<meta property="iframely:title" content="Lowcoder" />
<meta property="iframely:description" content="Lowcoder | rapid App & VideoMeeting builder for everyone." />

<link rel="preconnect" href="https://fonts.googleapis.com"/>
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous"/>
<link href="https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,700;1,400&display=swap" rel="stylesheet"/>
{/* embedding analytics of Cleabits */}
<script src="https://tag.clearbitscripts.com/v1/pk_931b51e405557300e6a7c470e8247d5f/tags.js" referrerPolicy="strict-origin-when-cross-origin"></script>
</>
)}

{isLowCoderDomain && [
// Adding Support for iframely to be able to embedd the component explorer in the docu
<meta key="iframely:title" property="iframely:title" content="Lowcoder" />,
<meta key="iframely:description" property="iframely:description" content="Lowcoder | rapid App & VideoMeeting builder for everyone." />,
<link key="preconnect-googleapis" rel="preconnect" href="https://fonts.googleapis.com" />,
<link key="preconnect-gstatic" rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />,
<link key="font-ubuntu" href="https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,700;1,400&display=swap" rel="stylesheet" />,
// adding Clearbit Support for Analytics
<script key="clearbit-script" src="https://tag.clearbitscripts.com/v1/pk_931b51e405557300e6a7c470e8247d5f/tags.js" referrerPolicy="strict-origin-when-cross-origin" type="text/javascript"></script>
]}
</Helmet>
<SystemWarning />
<Router history={history}>
Expand Down
1 change: 1 addition & 0 deletions client/packages/lowcoder/src/components/CompName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@ import {
async function npmLoader(
remoteInfo: RemoteCompInfo
): Promise<CompConstructor | null> {
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 }));
Expand Down
32 changes: 30 additions & 2 deletions client/packages/lowcoder/src/pages/editor/editorView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<CustomShortcutWrapper>
Expand All @@ -341,7 +344,19 @@ function EditorView(props: EditorViewProps) {
if (readOnly && !showAppSnapshot) {
return (
<CustomShortcutWrapper>
<Helmet>{application && <title>{application.name}</title>}</Helmet>
<Helmet>
{application && <title>{application.name}</title>}
{isLowCoderDomain && [
// Adding Support for iframely to be able to embedd the component explorer in the docu
<meta key="iframely:title" property="iframely:title" content="Lowcoder" />,
<meta key="iframely:description" property="iframely:description" content="Lowcoder | rapid App & VideoMeeting builder for everyone." />,
<link key="preconnect-googleapis" rel="preconnect" href="https://fonts.googleapis.com" />,
<link key="preconnect-gstatic" rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />,
<link key="font-ubuntu" href="https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,700;1,400&display=swap" rel="stylesheet" />,
// adding Clearbit Support for Analytics
<script key="clearbit-script" src="https://tag.clearbitscripts.com/v1/pk_931b51e405557300e6a7c470e8247d5f/tags.js" referrerPolicy="strict-origin-when-cross-origin" type="text/javascript"></script>
]}
</Helmet>
{!hideBodyHeader && <PreviewHeader />}
<EditorContainerWithViewMode>
<ViewBody $hideBodyHeader={hideBodyHeader} $height={height}>
Expand All @@ -354,6 +369,7 @@ function EditorView(props: EditorViewProps) {
</CustomShortcutWrapper>
);
}

// history mode, display with the right panel, a little trick
const showRight = panelStatus.right || showAppSnapshot;
let uiCompView;
Expand Down Expand Up @@ -392,7 +408,19 @@ function EditorView(props: EditorViewProps) {
toggleEditorModeStatus={toggleEditorModeStatus}
editorModeStatus={editorModeStatus}
/>
<Helmet>{application && <title>{application.name}</title>}</Helmet>
<Helmet>
{application && <title>{application.name}</title>}
{isLowCoderDomain && [
// Adding Support for iframely to be able to embedd the component explorer in the docu
<meta key="iframely:title" property="iframely:title" content="Lowcoder" />,
<meta key="iframely:description" property="iframely:description" content="Lowcoder | rapid App & VideoMeeting builder for everyone." />,
<link key="preconnect-googleapis" rel="preconnect" href="https://fonts.googleapis.com" />,
<link key="preconnect-gstatic" rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />,
<link key="font-ubuntu" href="https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,700;1,400&display=swap" rel="stylesheet" />,
// adding Clearbit Support for Analytics
<script key="clearbit-script" src="https://tag.clearbitscripts.com/v1/pk_931b51e405557300e6a7c470e8247d5f/tags.js" referrerPolicy="strict-origin-when-cross-origin" type="text/javascript"></script>
]}
</Helmet>
{showNewUserGuide && <EditorTutorials />}
<EditorGlobalHotKeys
disabled={readOnly}
Expand Down
64 changes: 64 additions & 0 deletions client/packages/lowcoder/src/util/dateTimeUtils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,70 @@
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 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);
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);
dayjs.extend(bigIntSupport);
dayjs.extend(localizedFormat);
dayjs.extend(objectSupport);
dayjs.extend(pluralGetSet);
dayjs.extend(preParsePostFormat);
dayjs.extend(toObject);
dayjs.extend(toArray);

export const TIME_FORMAT = "HH:mm:ss";
export const TIME_12_FORMAT = "HH:mm:ss:a";
Expand Down