Skip to content
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

feat: guest fixes added to missing save file fixes #377

Merged
merged 26 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
8002ce9
Merge pull request #375 from fairdataihub/pre-staging
aaronm-2112 Dec 2, 2024
e328d0f
chore: remove console logs
aaronm-2112 Dec 2, 2024
9b86897
chore: update changelog for 15.3.0
aaronm-2112 Dec 2, 2024
0342b6c
chore: update announcements for 15.3.0 release
aaronm-2112 Dec 2, 2024
281532d
refactor: PLP change to only exclude viewers
aaronm-2112 Dec 4, 2024
710b575
style: 🎨 fix code style issues with Prettier
fairdataihub-bot Dec 4, 2024
6b4f3ca
feat: check if a user is a guest in their active workspace
aaronm-2112 Dec 4, 2024
3a5af5b
Merge branch 'guest-contributor-fixes' of https://github.com/fairdata…
aaronm-2112 Dec 4, 2024
ac1b85f
style: 🎨 fix code style issues with Prettier
fairdataihub-bot Dec 4, 2024
2e27b82
test: workaround for guest users to upload
aaronm-2112 Dec 5, 2024
603a31a
test: workaround ofr guest user uploads
aaronm-2112 Dec 5, 2024
ad17203
style: 🎨 fix code style issues with Prettier
fairdataihub-bot Dec 5, 2024
9f307b3
build: spawn windows builds form guest workaroun
aaronm-2112 Dec 5, 2024
300c62f
Merge branch 'guest-contributor-fixes' of https://github.com/fairdata…
aaronm-2112 Dec 5, 2024
08419f1
build: spawn linux builds form guest workaroun
aaronm-2112 Dec 5, 2024
81709ee
refactor: guest can upload metadata if they are a manager
aaronm-2112 Dec 5, 2024
7b13c9c
style: 🎨 fix code style issues with Prettier
fairdataihub-bot Dec 5, 2024
8c1da1a
refactor: use dataset id for import and metadata files
aaronm-2112 Dec 9, 2024
d1854d8
Merge branch 'guest-contributor-fixes' of https://github.com/fairdata…
aaronm-2112 Dec 9, 2024
d49f1ae
feat: reconcile dataset name if diffs local vs remote
aaronm-2112 Dec 9, 2024
2cc724b
feat: skip permissions page if guest pulling pennsieve dataset
aaronm-2112 Dec 10, 2024
821abf8
feat: unskip permissions on resume if non-guest + remove old skip logic
aaronm-2112 Dec 10, 2024
436b58e
chore: spawn new builds
aaronm-2112 Dec 13, 2024
8cc537d
fix: if resuming as guest and next page permissions save code doesnt …
aaronm-2112 Dec 13, 2024
fa5422d
fix: main user sets permissions then guest takes over their upload fails
aaronm-2112 Dec 13, 2024
8dd6b5c
wip: skip pennsieve metadata for editors
aaronm-2112 Dec 16, 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 .github/workflows/Build-and-deploy-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- main
- staging
- pre-staging
- folder-build
- guest-contributor-fixes

jobs:
deploy-on-linux:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Build-and-deploy-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- main
- staging
- pre-staging
- folder-build
- guest-contributor-fixes

jobs:
deploy-on-windows:
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to SODA will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## v15.3.0 - 2024-12-03

## Feature Additions:

- SODA will notify users if it is determined that a network setting may be preventing communication to the Pennsieve platform.
- The `Prepare Dataset Step-by-Step` feature allows users to resume curating a dataset even when that dataset saved files that have since been deleted from the computer.

## v15.2.3 - 2024-11-20

## Bug Fixes:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "soda-for-sparc",
"procductName": "SODA for SPARC",
"version": "15.2.4-beta",
"version": "15.3.0-beta",
"description": "Keep Calm and Curate",
"main": "./out/main/index.js",
"author": "SODA Team",
Expand Down
4 changes: 3 additions & 1 deletion src/pyflask/manageDatasets/manage_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,8 @@ def filter_dataset(datasets_list, store=None):
r = requests.get(f"{PENNSIEVE_URL}/datasets/{str(selected_dataset_id)}/role", headers=create_request_headers(get_access_token()))
r.raise_for_status()
user_role = r.json()["role"]
if user_role not in ["viewer", "editor"]:
namespace_logger.info(f"User role: {user_role}")
if user_role not in ["viewer"]:
store.append(
{"id": selected_dataset_id, "name": dataset['name'], "role": user_role, "intId": dataset["intId"]}
)
Expand All @@ -358,6 +359,7 @@ def filter_dataset(datasets_list, store=None):
[t.join() for t in threads]

sorted_bf_datasets = sorted(store, key=lambda k: k["name"].upper())
namespace_logger.info(f"Sorted datasets: {sorted_bf_datasets}")
return {"datasets": sorted_bf_datasets}

def get_username(accountname):
Expand Down
15 changes: 9 additions & 6 deletions src/pyflask/organizeDatasets/organize_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1157,13 +1157,16 @@ def createFolderStructure(subfolder_json, manifest):
# START
start = timer()

# check that the Pennsieve dataset is valid
try:
bf_dataset_name = soda_json_structure["bf-dataset-selected"]["dataset-name"]
except Exception as e:
raise e
if "digital-metadata" in soda_json_structure and "pennsieve-dataset-id" in soda_json_structure["digital-metadata"]:
selected_dataset_id = soda_json_structure["digital-metadata"]["pennsieve-dataset-id"]
else:
# check that the Pennsieve dataset is valid
try:
bf_dataset_name = soda_json_structure["bf-dataset-selected"]["dataset-name"]
except Exception as e:
raise e

selected_dataset_id = get_dataset_id(bf_dataset_name)
selected_dataset_id = get_dataset_id(bf_dataset_name)

# check that the user has permission to edit this dataset
try:
Expand Down
2 changes: 1 addition & 1 deletion src/pyflask/permissions/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ def has_edit_permissions(ps_or_token, selected_dataset_id):
except Exception as e:
abort(500, "Could not get permissions for this dataset.")

return role in ["owner", "manager"]
return role in ["owner", "manager", "editor"]
2 changes: 1 addition & 1 deletion src/pyflask/startup/minimumApiVersion.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def get_api_version():
"""


return {'version': os.getenv('API_VERSION', "15.2.4-beta")}
return {'version': os.getenv('API_VERSION', "15.3.0-beta")}



23 changes: 23 additions & 0 deletions src/renderer/src/scripts/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -2187,6 +2187,29 @@ const get_api_key = (login, password, key_name) => {
});
};

window.isWorkspaceGuest = async () => {
let userInfo = await api.getUserInformation();
let currentWorkspace = userInfo["preferredOrganization"];

let orgResponse;
try {
orgResponse = await client.get(`user/organizations`, {
params: {
selected_account: window.defaultBfAccount,
},
});
} catch (error) {
clientError(error);
// TODO: Handle error here
}

// get the current workspace by matching the id
let currentWorkspaceObj = orgResponse.data.organizations.filter(
(org) => org.organization.id === currentWorkspace
)[0];
return currentWorkspaceObj.isGuest;
};

export {
currentConTable,
showHideDropdownButtons,
Expand Down
Loading
Loading