Skip to content
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

feat: implements a way to disable cloud cover #78

Merged
merged 5 commits into from
Oct 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ repos:
- eslint-plugin-prettier@^4.2.1

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.0
rev: v2.7.1
hooks:
- id: prettier

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@
"react": "^17.0.2",
"react-datepicker": "4.8.0",
"react-dom": "^17.0.2",
"react-hook-form": "7.36.1",
"react-leaflet": "2.8.0",
"react-hook-form": "^7.36.1",
"react-leaflet": "~2.8.0",
"react-leaflet-draw": "0.19.0",
"react-modal": "3.15.1",
"react-select": "5.4.0",
Expand Down
2 changes: 1 addition & 1 deletion src/CodeGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ dag = EODataAccessGateway()
code += ` end="${end}",
`;
}
if (cloud !== undefined) {
if (cloud !== 100) {
code += ` cloudCover=${cloud},
`;
}
Expand Down
8 changes: 6 additions & 2 deletions src/FormComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import Autocomplete from './Autocomplete';
import { EODAG_SERVER_ADRESS } from './config';
import SearchService from './SearchService';
import { ChangeEvent } from 'react';
//import { OptionTypeBase } from 'react-select';
// import { OptionTypeBase } from 'react-select';
import MapExtentComponent from './MapExtentComponent';
import _ from 'lodash';
import { IFormInput } from './types';
Expand Down Expand Up @@ -218,7 +218,11 @@ export const FormComponent: FC<IProps> = ({
/>
</div>
</fieldset>
<label className="jp-EodagWidget-input-name">
<label
className={`jp-EodagWidget-input-name ${
cloud === 100 ? 'jp-EodagWidget-input-name-line-through' : ''
} `}
>
Max cloud cover {cloud}%
<div className="jp-EodagWidget-slider">
<Controller
Expand Down
2 changes: 1 addition & 1 deletion src/SearchService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class SearchService {
? formatDate(formValues.startDate)
: undefined,
dtend: formValues.endDate ? formatDate(formValues.endDate) : undefined,
cloudCover: formValues.cloud,
cloudCover: formValues.cloud < 100 ? formValues.cloud : undefined,
page: page,
geom: formValues.geometry
};
Expand Down
2 changes: 1 addition & 1 deletion src/browser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class EodagBrowser extends React.Component<IProps, IState> {
openDialog: true
});
};
handleRetrieveMoreFeature = () => {
handleRetrieveMoreFeature = async () => {
const { features } = this.state;
this.setState({
searching: true
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export interface IFormInput {
endDate: Date;
productType: string;
cloud: number;
disableCloud: boolean;
additionnalParameters?: { name: string; value: string }[];
}

Expand Down
4 changes: 4 additions & 0 deletions style/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -391,3 +391,7 @@
.jp-EodagWidget-product h4 {
padding-left: 20px;
}
.jp-EodagWidget-input-name-line-through {
text-decoration: line-through;
color: #818181;
}
25 changes: 24 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5111,11 +5111,18 @@ react-fast-compare@^3.0.1:
resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-3.2.0.tgz#641a9da81b6a6320f270e89724fb45a0b39e43bb"
integrity sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA==

react-hook-form@7.36.1:
react-hook-form@^7.36.1:
version "7.36.1"
resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.36.1.tgz#82a311fe8cbe75e689fd4529f083b7c983da6520"
integrity sha512-EbYYkCG2p8ywe7ikOH2l02lAFMrrrslZi1I8fqd8ifDGNAkhomHZQzQsP6ksvzrWBKntRe8b5L5L7Zsd+Gm02Q==

react-input-autosize@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/react-input-autosize/-/react-input-autosize-3.0.0.tgz#6b5898c790d4478d69420b55441fcc31d5c50a85"
integrity sha512-nL9uS7jEs/zu8sqwFE5MAPx6pPkNAriACQ2rGLlqmKr2sPGtN7TXTyDdQt4lbNXVx7Uzadb40x8qotIuru6Rhg==
dependencies:
prop-types "^15.5.8"

react-is@^16.13.1, react-is@^16.7.0, react-is@^16.9.0:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
Expand Down Expand Up @@ -5298,6 +5305,22 @@ registry-url@^5.0.0:
dependencies:
rc "^1.2.8"

request-promise-core@1.1.4:
version "1.1.4"
resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.4.tgz#3eedd4223208d419867b78ce815167d10593a22f"
integrity sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw==
dependencies:
lodash "^4.17.19"

request-promise-native@^1.0.7:
version "1.0.9"
resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.9.tgz#e407120526a5efdc9a39b28a5679bf47b9d9dc28"
integrity sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g==
dependencies:
request-promise-core "1.1.4"
stealthy-require "^1.1.1"
tough-cookie "^2.3.3"

request@2.88.0:
version "2.88.0"
resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef"
Expand Down