Skip to content

Commit

Permalink
Merge pull request #237 from unicef-drp/fix-viewer-download-issue
Browse files Browse the repository at this point in the history
fix issue viewer cannot download view
  • Loading branch information
danangmassandy authored Oct 4, 2024
2 parents ebce1dc + bcf4200 commit e3227c9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { BatchEntityEditInterface } from "../models/upload";
const LOAD_BATCH_ENTITY_EDIT_URL = '/api/batch-entity-edit/'

const BatchEditButton = (props: any) => {
const {dataset} = props
const {dataset, canUpload} = props
const navigate = useNavigate()

const createNewBatchEdit = () => {
Expand Down Expand Up @@ -45,7 +45,7 @@ const BatchEditButton = (props: any) => {
<Box>
<Button
id='batch-edit-button'
disabled={dataset?.is_empty}
disabled={dataset?.is_empty || !canUpload}
className={'ThemeButton MuiButton-secondary DatasetBatchEditButton'}
onClick={(event: React.MouseEvent<HTMLButtonElement>) => createNewBatchEdit()}
disableElevation
Expand Down
3 changes: 2 additions & 1 deletion django_project/dashboard/src/components/HeaderButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ export const UploadDataButton = (props: UploadDataButtonInterface) => {
onClick={addButtonClick}/>
{ props.moreActions ? <Divider orientation='vertical' flexItem={true} sx={{marginLeft: '10px'}} /> : null }
{ props.moreActions ? MoreActionsElement(props.moreActions, {
dataset: dataset
dataset: dataset,
canUpload: canUpload
}) : null }
</div>
)
Expand Down
4 changes: 3 additions & 1 deletion django_project/dashboard/src/views/View/ViewDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ export default function ViewDetail() {
}
let _isReadOnly = isReadOnlyView(view)
if (_isReadOnly) {
setTabSelected(1)
// set tab to preview if accessing tab > 2
let _tab = tab <= 2 ? tab : 1
setTabSelected(_tab)
dispatch(updateMenu({
id: `view_edit`,
name: `View ${_viewName}`
Expand Down

1 comment on commit e3227c9

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage report for django_project/dashboard

St.
Category Percentage Covered / Total
🔴 Statements 5.16% 520/10077
🔴 Branches 0.72% 39/5421
🔴 Functions 2.38% 59/2478
🔴 Lines 5.24% 514/9811

Test suite run success

12 tests passing in 5 suites.

Report generated by 🧪jest coverage report action from e3227c9

Please sign in to comment.