Content-Length: 700136 | pFad | http://github.com/lowcoder-org/lowcoder/pull/1137/commits/b415d1e06da115bcc5da8cd576a27ab111aa059b

B8 Subscription handling #2 by FalkWolsky · Pull Request #1137 · lowcoder-org/lowcoder · GitHub
Skip to content

Subscription handling #2 #1137

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 30 commits into from
Sep 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d4a2a2c
Search & Create Customer
Aug 10, 2024
b6e19ee
Update for Subscription Handling
Aug 12, 2024
9759a6f
Merge branch 'dev' into subscription-handling
FalkWolsky Aug 17, 2024
45b37cd
Reorganizing and cleaning up
Aug 17, 2024
19ebdc8
Reorganizing and cleaning up
Aug 21, 2024
8faa3bb
Merge branch 'dev' into subscription-handling
FalkWolsky Aug 24, 2024
79fcd60
Updating package version
Aug 24, 2024
d5e1c64
Update Home Page
Aug 24, 2024
3e0450c
Showing Support Product Page
Aug 24, 2024
b415d1e
Subscription-Check Saga
Aug 24, 2024
33c7134
Cleanup dispatchers
Aug 25, 2024
9b1e389
Merge branch 'dev' into subscription-handling
FalkWolsky Aug 31, 2024
eb7c77f
Updating Vite Build Goals
Aug 31, 2024
41affd4
Introducing Subscription Overview and Support Handling
Aug 31, 2024
07136fc
Support Tickets Table
Aug 31, 2024
25890f3
fix: enhance docker image build github action
ludomikula Sep 3, 2024
4c46225
fixed support detail route
raheeliftikhar5 Sep 6, 2024
3dbdcd6
Merge branch 'main' into subscription-handling
FalkWolsky Sep 7, 2024
7dc68d3
Merge branch 'dev' into subscription-handling
FalkWolsky Sep 7, 2024
0d68d67
Support Detail Page
Sep 7, 2024
fc55724
Merge branch 'dev' into subscription-handling
FalkWolsky Sep 14, 2024
88e61b9
Merge branch 'dev' into subscription-handling
FalkWolsky Sep 14, 2024
9f7fc35
Merge branch 'dev' into subscription-handling
FalkWolsky Sep 14, 2024
b20ed56
Update React Markdown
Sep 14, 2024
fbdf8d5
Full Support and introducing a translation management script.
Sep 14, 2024
831bcbd
Adding Language Files
Sep 14, 2024
916d55e
Cleaning up Translation Folder
Sep 14, 2024
909a030
Updated Language Files including Variables
Sep 14, 2024
86757ee
Fixed Language Files and Merge preparation
Sep 15, 2024
fe89b29
Merge branch 'dev' into subscription-handling
FalkWolsky Sep 15, 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-Check Saga
  • Loading branch information
FalkWolsky committed Aug 24, 2024
commit b415d1e06da115bcc5da8cd576a27ab111aa059b
28 changes: 14 additions & 14 deletions client/packages/lowcoder/src/api/applicationApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,25 +77,25 @@ interface GrantAppPermissionReq {

class ApplicationApi extends Api {
static newURLPrefix = "/applications";
static fetchHomeDataURL = "/v1/applications/home";
static createApplicationURL = "/v1/applications";
static fetchAllMarketplaceAppsURL = "/v1/applications/marketplace-apps";
static deleteApplicationURL = (applicationId: string) => `/v1/applications/${applicationId}`;
static getAppPublishInfoURL = (applicationId: string) => `/v1/applications/${applicationId}/view`;
static getAppEditingInfoURL = (applicationId: string) => `/v1/applications/${applicationId}`;
static updateApplicationURL = (applicationId: string) => `/v1/applications/${applicationId}`;
static fetchHomeDataURL = "/applications/home";
static createApplicationURL = "/applications";
static fetchAllMarketplaceAppsURL = "/applications/marketplace-apps";
static deleteApplicationURL = (applicationId: string) => `/applications/${applicationId}`;
static getAppPublishInfoURL = (applicationId: string) => `/applications/${applicationId}/view`;
static getAppEditingInfoURL = (applicationId: string) => `/applications/${applicationId}`;
static updateApplicationURL = (applicationId: string) => `/applications/${applicationId}`;
static getApplicationPermissionURL = (applicationId: string) =>
`/v1/applications/${applicationId}/permissions`;
`/applications/${applicationId}/permissions`;
static grantAppPermissionURL = (applicationId: string) =>
`/v1/applications/${applicationId}/permissions`;
`/applications/${applicationId}/permissions`;
static publishApplicationURL = (applicationId: string) =>
`/v1/applications/${applicationId}/publish`;
`/applications/${applicationId}/publish`;
static updateAppPermissionURL = (applicationId: string, permissionId: string) =>
`/v1/applications/${applicationId}/permissions/${permissionId}`;
static createFromTemplateURL = `/v1/applications/createFromTemplate`;
`/applications/${applicationId}/permissions/${permissionId}`;
static createFromTemplateURL = `/applications/createFromTemplate`;
static publicToAllURL = (applicationId: string) => `/applications/${applicationId}/public-to-all`;
static publicToMarketplaceURL = (applicationId: string) => `/v1/applications/${applicationId}/public-to-marketplace`;
static getMarketplaceAppURL = (applicationId: string) => `/v1/applications/${applicationId}/view_marketplace`;
static publicToMarketplaceURL = (applicationId: string) => `/applications/${applicationId}/public-to-marketplace`;
static getMarketplaceAppURL = (applicationId: string) => `/applications/${applicationId}/view_marketplace`;


static fetchHomeData(request: HomeDataPayload): AxiosPromise<HomeDataResponse> {
Expand Down
4 changes: 2 additions & 2 deletions client/packages/lowcoder/src/api/datasourceApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export interface DataSourceTypeInfo {
}

export class DatasourceApi extends Api {
static url = "v1/datasources";
static url = "datasources";

// this api can be accessed by anonymous users when app is public.
static fetchJsDatasourceByApp(
Expand Down Expand Up @@ -207,7 +207,7 @@ export class DatasourceApi extends Api {
static fetchDatasourceType(
orgId: string
): AxiosPromise<GenericApiResponse<DataSourceTypeInfo[]>> {
return Api.get(`/v1/organizations/${orgId}/datasourceTypes`);
return Api.get(`/organizations/${orgId}/datasourceTypes`);
}

static fetchDynamicPluginConfig<T = any>(
Expand Down
2 changes: 1 addition & 1 deletion client/packages/lowcoder/src/api/inviteApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export type InviteInfo = {

class InviteApi extends Api {
static getInviteURL = "/invitation";
static acceptInviteURL = (invitationId: string) => `/v1/invitation/${invitationId}/invite`;
static acceptInviteURL = (invitationId: string) => `/invitation/${invitationId}/invite`;

// generate invitation
static getInvite(request: GetInviteRequest): AxiosPromise<GenericApiResponse<InviteInfo>> {
Expand Down
36 changes: 18 additions & 18 deletions client/packages/lowcoder/src/api/orgApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,24 @@ export interface OrgAPIUsageResponse extends ApiResponse {
}

export class OrgApi extends Api {
static createGroupURL = "/v1/groups";
static updateGroupURL = (groupId: string) => `/v1/groups/${groupId}/update`;
static fetchGroupURL = "/v1/groups/list";
static fetchGroupUsersURL = (groupId: string) => `/v1/groups/${groupId}/members`;
static deleteGroupURL = (groupId: string) => `/v1/groups/${groupId}`;
static fetchOrgUsersURL = (orgId: string) => `/v1/organizations/${orgId}/members`;
static deleteOrgUsersURL = (orgId: string) => `/v1/organizations/${orgId}/remove`;
static deleteGroupUserURL = (groupId: string) => `/v1/groups/${groupId}/remove`;
static addGroupUserURL = (groupId: string) => `/v1/groups/${groupId}/addMember`;
static updateUserOrgRoleURL = (orgId: string) => `/v1/organizations/${orgId}/role`;
static updateUserGroupRoleURL = (groupId: string) => `/v1/groups/${groupId}/role`;
static quitOrgURL = (orgId: string) => `/v1/organizations/${orgId}/leave`;
static quitGroupURL = (groupId: string) => `/v1/groups/${groupId}/leave`;
static switchOrgURL = (orgId: string) => `/v1/organizations/switchOrganization/${orgId}`;
static createOrgURL = "/v1/organizations";
static deleteOrgURL = (orgId: string) => `/v1/organizations/${orgId}`;
static updateOrgURL = (orgId: string) => `/v1/organizations/${orgId}/update`;
static fetchUsage = (orgId: string) => `/v1/organizations/${orgId}/api-usage`;
static createGroupURL = "/groups";
static updateGroupURL = (groupId: string) => `/groups/${groupId}/update`;
static fetchGroupURL = "/groups/list";
static fetchGroupUsersURL = (groupId: string) => `/groups/${groupId}/members`;
static deleteGroupURL = (groupId: string) => `/groups/${groupId}`;
static fetchOrgUsersURL = (orgId: string) => `/organizations/${orgId}/members`;
static deleteOrgUsersURL = (orgId: string) => `/organizations/${orgId}/remove`;
static deleteGroupUserURL = (groupId: string) => `/groups/${groupId}/remove`;
static addGroupUserURL = (groupId: string) => `/groups/${groupId}/addMember`;
static updateUserOrgRoleURL = (orgId: string) => `/organizations/${orgId}/role`;
static updateUserGroupRoleURL = (groupId: string) => `/groups/${groupId}/role`;
static quitOrgURL = (orgId: string) => `/organizations/${orgId}/leave`;
static quitGroupURL = (groupId: string) => `/groups/${groupId}/leave`;
static switchOrgURL = (orgId: string) => `/organizations/switchOrganization/${orgId}`;
static createOrgURL = "/organizations";
static deleteOrgURL = (orgId: string) => `/organizations/${orgId}`;
static updateOrgURL = (orgId: string) => `/organizations/${orgId}/update`;
static fetchUsage = (orgId: string) => `/organizations/${orgId}/api-usage`;

static createGroup(request: { name: string }): AxiosPromise<GenericApiResponse<OrgGroup>> {
return Api.post(OrgApi.createGroupURL, request);
Expand Down
2 changes: 1 addition & 1 deletion client/packages/lowcoder/src/api/platformApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { AxiosPromise } from "axios";
import Api from "./api";

export class PlatformApi extends Api {
static url = "v1/query";
static url = "query";

static version(): AxiosPromise<string> {
return Api.get("/VERSION", { _t: Date.now() }, { baseURL: "/" });
Expand Down
2 changes: 1 addition & 1 deletion client/packages/lowcoder/src/api/queryApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export type QueryExecuteResponse = {
};

export class QueryApi extends Api {
static url = "v1/query";
static url = "query";

static queryExecuteCancelTokenSource: Record<string, CancelTokenSource> = {};

Expand Down
6 changes: 3 additions & 3 deletions client/packages/lowcoder/src/api/userApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ export type GetCurrentUserResponse = GenericApiResponse<CurrentUser>;
class UserApi extends Api {
static thirdPartyLoginURL = "/auth/tp/login";
static thirdPartyBindURL = "/auth/tp/bind";
static usersURL = "/v1/users";
static usersURL = "/users";
static sendVerifyCodeURL = "/auth/otp/send";
static logoutURL = "/auth/logout";
static userURL = "/v1/users/me";
static userURL = "/users/me";
static currentUserURL = "/users/currentUser";
static rawCurrentUserURL = "/users/rawCurrentUser";
static emailBindURL = "/auth/email/bind";
static passwordURL = "/v1/users/password";
static passwordURL = "/users/password";
static formLoginURL = "/auth/form/login";
static markUserStatusURL = "/users/mark-status";
static userDetailURL = (id: string) => `/users/userDetail/${id}`;
Expand Down
13 changes: 11 additions & 2 deletions client/packages/lowcoder/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import { Redirect, Router, Switch } from "react-router-dom";
import type { AppState } from "redux/reducers";
import { fetchConfigAction } from "redux/reduxActions/configActions";
import { fetchUserAction } from "redux/reduxActions/userActions";
import { fetchSubscriptionsAction } from "redux/reduxActions/subscriptionActions";
import { reduxStore } from "redux/store/store";
import { developEnv } from "util/envUtils";
import history from "util/history";
Expand Down Expand Up @@ -89,6 +90,7 @@ type AppIndexProps = {
fetchHomeDataFinished: boolean;
fetchConfig: (orgId?: string) => void;
fetchHomeData: (currentUserAnonymous?: boolean | undefined) => void;
fetchSubscriptions: () => void;
getCurrentUser: () => void;
favicon: string;
brandName: string;
Expand All @@ -111,6 +113,7 @@ class AppIndex extends React.Component<AppIndexProps, any> {
this.props.fetchConfig(this.props.currentOrgId);
if (!this.props.currentUserAnonymous) {
this.props.fetchHomeData(this.props.currentUserAnonymous);
this.props.fetchSubscriptions();
}
}
}
Expand Down Expand Up @@ -416,14 +419,20 @@ const mapDispatchToProps = (dispatch: any) => ({
dispatch(fetchUserAction());
},
fetchConfig: (orgId?: string) => dispatch(fetchConfigAction(orgId)),

fetchSubscriptions: () => {
// dispatch(fetchSubscriptionsAction());
},

fetchHomeData: (currentUserAnonymous: boolean | undefined) => {
dispatch(fetchHomeData({}));
// the rule should be that if the user is not logged in and if he want to view an App, we should not fetch the home data
if (window.location.pathname == APP_EDITOR_URL && !currentUserAnonymous && !currentUserAnonymous === undefined) {
/* if (window.location.pathname == APP_EDITOR_URL && !currentUserAnonymous && !currentUserAnonymous === undefined) {
dispatch(fetchHomeData({}));
}
else {
dispatch(fetchHomeData({}));
}
} */
}
});

Expand Down
2 changes: 1 addition & 1 deletion client/packages/lowcoder/src/appView/AppViewInstance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class AppViewInstance<I = any, O = any> {
if (!appDsl) {
const http = axios.create({ baseURL: baseUrl, withCredentials: true });
const data: ApplicationResp = await http
.get(`/api/v1/applications/${this.appId}/view`)
.get(`/api/applications/${this.appId}/view`)
.then((i) => i.data)
.catch((e) => {
if (e.response?.status === API_STATUS_CODES.REQUEST_NOT_AUTHORISED) {
Expand Down
6 changes: 3 additions & 3 deletions client/packages/lowcoder/src/constants/apiConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ export const API_REQUEST_HEADERS: RawAxiosRequestHeaders = {
"Content-Type": "application/json",
};
export const SERVER_HOST = `${REACT_APP_API_HOST ?? ""}`;
export const ASSETS_URI = (id: string) => `${SERVER_HOST}/api/v1/assets/${id}`;
export const USER_HEAD_UPLOAD_URL = `${SERVER_HOST}/api/v1/users/photo`;
export const ASSETS_URI = (id: string) => `${SERVER_HOST}/api/assets/${id}`;
export const USER_HEAD_UPLOAD_URL = `${SERVER_HOST}/api/users/photo`;
export const ORG_ICON_UPLOAD_URL = (orgId: string) =>
`${SERVER_HOST}/api/v1/organizations/${orgId}/logo`;
`${SERVER_HOST}/api/organizations/${orgId}/logo`;

export type ApiRequestStatus = "init" | "requesting" | "success" | "error";
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ export const ReduxActionTypes = {
FETCH_AUDIT_LOG: "FETCH_AUDIT_LOG",
FETCH_AUDIT_LOG_SUCCESS: "FETCH_AUDIT_LOG_SUCCESS",

/* subscription */
FETCH_SUBSCRIPTIONS_INIT: "FETCH_SUBSCRIPTIONS_INIT",
FETCH_SUBSCRIPTIONS_SUCCESS: "FETCH_SUBSCRIPTIONS_SUCCESS",
FETCH_SUBSCRIPTIONS_FAILURE: "FETCH_SUBSCRIPTIONS_FAILURE",

/* application snapshot */
FETCH_APP_SNAPSHOTS: "FETCH_APP_SNAPSHOTS",
FETCH_APP_SNAPSHOTS_SUCCESS: "FETCH_APP_SNAPSHOTS_SUCCESS",
Expand Down Expand Up @@ -211,6 +216,9 @@ export const ReduxActionErrorTypes = {
/* sytem config */
FETCH_SYS_CONFIG_ERROR: "FETCH_SYS_CONFIG_ERROR",

/* subscription */
FETCH_SUBSCRIPTIONS_ERROR: "FETCH_SUBSCRIPTIONS_ERROR",

/* application snapshot */
CREATE_APP_SNAPSHOT_ERROR: "CREATE_APP_SNAPSHOT_ERROR",
FETCH_APP_SNAPSHOTS_ERROR: "FETCH_APP_SNAPSHOTS_ERROR",
Expand Down
Loading
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/1137/commits/b415d1e06da115bcc5da8cd576a27ab111aa059b

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy