-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: target compatibility, mod dependency display (#81)
* User-friendly display of target compatibility Changes to solve #68 * made linter happy * Removed unused code, corrected position of pre-dedi comment * Lockfile for iconify, also solved lockfile fail * Fixed implicitly has an 'any' type, * 2x2 Target Chart/Icon, formatting wip * Display mod dependencies as well as link to mod page * Display mod dependencies as well as link to mod page Solves #67 * chore: concise checkTargets function * fix: correct download icon vertical alignment * chore: reduce code duplication in dependency mod links * urlWrap for source and Tag movement/formatting * moar Tag formatting * Removed unused packages * Multi-target/Mod Dependency formatting * made linter happy * Fixed :: on Tags * reformatted target widths * Moved compatibility info and converted it to a Grid * removed Multi Compability, fixed formatting * forgot to lint, sorry * fix: overflowing OutdatedBanner (closes #82) * feat: compatibility icons in grid header * chore: bash script to launch with the right env vars for dev * chore: fix typo it's almost a year old now, I will not allow it to have a happy birthday * feat: compatibility grid display for mods without compatibility info specified * feat: center mod icon on the page when displayed as a full page * feat: compatibility grid as a card * feat: compatibility edit button text changed "Compatibility" -> "Edit Compatibility" * feat: mention markdown support in compatibility edit popup * feat: extra spacing in compatibility viewing popup for improved readability * feat: tooltips for target compatibility icons * feat: display "(No tags assigned)" on mod page tag display when none present instead of empty space * feat: display "(No source URL provided by mod author)" when none present instead of empty space * feat: version target support grid as a component, now also present on View Version page * feat: version dependencies grid as a component, now also WIP present on View Version page ...except that api endpoint doesn't return dependencies yet * Added Multiplayer Compatibility * lint/prettier * Style for Multiplayer Compatbility * Word Wrap Fixes * Version Dependencies Grid GraphQL Fix * Fixed some imports per Mircea's request * Revert "Style for Multiplayer Compatbility" This reverts commit 70f1f8d. * Revert "lint/prettier" This reverts commit 82af767. * Revert "Added Multiplayer Compatibility" This reverts commit 70db911. * Path formatting fixes per Mircea * Fixed formatting paths * Removed casts, replaced with reactive version target support * Removed WindowsNoEditor * break-all Style => Class, removed optional ? for mod on ModInfo * chore: remove script from 7c4ced3 since it's in its own pr now * chore: fixes from code review * Added VersionTarget/VersionDependency to graphql keys config * fixed alignment of icons and text * feat: add sml engine version * chore: format --------- Co-authored-by: Robb <[email protected]> Co-authored-by: Vilsol <[email protected]>
- Loading branch information
1 parent
4b0758a
commit cfe479c
Showing
25 changed files
with
310 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,5 +25,9 @@ query GetModVersion($version: VersionID!) { | |
user_id | ||
} | ||
} | ||
dependencies { | ||
mod_id | ||
condition | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
src/lib/components/mods/compatibility/CompatibilityGrid.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
<script lang="ts"> | ||
import type { CompatibilityInfoInput } from '$lib/generated'; | ||
import Dialog, { Content as DialogContent, Title } from '@smui/dialog'; | ||
import Card, { Content as CardContent } from '@smui/card'; | ||
import CompatibilityInfo from '$lib/components/mods/compatibility/CompatibilityInfo.svelte'; | ||
import CompatibilityStateText from '$lib/components/mods/compatibility/CompatibilityStateText.svelte'; | ||
import Button from '@smui/button'; | ||
import DataTable, { Body, Row, Cell } from '@smui/data-table'; | ||
import { markdown } from '../../../utils/markdown'; | ||
import CompatibilityIcon from '$lib/components/mods/compatibility/CompatibilityIcon.svelte'; | ||
let open = false; | ||
export let compatibility: CompatibilityInfoInput; | ||
export const noNotesText = '(No extra notes)'; | ||
</script> | ||
|
||
<Card> | ||
<CardContent> | ||
<div class="grid grid-flow-row gap-y-2"> | ||
<h3 class="text-2xl my-4 font-bold">Compatibility Information</h3> | ||
<p>Click the colored text for more details.</p> | ||
<div class="grid grid-flow-row"> | ||
<DataTable | ||
table$aria-label="Available Releases" | ||
class="max-w-auto" | ||
container$class="!overflow-visible" | ||
table$class="!overflow-visible"> | ||
<Body> | ||
<Row> | ||
<Cell><div class="flex justify-center items-center"><CompatibilityIcon /> Early Access</div></Cell> | ||
<Cell | ||
><div class="flex justify-center items-center"> | ||
<CompatibilityIcon EXP={true} /> Experimental | ||
</div></Cell> | ||
</Row> | ||
<Row> | ||
<Cell class="text-center"> | ||
<Button | ||
--mdc-text-button-container-height="20px" | ||
class="min-w-0 m-0" | ||
title="Click for more information" | ||
on:click={() => { | ||
open = true; | ||
}}> | ||
<CompatibilityStateText state={compatibility?.EA?.state} /> | ||
</Button> | ||
</Cell> | ||
<Cell class="text-center"> | ||
<Button | ||
--mdc-text-button-container-height="20px" | ||
class="min-w-0 m-0" | ||
title="Click for more information" | ||
on:click={() => { | ||
open = true; | ||
}}> | ||
<CompatibilityStateText state={compatibility?.EXP?.state} /> | ||
</Button> | ||
</Cell> | ||
</Row> | ||
<Row> | ||
<Cell> | ||
<span style="padding: 2px; white-space:normal"> | ||
{#if compatibility?.EA?.note} | ||
{#await markdown(compatibility.EA.note) then rendered} | ||
{@html rendered} | ||
{/await} | ||
{:else} | ||
{noNotesText} | ||
{/if} | ||
</span> | ||
</Cell> | ||
<Cell> | ||
<span style="padding: 2px; white-space:normal"> | ||
{#if compatibility?.EXP?.note} | ||
{#await markdown(compatibility.EXP.note) then rendered} | ||
{@html rendered} | ||
{/await} | ||
{:else} | ||
{noNotesText} | ||
{/if} | ||
</span> | ||
</Cell> | ||
</Row> | ||
</Body> | ||
</DataTable> | ||
<Dialog bind:open> | ||
<Title>Compatibility Information</Title> | ||
<DialogContent> | ||
<CompatibilityInfo {compatibility} /> | ||
</DialogContent> | ||
</Dialog> | ||
</div> | ||
</div> | ||
</CardContent> | ||
</Card> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
src/lib/components/mods/compatibility/CompatibilityStateText.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
<script lang="ts"> | ||
import type { CompatibilityState } from '$lib/generated'; | ||
export let state: CompatibilityState; | ||
export let state: CompatibilityState = null; | ||
const classForState = (s: CompatibilityState): string => `mod-state-${s.toString().toLowerCase()}`; | ||
const textForState = state ?? 'Unknown'; | ||
const classForState = (s: string): string => `mod-state-${s.toString().toLowerCase()}`; | ||
</script> | ||
|
||
<p class="{classForState(state)} mod-state">{state}</p> | ||
<p class="{classForState(textForState)} mod-state">{textForState}</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.