Skip to content

Commit

Permalink
Issue1468: Submit request redirect (data-dot-all#1469)
Browse files Browse the repository at this point in the history
### Feature or Bugfix
- Feature

### Detail
- Submit request redirects to share request page instead of catalog page

### Relates
- data-dot-all#1468

### Testing
- Submit request button redirects to share page and not catalog anymore.

### Security
Please answer the questions below briefly where applicable, or write
`N/A`. Based on
[OWASP 10](https://owasp.org/Top10/en/).

- Does this PR introduce or modify any input fields or queries - this
includes
fetching data from storage outside the application (e.g. a database, an
S3 bucket)?
  - Is the input sanitized?
- What precautions are you taking before deserializing the data you
consume?
  - Is injection prevented by parametrizing queries?
  - Have you ensured no `eval` or similar functions are used?
- Does this PR introduce any functionality or component that requires
authorization?
- How have you ensured it respects the existing AuthN/AuthZ mechanisms?
  - Are you logging failed auth attempts?
- Are you using or adding any cryptographic features?
  - Do you use a standard proven implementations?
  - Are the used keys controlled by the customer? Where are they stored?
- Are you introducing any new policies/roles/users?
  - Have you used the least-privilege principle? How?


By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.
  • Loading branch information
anushka-singh authored Aug 8, 2024
1 parent 13c900f commit 332a56b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion frontend/src/modules/Shared/Shares/ShareEditForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
import { SET_ERROR } from '../../../globalErrors';
import { DeleteOutlined } from '@mui/icons-material';
import PropTypes from 'prop-types';
import { useNavigate } from 'react-router-dom';
import { useNavigate, useLocation } from 'react-router-dom';

const ItemRow = (props) => {
const {
Expand Down Expand Up @@ -214,6 +214,7 @@ export const ShareEditForm = (props) => {
showViewShare
} = props;
const navigate = useNavigate();
const location = useLocation();
const [sharedItems, setSharedItems] = useState(Defaults.pagedResponse);
const [shareStatus, setShareStatus] = useState('');
const [filter, setFilter] = useState(Defaults.filter);
Expand Down Expand Up @@ -276,6 +277,10 @@ export const ShareEditForm = (props) => {
if (onApply) {
onApply();
}
const targetPath = `/console/shares/${share.shareUri}`;
if (location.pathname !== targetPath) {
navigate(targetPath);
}
};

const draftRequest = async () => {
Expand Down

0 comments on commit 332a56b

Please sign in to comment.