Skip to content

Commit

Permalink
Merge pull request #458 from rsnyman/fix-datepicker
Browse files Browse the repository at this point in the history
Fix some DatePicker issues
  • Loading branch information
rsnyman authored May 9, 2023
2 parents 363747d + d0e6011 commit aff09c3
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion backend/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"flask_bcrypt",
"flask_cors",
"flask_mail",
"Flask>=2",
"Flask>=2,<2.3.0",
"Flask-SQLAlchemy<3.0",
"flatdict",
"google-api-python-client",
Expand Down
5 changes: 3 additions & 2 deletions frontend/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ export default defineConfig({
framework: "create-react-app",
bundler: "webpack",
},
specPattern: "src/**/*.cy.{js,jsx,ts,tsx}",
excludeSpecPattern: "**/node_modules/**",
viewportHeight: 660,
viewportWidth: 1000
},
video: false,
},
);
});
4 changes: 2 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"@babel/preset-flow": "^7.18.6",
"@babel/preset-react": "^7.18.6",
"@greatsumini/react-facebook-login": "^2.1.5",
"@monaco-editor/react": "^4.4.6",
"@monaco-editor/react": "4.4.6",
"@patternfly/patternfly": "^4.224.2",
"@patternfly/react-charts": "^6.94.18",
"@patternfly/react-core": "^4.276.6",
"@patternfly/react-core": "^4.276.9",
"@patternfly/react-icons": "^4.93.6",
"@patternfly/react-styles": "^4.92.6",
"@patternfly/react-table": "^4.112.39",
Expand Down
16 changes: 15 additions & 1 deletion frontend/src/components/add-token-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ import {
import { ExclamationCircleIcon } from '@patternfly/react-icons';


function getToday() {
const now = new Date();
return now.toISOString().split('T')[0];
}

function dateParse(val) {
return val && val.split('-').length === 3 && new Date(`${val}T00:00:00`);
}

export class AddTokenModal extends React.Component {
static propTypes = {
onSave: PropTypes.func,
Expand All @@ -25,7 +34,7 @@ export class AddTokenModal extends React.Component {
super(props);
this.state = {
name: '',
expiryDate: '',
expiryDate: getToday(),
isNameValid: true,
isExpiryValid: true
};
Expand Down Expand Up @@ -115,12 +124,17 @@ export class AddTokenModal extends React.Component {
>
<DatePicker
appendTo={() => document.getElementById('add-token-modal')}
dateParse={dateParse}
onChange={this.onExpiryDateChange}
value={this.state.expiryDate}
inputProps={{
id: "token-expiry-date",
validated: this.state.isExpiryValid ? ValidatedOptions.default : ValidatedOptions.error
}}
popoverProps={{
enableFlip: false,
position: 'bottom'
}}
/>
</FormGroup>
</Form>
Expand Down
2 changes: 1 addition & 1 deletion scripts/make-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ if [[ "$CAN_COMMIT" = true ]]; then
git add . > /dev/null 2>&1
COMMIT_MSG="Release $NEW_VERSION"
if [[ $GENERATE_CHANGELOG = true ]]; then
COMMIT_MSG="$COMMIT_MSG\n\n$CHANGELOG"
COMMIT_MSG="$COMMIT_MSG"$'\n\n'"$CHANGELOG"
fi
git commit -q -m "$COMMIT_MSG"
echo "done, new branch created: $BRANCH_NAME"
Expand Down

0 comments on commit aff09c3

Please sign in to comment.