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

Optional Dependencies Grid #169

Open
wants to merge 8 commits into
base: staging
Choose a base branch
from

Conversation

porisius
Copy link
Contributor

@porisius porisius commented Jun 7, 2024

may determine to create an optional dependency list later

may determine to create an optional dependency list later
Copy link

vercel bot commented Jun 7, 2024

@porisius is attempting to deploy a commit to the satisfactorymodding Team on Vercel.

A member of the Team first needs to authorize it.

@porisius
Copy link
Contributor Author

Really should require that the API PR satisfactorymodding/smr-api#51 be merged as well, but isn't truely required as that PR is just to solve a bug about mods not being tagged optional correctly.

@porisius porisius changed the title Filter Optional Dependencies from ModDependency List Optional Dependencies Grid Jun 11, 2024
@porisius porisius requested a review from budak7273 June 12, 2024 17:18
Copy link
Member

@budak7273 budak7273 left a comment

Choose a reason for hiding this comment

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

Adjusted according to what was discussed in Discord. We need a mod on staging with optional deps to test for real though

@budak7273
Copy link
Member

budak7273 commented Jun 20, 2024

DigbyTool has an optional version to test against, it works on local, hurrah!
image

Mod with no optionals:
image

Comment on lines +8 to +16
const requiredDependencies: Pick<VersionDependency, 'mod_id' | 'optional' | 'condition'>[] = [];
const optionalDependencies: Pick<VersionDependency, 'mod_id' | 'optional' | 'condition'>[] = [];
dependencies.forEach((dependency) => {
if (dependency.optional) {
optionalDependencies.push(dependency);
} else {
requiredDependencies.push(dependency);
}
});
Copy link
Member

Choose a reason for hiding this comment

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

These need to be reactive, as the component can be reused when navigating from one mod to another.

Suggested change
const requiredDependencies: Pick<VersionDependency, 'mod_id' | 'optional' | 'condition'>[] = [];
const optionalDependencies: Pick<VersionDependency, 'mod_id' | 'optional' | 'condition'>[] = [];
dependencies.forEach((dependency) => {
if (dependency.optional) {
optionalDependencies.push(dependency);
} else {
requiredDependencies.push(dependency);
}
});
$: requiredDependencies = dependencies.filter((d) => !d.optional);
$: optionalDependencies = dependencies.filter((d) => d.optional);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

None yet

3 participants