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

Release 0.14.3 #409

Merged
merged 7 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 pephub/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.14.2"
__version__ = "0.14.3"
5 changes: 5 additions & 0 deletions pephub/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ def get_organizations_from_session_info(
organizations = []
if session_info:
organizations = session_info.get("orgs")
if organizations:
organizations = [x.lower() for x in organizations]
return organizations


Expand All @@ -171,6 +173,8 @@ def get_user_from_session_info(
user = None
if session_info:
user = session_info.get("login")
if user:
user = user.lower()
return user


Expand All @@ -186,6 +190,7 @@ def get_namespace_access_list(
if user:
access_rights.append(user)
access_rights.extend(orgs)
access_rights = [x.lower() for x in access_rights]
return access_rights
else:
return []
Expand Down
2 changes: 1 addition & 1 deletion pephub/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def zip_pep(project: Dict[str, Any]) -> Response:
project_name = config[NAME_KEY]

if project[SAMPLE_RAW_DICT_KEY] is not None:
config[CFG_SAMPLE_TABLE_KEY] = ["sample_table.csv"]
config[CFG_SAMPLE_TABLE_KEY] = "sample_table.csv"
content_to_zip["sample_table.csv"] = pd.DataFrame(
project[SAMPLE_RAW_DICT_KEY]
).to_csv(index=False)
Expand Down
4 changes: 4 additions & 0 deletions pephub/routers/auth/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,15 @@ def callback(
"https://api.github.com/user",
headers={"Authorization": f"Bearer {x['access_token']}"},
).json()
if "login" in u:
u["login"] = u["login"].lower()

organizations = requests.get(
u["organizations_url"],
headers={"Authorization": f"Bearer {x['access_token']}"},
).json()
for org in organizations:
org["login"] = org["login"].lower()

# encode the token
token = CLIAuthSystem.jwt_encode_user_data(
Expand Down
27 changes: 14 additions & 13 deletions web/src/components/forms/project-upload-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { useSession } from '../../contexts/session-context';
import { useUploadMutation } from '../../hooks/mutations/useUploadMutation';
import { popFileFromFileList } from '../../utils/dragndrop';
import { GitHubAvatar } from '../badges/github-avatar';
import { CombinedErrorMessage } from './components/combined-error-message';
import { FileDropZone } from './components/file-dropzone';
import { SchemaDropdown } from './components/schemas-databio-dropdown';
import { CombinedErrorMessage } from './components/combined-error-message'

interface FromFileInputs {
is_private: boolean;
Expand Down Expand Up @@ -106,29 +106,29 @@ export const ProjectUploadForm = ({ onHide, defaultNamespace }: Props) => {
{...register('name', {
required: {
value: true,
message: "empty",
message: 'empty',
},
pattern: {
value: /^[a-zA-Z0-9_-]+$/,
message: "invalid",
message: 'invalid',
},
})}
/>
<span className="mx-1 mb-1">:</span>
</div>
<div className="d-flex flex-row align-items-center justify-content-between w-full ">
<input
<input
{...register('tag', {
required: false,
required: false,
pattern: {
value: /^[a-zA-Z0-9_-]+$/,
message: "invalid",
message: 'invalid',
},
})}
id="tag"
type="text"
className="form-control"
placeholder="default"
id="tag"
type="text"
className="form-control"
placeholder="default"
/>
</div>
</div>
Expand Down Expand Up @@ -185,8 +185,9 @@ export const ProjectUploadForm = ({ onHide, defaultNamespace }: Props) => {
) : (
<FileDropZone name="files" control={control} multiple={true} innerRef={fileDialogRef} />
)}
<p className='text-xs mt-1'>
* Namespace and Project Name are required. A tag value of "default" will be supplied if the Tag input is left empty.
<p className="text-xs mt-1">
* Namespace and Project Name are required. A tag value of "default" will be supplied if the Tag input is left
empty.
</p>
<div className="mt-3">
<button
Expand All @@ -202,7 +203,7 @@ export const ProjectUploadForm = ({ onHide, defaultNamespace }: Props) => {
isPrivate,
description,
files: uploadFiles,
pepSchema,
pepSchema: pepSchema || 'databio/pep-2.1.0',
},
{
onSuccess: () => {
Expand Down
Loading