-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin' into test/community-pr-33171
- Loading branch information
Showing
116 changed files
with
1,096 additions
and
7,872 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
app/client/packages/design-system/widgets/src/components/Link/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./src"; |
17 changes: 17 additions & 0 deletions
17
app/client/packages/design-system/widgets/src/components/Link/src/Link.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from "react"; | ||
|
||
import { Text } from "../../Text"; | ||
import type { LinkProps } from "./types"; | ||
import styles from "./styles.module.css"; | ||
|
||
export function Link(props: LinkProps) { | ||
const { children, href, rel, target, ...rest } = props; | ||
|
||
return ( | ||
<Text {...rest}> | ||
<a className={styles.link} href={href} rel={rel} target={target}> | ||
{children} | ||
</a> | ||
</Text> | ||
); | ||
} |
1 change: 1 addition & 0 deletions
1
app/client/packages/design-system/widgets/src/components/Link/src/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./Link"; |
10 changes: 10 additions & 0 deletions
10
app/client/packages/design-system/widgets/src/components/Link/src/styles.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.link { | ||
text-decoration: underline; | ||
text-decoration-color: currentColor; | ||
text-underline-offset: 2px; | ||
|
||
&:hover { | ||
color: currentColor; | ||
text-decoration-color: currentColor; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
app/client/packages/design-system/widgets/src/components/Link/src/types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import type { ComponentProps } from "react"; | ||
|
||
import type { TextProps } from "../../Text"; | ||
|
||
export interface LinkProps extends TextProps { | ||
href?: string; | ||
target?: ComponentProps<"a">["target"]; | ||
rel?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
app/client/packages/design-system/widgets/src/components/Text/src/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export { Text } from "./Text"; | ||
export type { TextProps } from "./types"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
91 changes: 91 additions & 0 deletions
91
app/client/src/components/editorComponents/ApiResponseView.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
import React from "react"; | ||
import { render } from "@testing-library/react"; | ||
import ApiResponseView from "./ApiResponseView"; | ||
import configureStore from "redux-mock-store"; | ||
import { Provider } from "react-redux"; | ||
import { ThemeProvider } from "styled-components"; | ||
import { unitTestBaseMockStore } from "layoutSystems/common/dropTarget/unitTestUtils"; | ||
import { lightTheme } from "selectors/themeSelectors"; | ||
import { BrowserRouter as Router } from "react-router-dom"; | ||
import { EditorViewMode } from "@appsmith/entities/IDE/constants"; | ||
import "@testing-library/jest-dom/extend-expect"; | ||
|
||
jest.mock("./EntityBottomTabs", () => ({ | ||
__esModule: true, | ||
default: () => <div />, | ||
})); | ||
|
||
const mockStore = configureStore([]); | ||
|
||
const storeState = { | ||
...unitTestBaseMockStore, | ||
evaluations: { | ||
tree: {}, | ||
}, | ||
ui: { | ||
...unitTestBaseMockStore.ui, | ||
gitSync: { | ||
branches: [], | ||
fetchingBranches: false, | ||
isDeploying: false, | ||
protectedBranchesLoading: false, | ||
protectedBranches: [], | ||
}, | ||
editor: { | ||
isPreviewMode: false, | ||
}, | ||
users: { | ||
featureFlag: { | ||
data: {}, | ||
overriddenFlags: {}, | ||
}, | ||
}, | ||
ide: { | ||
view: EditorViewMode.FullScreen, | ||
}, | ||
debugger: { | ||
context: { | ||
errorCount: 0, | ||
}, | ||
}, | ||
apiPane: { | ||
debugger: { | ||
open: true, | ||
responseTabHeight: 200, | ||
selectedTab: "response", | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
describe("ApiResponseView", () => { | ||
let store: any; | ||
|
||
beforeEach(() => { | ||
store = mockStore(storeState); | ||
}); | ||
|
||
it("the container should have class select-text to enable the selection of text for user", () => { | ||
const { container } = render( | ||
<Provider store={store}> | ||
<ThemeProvider theme={lightTheme}> | ||
<Router> | ||
<ApiResponseView | ||
apiName="Api1" | ||
isRunning={false} | ||
onRunClick={() => {}} | ||
responseDataTypes={[]} | ||
responseDisplayFormat={{ title: "JSON", value: "JSON" }} | ||
/> | ||
</Router> | ||
</ThemeProvider> | ||
</Provider>, | ||
); | ||
|
||
expect( | ||
container | ||
.querySelector(".t--api-bottom-pane-container") | ||
?.classList.contains("select-text"), | ||
).toBe(true); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.