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

Group cart #188

Merged
merged 73 commits into from
Sep 20, 2024
Merged

Group cart #188

merged 73 commits into from
Sep 20, 2024

Conversation

GalMunGral
Copy link
Contributor

No description provided.

@@ -0,0 +1,150 @@
<div class="details">
Copy link
Contributor

Choose a reason for hiding this comment

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

eventually it'd be good to replace the magic numbers in this template file, too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll convert this to an issue.

<div
class="molecule"
>
<!-- <inplace class="molecule_name">-->
Copy link
Contributor

Choose a reason for hiding this comment

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

will this commented-out code be useful in the future?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it depends on whether we want to enable renaming after molecules are submitted to personal/group carts. Currently there is no endpoint to support that, so the commented-out input field won't be useful in itself. But it shouldn't be difficult to add that backend functionality if it becomes necessary. I'll delete this section for now.

</div>

<div class="molecule_content" [class.vertical]="vertical">
<!-- todo: add molecule preview here -->
Copy link
Contributor

Choose a reason for hiding this comment

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

has this "todo" comment already been addressed with the div.preview below it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like it. I'll remove this comment.

<div
class="value"
[innerHtml]="
getPredictedProperty(
Copy link
Contributor

Choose a reason for hiding this comment

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

this might never be a real performance problem, but we should consider adjusting the template a bit so getPredictedProperty() isn't being called every change-detection cycle

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What's a good way to approach this? It seems like a good use case for Angular Signals, specifically computed(). Or maybe RxJS combineLatest?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll create an issue for this.

<div class="button" (click)="updateMoleculeLabel(nameInput.value)">
Update
</div>
<!-- <div class="button" (click)="updateMoleculeLabel(nameInput.value)">-->
Copy link
Contributor

Choose a reason for hiding this comment

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

will this commented-out code be useful in the future?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think so. I'll delete this.

import { EnvironmentService } from './environment.service';
import { BlockSetId } from './block.service';

export const GUEST_USER = 'guest';
Copy link
Contributor

Choose a reason for hiding this comment

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

it could be nice if the frontend and backend shared a single source of truth on this name, but no need to do anything about it now

Copy link
Contributor

Choose a reason for hiding this comment

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

or does the backend even have a concept of a guest user? if not, you can ignore my comment above!

Copy link
Contributor Author

@GalMunGral GalMunGral Sep 10, 2024

Choose a reason for hiding this comment

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

The guest user is a fake user that only exists on the frontend. It's created here:

loginAsGuest() {
this.setUser({
id: -1,
name: 'Guest',
username: GUEST_USER,
access_token: '',
});
}

id: '1_g2u2woll',
title: 'Structure-Function',
description:
'Can can change the block information from structure to function view at any time. Click on an individual block to switch between function and structure modes',
Copy link
Contributor

Choose a reason for hiding this comment

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

typo here: "Can can"

Copy link
Contributor

Choose a reason for hiding this comment

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

the other descriptions end with a punctuation mark, so we should probably have one here, too, for consistency

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed!

id: '1_9qo362mt',
title: 'Zoom',
description:
'You can Zoom your in-process molecule, or click to reset to default view.',
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd vote for leaving "zoom" lowercase

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed!

{
id: '1_z7evpegt',
title: 'Filter',
description: 'Filter by block type using tags',
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest a period at the end

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed!

{
id: '1_qbzk4ge6',
title: 'Build and Properties',
description:
Copy link
Contributor

Choose a reason for hiding this comment

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

typo here: "(our touch)"

typo here: "it's properties"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed!

id: '1_m6hmfn2h',
title: 'Graph',
description:
'When you start making block choices, the graph will update with how many molecules are still possible.',
Copy link
Contributor

Choose a reason for hiding this comment

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

suggested rewording: "the graph will update to show the molecules that are still possible."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed!

{ id: 'build_002', class: 'wide' },
{ id: 'build_003', class: 'wide' },
{ id: 'build_004', class: 'wide' },
// { id: 'workspace', class: '' },
Copy link
Contributor

Choose a reason for hiding this comment

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

will these commented-out lines be useful in the future?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably not. I'll delete these lines and the associated template sections.

"lambdaMaxShift": 385,
"molecularWeight": 403.5
"molec
Copy link
Contributor

Choose a reason for hiding this comment

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

this is probably a dumb question on my part, but do we need the chemicalFormula and smiles fields?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we do need these fields. It’s just that we don’t have the correct formula and SMILES for Color Wheel yet. The original code simply concatenates the SMILES strings, which I believe produces invalid results. David Friday’s script requires reactive functional groups to be present, but we don’t have those in the Color Wheel JSON file.

Copy link
Contributor

@matthewberry matthewberry left a comment

Choose a reason for hiding this comment

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

nice work on this one, too, GalMunGral!

@GalMunGral GalMunGral merged commit 8a5d2e1 into develop Sep 20, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants