Skip to content

918 ability to freeze datasets or version #941

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

Merged
merged 101 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
281b800
initial naive approach of frozen dataset
longshuicy Feb 19, 2024
b788d97
lock works
longshuicy Feb 22, 2024
a92eabb
use the view instead of just datset db
longshuicy Feb 22, 2024
ba3363d
all get endpoint now change to use the dataset view that has both dat…
longshuicy Feb 22, 2024
1e62c9e
refactoring GET public dataset related endpoints
longshuicy Feb 22, 2024
08e21a9
refactoring every GET endpoint related to dataset
longshuicy Feb 22, 2024
f87b3ec
write a published wrapper to control showing of edit or not
longshuicy Feb 22, 2024
26ff45f
use wrapper whenever possible to avoid hardcoding criterias
longshuicy Feb 22, 2024
8a67ed0
add more publish wrapper
longshuicy Feb 22, 2024
de67fbe
wrap proper auth and published check to various action menu
longshuicy Feb 22, 2024
f6b2e92
add lock to file
longshuicy Feb 22, 2024
6eb5d8e
fix metadata edit auth and published
longshuicy Feb 22, 2024
2671b6b
something wrong with tab and file role
longshuicy Feb 22, 2024
26ac61b
dataset tab condition set
longshuicy Feb 22, 2024
edb66be
fix fileRoleType
longshuicy Feb 23, 2024
6ed0f80
fix file tabs
longshuicy Feb 23, 2024
aa258f5
freeze button works
longshuicy Feb 23, 2024
de7678f
frozen button works
longshuicy Feb 23, 2024
1bdd136
codegen
longshuicy Feb 23, 2024
f6c0e99
list the latest version of published dataset is working
longshuicy Mar 6, 2024
db00e9f
update freeze endpoint to take versioning into consideration
longshuicy Mar 6, 2024
34986e8
enable the cability of frozen and frozen draft
longshuicy Mar 6, 2024
ec1e7f1
messy logic
longshuicy Mar 6, 2024
4fc1c1c
change pipeline logic to always have both the latest draft and latest…
longshuicy Mar 6, 2024
1f901a0
add authorization logic
longshuicy Mar 6, 2024
d930904
sorting is working now
longshuicy Mar 6, 2024
85376dc
fix the origin id logic
longshuicy Mar 6, 2024
30587b1
there is a bug in wrong origin id when second time publish
longshuicy Mar 6, 2024
7b0b1c8
fix backend bug
longshuicy Mar 6, 2024
83480ed
change version text
longshuicy Mar 7, 2024
d47c2ee
fix frontend logic
longshuicy Mar 7, 2024
b326b43
temp map origin_id to id
longshuicy Mar 7, 2024
fb9cebc
fix query with origin id
longshuicy Mar 8, 2024
6a77cd3
fix the logic that a dataset id on the client point of view will neve…
longshuicy Mar 8, 2024
9396b30
freeze draft action coded in redux
longshuicy Mar 8, 2024
084722b
fix id
longshuicy Mar 12, 2024
7563aa6
Merge branch 'main' into 918-ability-to-freeze-datasets-or-version
longshuicy Apr 18, 2024
ab799fe
revert change on file role since it's not in the scope of this PR
longshuicy Apr 18, 2024
07c4b8f
wrong method
longshuicy Apr 18, 2024
39239bd
separate out dataset and frozen dataset
longshuicy Apr 18, 2024
20cd09e
remove freeze version chip
longshuicy Apr 19, 2024
03c48fe
backend rewrite
longshuicy Apr 19, 2024
36d863e
write the logic of frozen
longshuicy Apr 19, 2024
7ba915f
add snackbar
longshuicy Apr 19, 2024
9ec4081
refactor the latest endpoint
longshuicy Apr 19, 2024
c0290ae
add a selection
longshuicy Apr 19, 2024
5cd6889
selection is working now
longshuicy Apr 19, 2024
d78ee9a
connect version change with backend
longshuicy Apr 22, 2024
049b308
separate out freeze dataset
longshuicy Apr 22, 2024
a38b9f6
fix a metadata get bug
longshuicy Apr 22, 2024
073d9ff
new endpoint and new widgets
longshuicy Apr 22, 2024
d2491a2
union is working now
longshuicy Apr 23, 2024
3de9a7f
add an endpoint to list and paginate through all the versions
longshuicy Apr 23, 2024
5de729a
add to reducer
longshuicy Apr 23, 2024
70cb675
switching between versions working
longshuicy Apr 23, 2024
80b2c99
file and folder listing using the view
longshuicy Apr 23, 2024
4f180e4
add frozen chip ugly
longshuicy Apr 23, 2024
586dcaa
update file page
longshuicy Apr 23, 2024
6f51268
recursively freeze file and folder
longshuicy Apr 24, 2024
e4ea1c1
download file is working
longshuicy Apr 24, 2024
560f3ce
normal download nested folders are working
longshuicy Apr 24, 2024
a20546b
fix bug recursive freeze folder
longshuicy Apr 24, 2024
474f38f
download dataset is fixed now
longshuicy Apr 24, 2024
2bae001
metadata is working now
longshuicy Apr 24, 2024
f2c5d6b
folder path
longshuicy Apr 24, 2024
ac78bf9
fix the current tab error
longshuicy Apr 24, 2024
438477f
update the chip
longshuicy Apr 24, 2024
14c31e2
create new version now reflected
longshuicy Apr 24, 2024
d70067b
Merge branch 'main' into 918-ability-to-freeze-datasets-or-version
longshuicy Apr 24, 2024
d222379
update based on the feedbacks
longshuicy Apr 25, 2024
3235f54
fix bug in recursively freeze file/folder
longshuicy Apr 25, 2024
6c749d3
fix bug in switching to file version
longshuicy Apr 25, 2024
0a14a02
fix bug after renaming versioning is not updating
longshuicy Apr 25, 2024
03850ad
backend public dataset reflect freeze dataset
longshuicy Apr 25, 2024
70fea68
implementing public related
longshuicy Apr 25, 2024
8b200e0
fix public file page
longshuicy Apr 25, 2024
c089a14
list public dataset version is working now
longshuicy Apr 25, 2024
85dc145
fix all the public related bugs I can think of
longshuicy Apr 25, 2024
3d5841a
unhide visualization
longshuicy Apr 25, 2024
65b1631
add models to handle vis for frozen datasets
longshuicy May 6, 2024
dcc5920
add support for visualization and thumnail
longshuicy May 6, 2024
2d1b11c
fix mongoview bug
longshuicy May 6, 2024
67a31b2
fix thumbnail bug
longshuicy May 6, 2024
8453e0c
fix frontend bug
longshuicy May 6, 2024
bb84222
fix thumbnail bug with public dataset
longshuicy May 6, 2024
a64687d
change the wording
longshuicy May 16, 2024
782df25
Merge branch 'main' into 918-ability-to-freeze-datasets-or-version
longshuicy May 16, 2024
ebf3b64
duplicate dataset details
longshuicy May 16, 2024
90eb369
1039 dataset versions show in links (#1057)
longshuicy May 23, 2024
a6624a0
Merge branch 'main' into 918-ability-to-freeze-datasets-or-version
longshuicy Jun 3, 2024
0e22674
add folder to action text
longshuicy Jun 3, 2024
391571a
wrap style into function; fix bugs
longshuicy Jun 3, 2024
c56520d
turn off scrollbutton to avoid tab position change when switching ver…
longshuicy Jun 4, 2024
14dd1df
change the wording to latest; don't show snackbar when it's latest
longshuicy Jun 4, 2024
6b43641
fix viewing -999 bug
longshuicy Jun 4, 2024
a063d9d
1040 delete given dataset version (#1063)
longshuicy Jun 12, 2024
06bbca4
Merge branch 'main' into 918-ability-to-freeze-datasets-or-version
longshuicy Jun 13, 2024
adcc421
fix a potential bug when updating dataset
longshuicy Jun 13, 2024
ffb78c5
Versioning documentation (#1044)
longshuicy Jun 13, 2024
aaaccca
Merge branch 'main' into 918-ability-to-freeze-datasets-or-version
longshuicy Jun 13, 2024
55d9ef5
Merge branch 'main' into 918-ability-to-freeze-datasets-or-version
longshuicy Jun 28, 2024
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 .flake8
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[flake8]
max-line-length = 180
extend-ignore = E203, E266, E501, W503, E741, E711
extend-ignore = E203, E266, E501, W503, E741, E711, E712
exclude = .svn,CVS,.bzr,.hg,.git,__pycache__,venv/*,src/*,.rst,build
max-complexity=16
21 changes: 21 additions & 0 deletions backend/app/db/dataset/download.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from app.models.datasets import DatasetDB, DatasetFreezeDB
from beanie import PydanticObjectId
from beanie.odm.operators.update.general import Inc


async def _increment_data_downloads(dataset_id: str):
# if working draft
if (
dataset := await DatasetDB.find_one(
DatasetDB.id == PydanticObjectId(dataset_id)
)
) is not None:
await dataset.update(Inc({DatasetDB.downloads: 1}))

# if published version
if (
dataset := await DatasetFreezeDB.find_one(
DatasetFreezeDB.id == PydanticObjectId(dataset_id)
)
) is not None:
await dataset.update(Inc({DatasetFreezeDB.downloads: 1}))
Loading
Loading