Skip to content

Commit

Permalink
Merge branch 'release' of github.com:appsmithorg/appsmith into feat/b…
Browse files Browse the repository at this point in the history
…ackup-restore-pg
  • Loading branch information
abhvsn committed Nov 14, 2024
2 parents 032356b + 17537e7 commit ecd642f
Show file tree
Hide file tree
Showing 43 changed files with 184 additions and 190 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/sync-release-to-pg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ jobs:
if: env.MERGE_CONFLICT == 'false'
run: |
set -e
git push origin pg || echo "PUSH_FAILURE=true" >> $GITHUB_ENV
git push https://${{ secrets.PAT_GITHUB }}@github.com/${{ github.repository }} HEAD:pg || echo "PUSH_FAILURE=true" >> $GITHUB_ENV
- name: Capture push failure message
if: env.PUSH_FAILURE == 'true'
run: |
# Capture the last git error message
push_error_message=$(git push origin pg 2>&1 | tail -n 1)
push_error_message=$(git push https://${{ secrets.PAT_GITHUB }}@github.com/${{ github.repository }} HEAD:pg 2>&1 | tail -n 1)
echo "PUSH_ERROR_MESSAGE=$push_error_message" >> $GITHUB_ENV
- name: Notify on push failure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function CodeBlock({ code }: CodeBlockProps) {
}}
>
<Code>{code}</Code>
<Button kind="tertiary" startIcon="copy-control" />
<Button isIconButton kind="tertiary" startIcon="copy-control" />
</Wrapper>
);
}
Expand Down
21 changes: 0 additions & 21 deletions app/client/src/ce/api/UserApi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ export interface UpdateUserRequest {
name?: string;
email?: string;
proficiency?: string;
role?: string;
useCase?: string;
intercomConsentGiven?: boolean;
}
Expand All @@ -70,19 +69,6 @@ export interface SendTestEmailPayload {
password?: string;
}

export interface CreateSuperUserRequest {
email: string;
name: string;
source: "FORM";
state: "ACTIVATED";
isEnabled: boolean;
password: string;
role: "Developer";
companyName: string;
allowCollectingAnonymousData: boolean;
signupForNewsletter: boolean;
}

export class UserApi extends Api {
static usersURL = "v1/users";
static productAlertURL = "v1/product-alert/alert";
Expand All @@ -99,7 +85,6 @@ export class UserApi extends Api {
static currentUserURL = "v1/users/me";
static photoURL = "v1/users/photo";
static featureFlagsURL = "v1/users/features";
static superUserURL = "v1/users/super";
static adminSettingsURL = "v1/admin/env";
static restartServerURL = "v1/admin/restart";
static sendTestEmailURL = "/v1/admin/send-test-email";
Expand Down Expand Up @@ -214,12 +199,6 @@ export class UserApi extends Api {
return Api.get(UserApi.featureFlagsURL);
}

static async createSuperUser(
request: CreateSuperUserRequest,
): Promise<AxiosPromise<CreateUserResponse>> {
return Api.post(UserApi.superUserURL, request);
}

/*
* Super user endpoints
*/
Expand Down
105 changes: 85 additions & 20 deletions app/client/src/ce/pages/Editor/IDE/EditorPane/Query/hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,16 @@ export const useQueryAdd = () => {
return;
}

let url = "";
const url = getQueryUrl(currentEntityInfo);

url = getQueryUrl(currentEntityInfo);
history.push(url);
}, [currentEntityInfo]);
}, [currentEntityInfo, dispatch, ideViewMode]);

const closeAddQuery = useCallback(() => {
let url = "";
const url = getQueryUrl(currentEntityInfo, false);

url = getQueryUrl(currentEntityInfo, false);
history.push(url);
}, [currentEntityInfo, ideViewMode]);
}, [currentEntityInfo]);

return { openAddQuery, closeAddQuery };
};
Expand Down Expand Up @@ -113,6 +111,15 @@ export const useGroupedAddQueryOperations = (): GroupedAddOperations => {
return groups;
};

const PluginActionEditor = lazy(async () =>
retryPromise(
async () =>
import(
/* webpackChunkName: "PluginActionEditor" */ "pages/Editor/AppPluginActionEditor"
),
),
);

