Content-Length: 726252 | pFad | http://github.com/lowcoder-org/lowcoder/pull/1318/commits/12c6654c79b54e30f5f21968421707baf4d4a173

F2 Dev > Main for v2.5 Release by FalkWolsky · Pull Request #1318 · lowcoder-org/lowcoder · GitHub
Skip to content

Dev > Main for v2.5 Release #1318

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 162 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
162 commits
Select commit Hold shift + click to select a range
381663b
Merge pull request #1181 from lowcoder-org/main
FalkWolsky Sep 21, 2024
12c6654
Subscription Description content
Sep 21, 2024
f41b3e3
Merge branch 'dev' into subscription-handling
FalkWolsky Sep 28, 2024
b82b19e
Subscription Detail Page
Sep 28, 2024
6eff60b
Adding Help for Subscription
Sep 28, 2024
9c3e246
Merge branch 'dev' into subscription-handling
FalkWolsky Oct 5, 2024
3f216d8
Introduce hostId
Oct 5, 2024
77dcd3d
Update Subscription Search API handling
Oct 5, 2024
21cff58
Updating Routes to display success and cancel for Subscription Creation
Oct 5, 2024
e1ca7dc
added deployment_id actions
raheeliftikhar5 Oct 5, 2024
f9616aa
actions and selectors for deploymentId
raheeliftikhar5 Oct 5, 2024
dd1784b
Getting Workspace User Count
Oct 5, 2024
5eeeb0f
Adding Success Page
Oct 9, 2024
a545620
Merge branch 'dev' into subscription-handling
FalkWolsky Oct 26, 2024
9b2334f
Fixing Blank Screen bug
Oct 26, 2024
50b8eb9
Introduce DeploymentID for Subscription-Check
Oct 26, 2024
fc08749
Subscription System Roundup
Oct 26, 2024
7786f32
forbid email login that is disabled
dragonpoo Oct 29, 2024
3a6ab48
move SubscriptionTypeEnum and initial subscription products in consta…
raheeliftikhar5 Oct 31, 2024
f918ac5
removed unused code + avoid fetching subscription again
raheeliftikhar5 Oct 31, 2024
3bee7f1
remove polling for deploymentId in fetching user subscription
raheeliftikhar5 Oct 31, 2024
e44fd52
removed InitializeSubscription hook + added SubscriptionContext to ha…
raheeliftikhar5 Oct 31, 2024
5e7395e
fixed error message
raheeliftikhar5 Oct 31, 2024
bfbcd9e
Merge branch 'dev' into subscription-handling
FalkWolsky Nov 1, 2024
ba9b6c1
fix search for support tickets
raheeliftikhar5 Nov 1, 2024
5af6c32
datasource list loading fix
raheeliftikhar5 Nov 1, 2024
cde7340
Merge pull request #1275 from lowcoder-org/updates-subscription-handling
FalkWolsky Nov 2, 2024
b40c81a
Introduce Rich Text Editor for Ticket Description
Nov 2, 2024
3868a94
Network Retry mechanism for Flow API
Nov 2, 2024
15cc8a3
Moving Context to make sure Subscription is initialized at Admin Portal
Nov 2, 2024
efd7f25
Changing to SimpleSubscriptionContextProvider for Homepage
Nov 2, 2024
a0843e9
Handling empty Tickets Table
Nov 2, 2024
9a4fb96
Updating Yarn Lock File for Node Service
Nov 2, 2024
739431a
Same Editor Settings for Ticket Details
Nov 2, 2024
dd3e9db
Adapting Payload for Ticket System
Nov 2, 2024
c66018b
Fixing timing issue
Nov 2, 2024
2123eb7
Send less data & receive better Subscription Context
Nov 2, 2024
bdc7d6e
Updating OpenAPI Spec
Nov 2, 2024
87b235b
Fixing Image Display
Nov 4, 2024
3464e6b
send cookies in npm package meta request
raheeliftikhar5 Nov 4, 2024
458a62c
add group admin count and user count to list api
dragonpoo Nov 5, 2024
0ffa805
fix extra spacing issue in cavas
raheeliftikhar5 Nov 5, 2024
6bb1d91
modify admin user count for all user group
dragonpoo Nov 5, 2024
513cd2c
upgrade sdk version to 2.4.15
raheeliftikhar5 Nov 5, 2024
4e11434
add group admin count and user count to list api
dragonpoo Nov 5, 2024
831abed
modify admin user count for all user group
dragonpoo Nov 5, 2024
fcf6596
Merge pull request #1283 from lowcoder-org/feature/group_api
FalkWolsky Nov 5, 2024
fec51dd
count subscription users from groups list
raheeliftikhar5 Nov 6, 2024
ed6d362
Modify counting logic based on org role
dragonpoo Nov 5, 2024
fb3aecf
fix lowcoder-comps base url in embedded apps
raheeliftikhar5 Nov 7, 2024
06f72bb
fix imports
raheeliftikhar5 Nov 7, 2024
b64013a
implemented new auth flow
raheeliftikhar5 Oct 23, 2024
948dd93
show error where user doesn't belong to workspace
raheeliftikhar5 Oct 23, 2024
2b21161
show auth providers for selected workspace
raheeliftikhar5 Oct 24, 2024
bf4fb3c
redirect to signup page if no workspace found on login
raheeliftikhar5 Oct 24, 2024
b8284c5
added delete auth provider functionality
raheeliftikhar5 Oct 24, 2024
cb594ee
show new auth flow when user is invited or joins by org url
raheeliftikhar5 Oct 25, 2024
5d1f636
added admin login page
raheeliftikhar5 Oct 28, 2024
0f71d0f
Allow delete for disabled auth provider
raheeliftikhar5 Nov 6, 2024
5fd7403
hide password field and signup option when Email based auth is disabled
raheeliftikhar5 Nov 6, 2024
9c0b997
On signup, when user enter emails and it already exists then redirect…
raheeliftikhar5 Nov 6, 2024
2a95c20
small fix
raheeliftikhar5 Nov 7, 2024
9ca6647
Add statistic fields to group list api
dragonpoo Nov 7, 2024
f838d86
show/hide sign up page based on LOWCODER_EMAIL_SIGNUP_ENABLED flag fr…
raheeliftikhar5 Nov 7, 2024
5022ecf
Merge pull request #1285 from lowcoder-org/feature/group_api
FalkWolsky Nov 7, 2024
012532f
Merge branch 'dev' into feat_auth_flow
FalkWolsky Nov 7, 2024
b21c044
Merge pull request #1253 from lowcoder-org/feat_auth_flow
FalkWolsky Nov 7, 2024
4ccb1d1
save org user stats and use totalAdminsAndDevelopers count for subscr…
raheeliftikhar5 Nov 8, 2024
88ec6f4
Merge pull request #1286 from lowcoder-org/subscription-users-count
FalkWolsky Nov 8, 2024
5cc7ebe
Merge branch 'dev' into subscription-handling
FalkWolsky Nov 9, 2024
e6d81cf
Switching to Production
Nov 9, 2024
22b3faf
Enable Clearbit for all
Nov 9, 2024
874ede4
Improving Firestore Firebase Datasource
Nov 10, 2024
97302c1
updated row height range
raheeliftikhar5 Nov 11, 2024
68f3939
Improving Firestore Firebase Datasource 2
Nov 11, 2024
0cef08c
fixed hillchart for lowcoder-cli-template
raheeliftikhar5 Nov 11, 2024
5528883
upgrade version of lowcoder-cli-template-typescript
raheeliftikhar5 Nov 11, 2024
0d9424e
Roundup Query Capability in Firebase Data Source
Nov 11, 2024
7c33555
Fixed serveral sidebar issue
Imiss-U1025 Nov 11, 2024
5e26578
fix dropdownlist api
dragonpoo Nov 11, 2024
8ae6b32
Merge pull request #1267 from lowcoder-org/fix/disabled_email
FalkWolsky Nov 11, 2024
fb0b3b5
Merge pull request #1294 from lowcoder-org/feature/SideBar
FalkWolsky Nov 11, 2024
6952535
Merge pull request #1295 from lowcoder-org/fix/dropDownList
FalkWolsky Nov 11, 2024
00a624d
Enable Caching for the Node-Service
Nov 12, 2024
4103d6f
Updating Yarn Lock for Node Service
Nov 13, 2024
86de505
Improve caching mechanism
Nov 13, 2024
c446853
Enabling OpenAI and Version-Update
Nov 13, 2024
7158453
Improvements for OpenAI Data Source
Nov 13, 2024
2ef9b83
Added pagination to application list endpoint
dragonpoo Nov 13, 2024
2f24eda
Added pagination to folder elements endpoint
dragonpoo Nov 13, 2024
6e48a57
fix the path issue
dragonpoo Nov 11, 2024
3a57836
added image capture option in file upload comp
raheeliftikhar5 Nov 14, 2024
fc9ee24
fix visibility issue on text overflow table columns
raheeliftikhar5 Nov 14, 2024
0624105
added multi-sorting for table columns
raheeliftikhar5 Nov 14, 2024
72a7b26
added destroyInactiveTabPane flag in tab comp
raheeliftikhar5 Nov 14, 2024
0b89f47
Merge branch 'dev' into feat/image_capture
FalkWolsky Nov 14, 2024
e11e951
Merge pull request #1303 from lowcoder-org/feat/image_capture
FalkWolsky Nov 14, 2024
bd5d445
Added folderListTitle trans item.
Imiss-U1025 Nov 14, 2024
eb119ad
Added folder in extensions of right panel.
Imiss-U1025 Nov 14, 2024
fc4f9a8
added icon dictionary to avoid downloading icons again
raheeliftikhar5 Nov 14, 2024
1580a02
added switch to load module in DOM when hide
raheeliftikhar5 Nov 14, 2024
a381ff7
updated switch name
raheeliftikhar5 Nov 14, 2024
931fd16
Merge pull request #1304 from lowcoder-org/fixes/table
FalkWolsky Nov 14, 2024
8c3bcbe
Merge pull request #1306 from lowcoder-org/feature-extension
FalkWolsky Nov 14, 2024
5024eb9
fix data mapping issue
raheeliftikhar5 Nov 14, 2024
4b8c585
Updating Axios to 1.7.7
Nov 14, 2024
d42d41b
Updating Axios to 1.7.7
Nov 14, 2024
416d559
Updating Versions for upcoming Release
Nov 14, 2024
6d3f013
Added examples for Existing Components - Demo
adnanqaops Nov 15, 2024
f3cd13b
fix sorting for custom columns and columns with nested data map in table
raheeliftikhar5 Nov 15, 2024
b83efb2
fix comps overlap issue
raheeliftikhar5 Nov 15, 2024
d11e2ec
Updating Firebase Datasource
Nov 15, 2024
5042729
Bump pino from 8.21.0 to 9.5.0 in /server/node-service
dependabot[bot] Nov 15, 2024
cb5f4e3
Bump duckdb-async from 0.10.2 to 1.1.3 in /server/node-service
dependabot[bot] Nov 15, 2024
67332c2
separate defaultValue and value for switch comp
raheeliftikhar5 Nov 15, 2024
8b22bef
separate defaultValue and value for date comps
raheeliftikhar5 Nov 15, 2024
079e482
separate defaultValue and value for time comps
raheeliftikhar5 Nov 15, 2024
32e8c4d
Merge pull request #1309 from lowcoder-org/fixes/listview
FalkWolsky Nov 15, 2024
a7c1b5a
Merge branch 'dev' into dependabot/npm_and_yarn/server/node-service/d…
FalkWolsky Nov 15, 2024
3cb6ddc
Merge pull request #1307 from lowcoder-org/dependabot/npm_and_yarn/se…
FalkWolsky Nov 15, 2024
988bab2
Merge branch 'dev' into dependabot/npm_and_yarn/server/node-service/d…
FalkWolsky Nov 15, 2024
e6575e4
Merge pull request #1259 from lowcoder-org/dependabot/npm_and_yarn/se…
FalkWolsky Nov 15, 2024
d09cae7
Updating Node-Service Dependencies
Nov 15, 2024
870a6e6
Merge pull request #1308 from lowcoder-org/doc/existing_components
FalkWolsky Nov 15, 2024
86ca61e
Updating Node-Service and Activate DuckDB
Nov 15, 2024
a8da7a1
Fixing Image Component Demo
Nov 15, 2024
06d68ed
Fixing components Docu to not exclude Dashboards section
Nov 15, 2024
9985ac8
Rounding up Subscriptions
Nov 16, 2024
fa6d12d
Removing @types/axios as Axios brings its own types already
Nov 16, 2024
b2675ad
Updating Yarn Lock for Client
Nov 16, 2024
0a4314e
fix cursor jumping issue
raheeliftikhar5 Nov 16, 2024
30afbd5
Updating OpenAI v2.3 API Spec
Nov 16, 2024
1658c18
Fixing overlaping Code Editor Window
Nov 16, 2024
9618206
Extending the JSON Schema Forms to alow responsive view in the container
Nov 16, 2024
1538670
Updating Yarn Lock file
Nov 17, 2024
54e1b50
Rollback RJSF in Dev to use a feature branch
Nov 17, 2024
1cdbf34
fixed default value for form comps inside listview doesn't reflect on…
raheeliftikhar5 Nov 17, 2024
c7bddbf
Work in Progress for Responsive Layout
Nov 17, 2024
81b6dfd
disable comp select/drag/drop inside table expansions
raheeliftikhar5 Nov 17, 2024
bc38c79
update subscriptiont thank you text
raheeliftikhar5 Nov 17, 2024
5c27563
Add pagination total
dragonpoo Nov 14, 2024
92a39de
Add pagination to group, org, bundle
dragonpoo Nov 14, 2024
aa4c16f
Fix sublist params
dragonpoo Nov 14, 2024
82c64d7
add pagination to groupmember, orgmember
dragonpoo Nov 15, 2024
352e746
add pagination to datasource
dragonpoo Nov 15, 2024
9c8900b
add pagination to library query
dragonpoo Nov 18, 2024
ce82860
upgrade react-markdown in lowcoder-design
raheeliftikhar5 Nov 18, 2024
6153ddf
upgrade react-markdown in lowcoder-design
raheeliftikhar5 Nov 18, 2024
fd94adc
Enable Responsiveness for JSON Schema Form
Nov 18, 2024
36709ac
Merge branch 'dev' into json-schema-form-layouts
FalkWolsky Nov 18, 2024
11ef7f3
expose setMultiSort function and sortColumns with table
raheeliftikhar5 Nov 18, 2024
9dc0a89
multiple images support for capture in file upload
raheeliftikhar5 Nov 18, 2024
4f29a3e
Merge pull request #1316 from lowcoder-org/json-schema-form-layouts
FalkWolsky Nov 18, 2024
c771ef9
remove unused code
raheeliftikhar5 Nov 18, 2024
ed1a330
Merge branch 'dev' into subscription-handling
FalkWolsky Nov 18, 2024
74e59cc
Merge pull request #1197 from lowcoder-org/subscription-handling
FalkWolsky Nov 18, 2024
b34f6d7
Updating Version Numbers for v2.5
Nov 18, 2024
a347f9e
Reverted extension.
Imiss-U1025 Nov 19, 2024
3880389
Merge pull request #1317 from lowcoder-org/feature-extension-revert
FalkWolsky Nov 19, 2024
39b0370
fix drawer comp issues
raheeliftikhar5 Nov 19, 2024
73adc1a
Enabling Single-Level & Multi-Level JSON Schema Form definitions
Nov 19, 2024
b151ff5
fixed interactive comp playground
raheeliftikhar5 Nov 19, 2024
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
Prev Previous commit
Next Next commit
Subscription Description content
  • Loading branch information
FalkWolsky committed Sep 21, 2024
commit 12c6654c79b54e30f5f21968421707baf4d4a173
1 change: 1 addition & 0 deletions client/packages/lowcoder/src/api/subscriptionApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ export const InitializeSubscription = () => {
const [subscriptionDataError, setSubscriptionDataError] = useState<boolean>(false);
const [checkoutLinkDataLoaded, setCheckoutLinkDataLoaded] = useState<boolean>(false);
const [checkoutLinkDataError, setCheckoutLinkDataError] = useState<boolean>(false);

const [products, setProducts] = useState<Product[]>([
{
pricingType: "Monthly, per User",
Expand Down
6 changes: 2 additions & 4 deletions client/packages/lowcoder/src/pages/ApplicationV2/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ import {
ALL_APPLICATIONS_URL,
DATASOURCE_URL,
FOLDER_URL,
FOLDER_URL_PREFIX,
FOLDERS_URL,
MARKETPLACE_URL,
// MODULE_APPLICATIONS_URL,
QUERY_LIBRARY_URL,
SETTING_URL,
SUPPORT_URL,
Expand Down Expand Up @@ -296,7 +294,7 @@ export default function ApplicationHome() {
],
} : { items: [] },

/* supportSubscription ? {
supportSubscription ? {
items: [
{
text: <TabLabel>{trans("home.support")}</TabLabel>,
Expand All @@ -306,7 +304,7 @@ export default function ApplicationHome() {
icon: ({ selected, ...otherProps }) => selected ? <SupportIcon {...otherProps} width={"24px"}/> : <SupportIcon {...otherProps} width={"24px"}/>,
},
],
} : { items: [] }, */
} : { items: [] },

{
items: [
Expand Down
5 changes: 5 additions & 0 deletions client/packages/lowcoder/src/pages/setting/settingHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ export function SettingHome() {
!currentOrgAdmin(user) ||
!enableCustomBrand(config) ||
(!isSelfDomain(config) && !isEnterpriseMode(config)),
},
{
key: SettingPageEnum.Subscription,
label: trans("settings.subscription"),
icon: <SubscriptionIcon width={"20px"}/>,
}
];

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
const ProductDescriptions: ProductDescription = {

// Support & Ticket System Subscription

SupportProduct : {
"en" : `
# Lowcoder Support Subscription

## Overview

**Support** is a "per Workspace" (Organization) subscription. This means that all Admins and Editing Users (Developers) within the Workspace, but not "Members" (viewers only), can automatically use this subscription and create their own support tickets. Typically, a Workspace Admin activates the Support Subscription.

The subscription is **calculated monthly** based on the number of Admins & Editing Users. Normal App Viewers are **not charged** and cannot access the Support Center.

## Support Center

The **Support Center** provides an overview of all your support tickets, including the current status of each ticket and the assigned Lowcoder support staff. Each ticket has a detailed page where you can:
- View and edit the full ticket description
- Add attachments
- Leave comments

## Commitment to Your Success

We offer a support system because we are **dedicated to the success** of Lowcoder users! It’s a key value for us, and we will always strive to provide the best support possible.

## Support SLA

We keep our **Service Level Agreement (SLA)** simple:
- We aim to **respond within 1 business day**.
- Our business hours are from **8am to 10pm GMT**.

## Support Levels

1. **First Level Support**: Our initial response aims to resolve your questions quickly.
2. **Second Level Support**: If a deeper technical issue arises, we escalate it to Second Level Support. This is reflected in the ticket's status.

## Bug Fixing Policy

For bug fixes, we aim to resolve issues **within a workweek or faster**. We provide a \`/dev\` or \`/latest\` tagged Docker image for self-hosted installations to quickly apply updates. The actual update process is not in our hands.

For users on \`app.lowcoder.cloud\`, updates are typically done during regular releases, which occur every **two months**. Only in exceptional cases do we apply updates outside of these scheduled releases.

## Platform Focus

We do not develop custom apps for companies, as our primary focus is improving the Lowcoder platform. However, through our support system, we welcome all **questions and suggestions** that help Lowcoder users create their own apps.

## Pricing Table

| User Type | Monthly Price Per User |
|----------------------|------------------------|
| Admin & Editor | €2.90 |
| More than 10 Users | €1.90 |
| More than 100 Users | €0.90 |
| More than 500 Users | €0.49 |
| More than 1,000 Users | €0.29 |
| More than 10,000 Users| €0.19 |
`,

"de": `
# Lowcoder Support-Abonnement

## Übersicht

**Support** ist ein "pro Workspace" (Organisation) Abonnement. Das bedeutet, dass alle Administratoren und Bearbeiter (Entwickler) innerhalb des Workspaces, aber nicht "Mitglieder" (nur Zuschauer), automatisch dieses Abonnement nutzen und ihre eigenen Support-Tickets erstellen können. Typischerweise aktiviert ein Workspace-Administrator das Support-Abonnement.

Das Abonnement wird **monatlich** basierend auf der Anzahl der Administratoren und Bearbeiter berechnet. Normale App-Zuschauer **werden nicht berechnet** und können auf das Support-Center nicht zugreifen.

## Support-Center

Das **Support-Center** bietet einen Überblick über alle Ihre Support-Tickets, einschließlich des aktuellen Status jedes Tickets und des zugewiesenen Lowcoder-Supportmitarbeiters. Jedes Ticket hat eine Detailseite, auf der Sie:
- die vollständige Ticketbeschreibung anzeigen und bearbeiten können
- Anhänge hinzufügen
- Kommentare hinterlassen

## Engagement für Ihren Erfolg

Wir bieten ein Support-System an, weil wir **engagiert für den Erfolg** der Lowcoder-Nutzer sind! Es ist ein zentraler Wert für uns, und wir werden immer versuchen, den bestmöglichen Support zu bieten.

## Support-SLA

Wir halten unser **Service Level Agreement (SLA)** einfach:
- Wir versuchen, **innerhalb eines Geschäftstags zu antworten**.
- Unsere Geschäftszeiten sind von **8 Uhr bis 22 Uhr GMT**.

## Support-Levels

1. **Erster Level-Support**: Unser erster Kontakt versucht, Ihre Fragen schnell zu klären.
2. **Zweiter Level-Support**: Wenn ein tiefergehendes technisches Problem auftritt, eskalieren wir es zum Zweiten Level-Support. Dies spiegelt sich im Status des Tickets wider.

## Fehlerbehebungspolitik

Bei Fehlerbehebungen versuchen wir, Probleme **innerhalb einer Arbeitswoche oder schneller** zu lösen. Wir bieten ein \`/dev\` oder \`/latest\` getaggtes Docker-Image für selbst gehostete Installationen an, um Updates schnell anzuwenden. Der tatsächliche Update-Prozess liegt nicht in unserer Hand.

Für Benutzer auf \`app.lowcoder.cloud\` werden Updates in der Regel während regulärer Releases durchgeführt, die alle **zwei Monate** stattfinden. Nur in außergewöhnlichen Fällen wenden wir Updates außerhalb dieser geplanten Releases an.

## Plattformfokus

Wir entwickeln keine benutzerdefinierten Apps für Unternehmen, da unser Hauptfokus auf der Verbesserung der Lowcoder-Plattform liegt. Durch unser Support-System heißen wir jedoch alle **Fragen und Vorschläge** willkommen, die Lowcoder-Nutzern helfen, ihre eigenen Apps zu erstellen.

## Preistabelle

| Benutzerart | Monatlicher Preis pro Benutzer |
|------------------------|--------------------------------|
| Administrator & Bearbeiter | €2.90 |
| Mehr als 10 Benutzer | €1.90 |
| Mehr als 100 Benutzer | €0.90 |
| Mehr als 500 Benutzer | €0.49 |
| Mehr als 1.000 Benutzer | €0.29 |
| Mehr als 10.000 Benutzer| €0.19 |
`
},

// Media Package Subscription

MediaPackageProduct: {
"en": `
# Media Package Subscription

## Overview

... (Add English description)
`,
"de": `
# Medienpaket-Abonnement

## Übersicht

... (Add German description)
`
}
};

export type Translations = {
[key: string]: string; // Each language key maps to a string
};

export type ProductDescription = {
[productId: string]: Translations; // Each product ID maps to its translations
};

export default ProductDescriptions;

Original file line number Diff line number Diff line change
@@ -1,25 +1,36 @@
import { ArrowIcon } from "lowcoder-design";
import styled from "styled-components";
import { trans } from "i18n";
import { trans } from "i18n"; // Assuming this is how you get the user's language
import { useParams } from "react-router-dom";
import { HeaderBack } from "../permission/styledComponents";
import history from "util/history";
import { SUBSCRIPTION_SETTING } from "constants/routesURL";
import { getProduct } from '@lowcoder-ee/api/subscriptionApi';
import { getProduct } from '@lowcoder-ee/api/subscriptionApi';
import { useState, useEffect } from 'react';
import { Card, Tag, List, Button } from 'antd';
import { Card, Tag, List } from 'antd';
import { CheckCircleOutlined } from '@ant-design/icons';
import { Level1SettingPageContent, Level1SettingPageTitle } from "../styled";
import { Level1SettingPageContent } from "../styled";
import { TacoMarkDown } from "lowcoder-design";
import ProductDescriptions, {Translations, ProductDescription} from "./ProductDescriptions";

const { Meta } = Card;

const Wrapper = styled.div`
padding: 32px 24px;
`;

export function SubscriptionInfo() {
const ContentWrapper = styled.div`
display: flex;
gap: 24px;
`;

const { productId } = useParams<{ productId: string }>();
const FullWidthCard = styled(Card)`
flex-grow: 1;
width: 65%;
`;

// Hook for loading product details
const useProduct = (productId: string) => {
const [product, setProduct] = useState<any>(null);
const [loading, setLoading] = useState<boolean>(true);
const [error, setError] = useState<string | null>(null);
Expand All @@ -42,25 +53,55 @@ export function SubscriptionInfo() {
}
}, [productId]);

return { product, loading, error };
};

// Hook for loading markdown content
const useMarkdown = (productId: string | null, userLanguage: string) => {
const [markdownContent, setMarkdownContent] = useState<string>("");

useEffect(() => {
if (productId && userLanguage) {

let descriptionContent : Translations | false;

switch (productId) {
case "QW8L3WPMiNjQjI":
descriptionContent = ProductDescriptions["SupportProduct"];
break;
case "QW8MpIBHxieKXd":
descriptionContent = ProductDescriptions["MediaPackageProduct"];
break;
default:
descriptionContent = false;
break;
}

if (descriptionContent) {
setMarkdownContent(descriptionContent[userLanguage] || descriptionContent.en);
} else {
setMarkdownContent("");
}
}
}, [productId, userLanguage]);

return markdownContent;
};

export function SubscriptionInfo() {
const { productId } = useParams<{ productId: string }>();
const userLanguage = localStorage.getItem('lowcoder_uiLanguage');
const { product, loading, error } = useProduct(productId);
const markdownContent = useMarkdown(productId || null, userLanguage || "en");

if (loading) {
return <div>Loading...</div>;
return <div style={{margin: "40px"}}>Loading...</div>;
}

if (error) {
return <div>{error}</div>;
}

const pricingTable = productId == "QW8L3WPMiNjQjI" && [
{ type: "Admin & Editor", amount: "€2.90 per user, per month" },
{ type: "> 10 Users", amount: "€1.90 per user, per month" },
{ type: "> 100 Users", amount: "€0.90 per user, per month" },
{ type: "> 500 Users", amount: "€0.49 per user, per month" },
{ type: "> 1.000 Users", amount: "€0.29 per user, per month" },
{ type: "> 10.000 Users", amount: "€0.19 per user, per month" },
] || productId == "QW8MpIBHxieKXd" && [
{ type: "User", amount: "$29.00 per month" }
] || [];

return (
<Wrapper>
<HeaderBack>
Expand All @@ -69,47 +110,41 @@ export function SubscriptionInfo() {
<span>{product.name}</span>
</HeaderBack>
<Level1SettingPageContent>
<Card
hoverable
style={{ width: 400 }}
cover={<img alt={product.name} src={product.images[0]} />}
actions={[]}
>
<Meta
title={product.name}
description={product.description}
/>
<div style={{ marginTop: 16 }}>
<Tag icon={<CheckCircleOutlined />} color="green">
{product.type.toUpperCase()}
</Tag>
{product.active && (
<Tag icon={<CheckCircleOutlined />} color="blue">
Active
</Tag>
)}
<List
size="small"
header={<h3>What you get:</h3>}
bordered
dataSource={product.marketing_features}
renderItem={(item: { name: string }) => <List.Item>{item.name}</List.Item>}
style={{ marginTop: 16 }}
<ContentWrapper>
<Card
hoverable
style={{ minWidth: "350px", width: "35%" }}
cover={<img alt={product.name} src={product.images[0]} />}
actions={[]}
>
<Meta
title={product.name}
description={product.description}
/>
<List
size="small"
header={<h3>Pricing:</h3>}
bordered
dataSource={pricingTable}
renderItem={(item: { type: string, amount: string }) => (
<List.Item>
<strong>{item.type}:</strong> {item.amount}
</List.Item>
<div style={{ marginTop: 16 }}>
<Tag icon={<CheckCircleOutlined />} color="green">
{product.type.toUpperCase()}
</Tag>
{product.active && (
<Tag icon={<CheckCircleOutlined />} color="blue">
Active
</Tag>
)}
style={{ marginTop: 16 }}
/>
</div>
</Card>
<List
size="small"
header={<h3>What you get:</h3>}
bordered
dataSource={product.marketing_features}
renderItem={(item: { name: string }) => <List.Item>{item.name}</List.Item>}
style={{ marginTop: 16 }}
/>
</div>
</Card>

<FullWidthCard title="Product Documentation">
<TacoMarkDown>{markdownContent}</TacoMarkDown>
</FullWidthCard>
</ContentWrapper>
</Level1SettingPageContent>
</Wrapper>
);
Expand Down
Loading








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/lowcoder-org/lowcoder/pull/1318/commits/12c6654c79b54e30f5f21968421707baf4d4a173

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy