Skip to content

Commit 8cb0dad

Browse files
committed
remove webview apply button
1 parent 4c8ee86 commit 8cb0dad

File tree

3 files changed

+0
-32
lines changed

3 files changed

+0
-32
lines changed

src/components/Sugggestion/Pagination/index.spec.tsx

-9
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ describe('RecommendationPagination', () => {
66
const props: RecommendationPaginationProps = {
77
gotoNextPage: jest.fn(),
88
gotoPreviousPage: jest.fn(),
9-
handleApplyRecommendation: jest.fn(),
109
shouldRenderPagination: true,
1110
currentPage: 1,
1211
totalPages: 5,
@@ -25,7 +24,6 @@ describe('RecommendationPagination', () => {
2524
const props: RecommendationPaginationProps = {
2625
gotoNextPage: jest.fn(),
2726
gotoPreviousPage: jest.fn(),
28-
handleApplyRecommendation: jest.fn(),
2927
shouldRenderPagination: false,
3028
currentPage: 1,
3129
totalPages: 5,
@@ -43,7 +41,6 @@ describe('RecommendationPagination', () => {
4341
const props: RecommendationPaginationProps = {
4442
gotoNextPage: gotoNextPageMock,
4543
gotoPreviousPage: jest.fn(),
46-
handleApplyRecommendation: jest.fn(),
4744
shouldRenderPagination: true,
4845
currentPage: 1,
4946
totalPages: 5,
@@ -60,7 +57,6 @@ describe('RecommendationPagination', () => {
6057
const props: RecommendationPaginationProps = {
6158
gotoNextPage: jest.fn(),
6259
gotoPreviousPage: gotoPreviousPageMock,
63-
handleApplyRecommendation: jest.fn(),
6460
shouldRenderPagination: true,
6561
currentPage: 1,
6662
totalPages: 5,
@@ -77,7 +73,6 @@ describe('RecommendationPagination', () => {
7773
const props: RecommendationPaginationProps = {
7874
gotoNextPage: jest.fn(),
7975
gotoPreviousPage: jest.fn(),
80-
handleApplyRecommendation: handleApplyRecommendationMock,
8176
shouldRenderPagination: true,
8277
currentPage: 1,
8378
totalPages: 5,
@@ -91,11 +86,9 @@ describe('RecommendationPagination', () => {
9186
});
9287

9388
it('gotoNextPage Button is Disabled', () => {
94-
const handleApplyRecommendationMock = jest.fn();
9589
const props: RecommendationPaginationProps = {
9690
gotoNextPage: jest.fn(),
9791
gotoPreviousPage: jest.fn(),
98-
handleApplyRecommendation: handleApplyRecommendationMock,
9992
shouldRenderPagination: true,
10093
currentPage: 5,
10194
totalPages: 5,
@@ -109,11 +102,9 @@ describe('RecommendationPagination', () => {
109102
});
110103

111104
it('gotoPrevPage Button is Disabled', () => {
112-
const handleApplyRecommendationMock = jest.fn();
113105
const props: RecommendationPaginationProps = {
114106
gotoNextPage: jest.fn(),
115107
gotoPreviousPage: jest.fn(),
116-
handleApplyRecommendation: handleApplyRecommendationMock,
117108
shouldRenderPagination: true,
118109
currentPage: 0,
119110
totalPages: 5,

src/components/Sugggestion/Pagination/index.tsx

-12
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { useMemo } from 'react';
44
export interface RecommendationPaginationProps {
55
gotoNextPage: () => void;
66
gotoPreviousPage: () => void;
7-
handleApplyRecommendation: () => void;
87
shouldRenderPagination: boolean;
98
currentPage: number;
109
totalPages: number;
@@ -13,7 +12,6 @@ export interface RecommendationPaginationProps {
1312
export const RecommendationPagination = ({
1413
gotoNextPage,
1514
gotoPreviousPage,
16-
handleApplyRecommendation,
1715
shouldRenderPagination,
1816
currentPage,
1917
totalPages,
@@ -107,16 +105,6 @@ export const RecommendationPagination = ({
107105
</ButtonGroup>
108106
)}
109107

110-
<Button
111-
data-testid='apply-button'
112-
variant='contained'
113-
sx={{
114-
justifyContent: 'flex-end',
115-
}}
116-
onClick={handleApplyRecommendation}
117-
>
118-
Apply
119-
</Button>
120108
</Box>
121109
</>
122110
);

src/components/Sugggestion/index.tsx

-11
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,6 @@ export const SuggestionPage = (): JSX.Element => {
116116
return problemRecomendation.length > 0;
117117
}, [problemRecomendation]);
118118

119-
const handleApplyRecommendation = useCallback(() => {
120-
vscode.postMessage({
121-
type: 'applyRecommendation',
122-
data: {
123-
input: recommendationMemo,
124-
initData: { ...suggestion },
125-
},
126-
});
127-
}, [recommendationMemo, suggestion]);
128-
129119
const generateButtonSxProps = useMemo(() => {
130120
if (!suggestion || isRecommendationLoading) {
131121
return {
@@ -192,7 +182,6 @@ export const SuggestionPage = (): JSX.Element => {
192182
gotoNextPage={goToNextPage}
193183
gotoPreviousPage={goToPrevPage}
194184
shouldRenderPagination={shouldRenderPagination}
195-
handleApplyRecommendation={handleApplyRecommendation}
196185
currentPage={currentPage}
197186
totalPages={totalPages}
198187
/>

0 commit comments

Comments
 (0)