const ApiEditor = lazy(async () =>
retryPromise(
async () =>
Expand Down Expand Up @@ -145,13 +152,65 @@ const QueryEmpty = lazy(async () =>
);

export const useQueryEditorRoutes = (path: string): UseRoutes => {
return useMemo(
const isActionRedesignEnabled = useFeatureFlag(
FEATURE_FLAG.release_actions_redesign_enabled,
);

const skeleton = useMemo(() => <Skeleton />, []);

const newComponents = useMemo(
() => [
{
key: "PluginActionEditor",
component: () => {
return (
<Suspense fallback={skeleton}>
<PluginActionEditor />
</Suspense>
);
},
path: [
BUILDER_PATH + API_EDITOR_ID_PATH,
BUILDER_CUSTOM_PATH + API_EDITOR_ID_PATH,
BUILDER_PATH_DEPRECATED + API_EDITOR_ID_PATH,
BUILDER_PATH + SAAS_EDITOR_API_ID_PATH,
BUILDER_CUSTOM_PATH + SAAS_EDITOR_API_ID_PATH,
BUILDER_PATH_DEPRECATED + SAAS_EDITOR_API_ID_PATH,
path + "/:baseQueryId",
],
exact: true,
},
{
key: "AddQuery",
exact: true,
component: () => (
<Suspense fallback={skeleton}>
<AddQuery />
</Suspense>
),
path: [`${path}${ADD_PATH}`, `${path}/:baseQueryId${ADD_PATH}`],
},
{
key: "QueryEmpty",
component: () => (
<Suspense fallback={skeleton}>
<QueryEmpty />
</Suspense>
),
exact: true,
path: [path],
},
],
[path, skeleton],
);

const oldComponents = useMemo(
() => [
{
key: "ApiEditor",
component: (args) => {
component: (args: object) => {
return (
<Suspense fallback={<Skeleton />}>
<Suspense fallback={skeleton}>
<ApiEditor {...args} />
</Suspense>
);
Expand All @@ -166,18 +225,18 @@ export const useQueryEditorRoutes = (path: string): UseRoutes => {
{
key: "AddQuery",
exact: true,
component: (args) => (
<Suspense fallback={<Skeleton />}>
<AddQuery {...args} />
component: () => (
<Suspense fallback={skeleton}>
<AddQuery />
</Suspense>
),
path: [`${path}${ADD_PATH}`, `${path}/:baseQueryId${ADD_PATH}`],
},
{
key: "SAASEditor",
component: (args) => {
component: (args: object) => {
return (
<Suspense fallback={<Skeleton />}>
<Suspense fallback={skeleton}>
<QueryEditor {...args} />
</Suspense>
);
Expand All @@ -191,9 +250,9 @@ export const useQueryEditorRoutes = (path: string): UseRoutes => {
},
{
key: "QueryEditor",
component: (args) => {
component: (args: object) => {
return (
<Suspense fallback={<Skeleton />}>
<Suspense fallback={skeleton}>
<QueryEditor {...args} />
</Suspense>
);
Expand All @@ -203,17 +262,23 @@ export const useQueryEditorRoutes = (path: string): UseRoutes => {
},
{
key: "QueryEmpty",
component: (args) => (
<Suspense fallback={<Skeleton />}>
<QueryEmpty {...args} />
component: () => (
<Suspense fallback={skeleton}>
<QueryEmpty />
</Suspense>
),
exact: true,
path: [path],
},
],
[path],
[path, skeleton],
);

if (isActionRedesignEnabled) {
return newComponents;
}

return oldComponents;
};

export const useAddQueryListItems = () => {
Expand Down
3 changes: 1 addition & 2 deletions app/client/src/ce/sagas/userSagas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -417,14 +417,13 @@ export function* inviteUsers(

export function* updateUserDetailsSaga(action: ReduxAction<UpdateUserRequest>) {
try {
const { email, intercomConsentGiven, name, proficiency, role, useCase } =
const { email, intercomConsentGiven, name, proficiency, useCase } =
action.payload;

const response: ApiResponse = yield callAPI(UserApi.updateUser, {
email,
name,
proficiency,
role,
useCase,
intercomConsentGiven,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1710,6 +1710,7 @@ class CodeEditor extends Component<Props, State> {
"commands-button invisible",
!showSlashCommandButton && "!hidden",
)}
isIconButton
kind="tertiary"
onClick={() => {
const newValue =
Expand Down

This file was deleted.

2 changes: 2 additions & 0 deletions app/client/src/pages/AppViewer/Navigation/TopStacked.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export function TopStacked(props: NavigationProps) {
{tabsScrollable && (
<ScrollBtnContainer
className="left-0 scroll-arrows"
isIconButton
kind="tertiary"
onMouseDown={() => startScrolling(true)}
onMouseLeave={stopScrolling}
Expand Down Expand Up @@ -153,6 +154,7 @@ export function TopStacked(props: NavigationProps) {
{tabsScrollable && (
<ScrollBtnContainer
className="right-0 scroll-arrows"
isIconButton
kind="tertiary"
onMouseDown={() => startScrolling(false)}
onMouseLeave={stopScrolling}
Expand Down
9 changes: 0 additions & 9 deletions app/client/src/pages/Editor/APIEditor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import { resolveIcon } from "../utils";
import { ENTITY_ICON_SIZE, EntityIcon } from "../Explorer/ExplorerIcons";
import { getIDEViewMode } from "selectors/ideSelectors";
import { EditorViewMode } from "ee/entities/IDE/constants";
import { AppPluginActionEditor } from "pages/Editor/AppPluginActionEditor";

type ApiEditorWrapperProps = RouteComponentProps<APIEditorRouteParams>;

Expand Down Expand Up @@ -164,14 +163,6 @@ function ApiEditorWrapper(props: ApiEditorWrapperProps) {
return <ConvertEntityNotification icon={icon} name={action?.name || ""} />;
}, [action?.name, isConverting, icon]);

const isActionRedesignEnabled = useFeatureFlag(
FEATURE_FLAG.release_actions_redesign_enabled,
);

if (isActionRedesignEnabled) {
return <AppPluginActionEditor />;
}

return (
<ApiEditorContextProvider
actionRightPaneBackLink={actionRightPaneBackLink}
Expand Down
1 change: 0 additions & 1 deletion app/client/src/pages/Editor/AppPluginActionEditor/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ export default function HelpDropdown(props: DebuggerLog) {
return (
<Popover>
<PopoverTrigger>
<Button kind="tertiary" size="sm" startIcon="question-line" />
<Button
isIconButton
kind="tertiary"
size="sm"
startIcon="question-line"
/>
</PopoverTrigger>
<PopoverContent className={styles.consoleItemHelpContent}>
<List
Expand Down
9 changes: 0 additions & 9 deletions app/client/src/pages/Editor/QueryEditor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ import { resolveIcon } from "../utils";
import { ENTITY_ICON_SIZE, EntityIcon } from "../Explorer/ExplorerIcons";
import { getIDEViewMode } from "selectors/ideSelectors";
import { EditorViewMode } from "ee/entities/IDE/constants";
import { AppPluginActionEditor } from "../AppPluginActionEditor";
import { saveActionName } from "actions/pluginActionActions";

type QueryEditorProps = RouteComponentProps<QueryEditorRouteParams>;
Expand Down Expand Up @@ -187,14 +186,6 @@ function QueryEditor(props: QueryEditorProps) {
);
}, [action?.name, isConverting, icon]);

const isActionRedesignEnabled = useFeatureFlag(
FEATURE_FLAG.release_actions_redesign_enabled,
);

if (isActionRedesignEnabled) {
return <AppPluginActionEditor />;
}

return (
<QueryEditorContextProvider
actionRightPaneBackLink={actionRightPaneBackLink}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import com.appsmith.server.dtos.ResetUserPasswordDTO;
import com.appsmith.server.dtos.ResponseDTO;
import com.appsmith.server.dtos.UserProfileDTO;
import com.appsmith.server.dtos.UserSignupRequestDTO;
import com.appsmith.server.dtos.UserUpdateDTO;
import com.appsmith.server.services.SessionUserService;
import com.appsmith.server.services.UserDataService;
Expand Down Expand Up @@ -70,19 +69,6 @@ public Mono<Void> createFormEncoded(ServerWebExchange exchange) {
return userSignup.signupAndLoginFromFormData(exchange);
}

@JsonView(Views.Public.class)
@PostMapping(
value = "/super",
consumes = {MediaType.APPLICATION_JSON_VALUE})
public Mono<ResponseDTO<User>> createSuperUser(
@Valid @RequestBody UserSignupRequestDTO resource,
@RequestHeader("Origin") String originHeader,
ServerWebExchange exchange) {
return userSignup
.signupAndLoginSuper(resource, originHeader, exchange)
.map(created -> new ResponseDTO<>(HttpStatus.CREATED.value(), created, null));
}

@JsonView(Views.Public.class)
@PostMapping(
value = "/super",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ public class UserData extends BaseDomain {
@JsonView(Views.Internal.class)
String userId;

// Role of the user in their workspace, example, Designer, Developer, Product Lead etc.
@JsonView(Views.Public.class)
@Deprecated
private String role;

// The development proficiency of the user for example, Beginner, Novice, Intermediate, Advanced.
@JsonView(Views.Public.class)
private String proficiency;
Expand Down
Loading

0 comments on commit ecd642f

Please sign in to comment.