Skip to content

Commit

Permalink
fix issue viewer cannot download view
Browse files Browse the repository at this point in the history
  • Loading branch information
danangmassandy committed Oct 4, 2024
1 parent ebce1dc commit bcf4200
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

Check warning on line 13 in django_project/dashboard/src/admin_boundaries/HeaderButtons.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
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}

Check warning on line 48 in django_project/dashboard/src/admin_boundaries/HeaderButtons.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch

Check warning on line 48 in django_project/dashboard/src/admin_boundaries/HeaderButtons.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
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 }

Check warning on line 136 in django_project/dashboard/src/components/HeaderButtons.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
</div>
)

Check warning on line 138 in django_project/dashboard/src/components/HeaderButtons.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
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

Check warning on line 91 in django_project/dashboard/src/views/View/ViewDetail.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 91 in django_project/dashboard/src/views/View/ViewDetail.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch

Check warning on line 91 in django_project/dashboard/src/views/View/ViewDetail.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
setTabSelected(_tab)

Check warning on line 92 in django_project/dashboard/src/views/View/ViewDetail.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
dispatch(updateMenu({
id: `view_edit`,
name: `View ${_viewName}`
Expand Down

0 comments on commit bcf4200

Please sign in to comment.