Skip to content

Commit

Permalink
Remove more <Link> components
Browse files Browse the repository at this point in the history
  • Loading branch information
eyeseast committed Feb 1, 2024
1 parent 2ab8360 commit 9ef85d5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/config/staging.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const DC_BASE = "https://api.muckcloud.com";
export const APP_URL = "https://muckcloud.com";
export const APP_URL = "https://muckcloud.com/";
export const EMBED_URL = "https://muckcloud.com";
export const SQUARELET_BASE = "https://squarelet-staging.herokuapp.com";
export const STAFF_ONLY_S3_URL =
Expand Down
29 changes: 14 additions & 15 deletions src/pages/app/Document.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import Image from "@/common/Image.svelte";
import Progress from "@/common/Progress.svelte";
import HtmlField from "@/common/HtmlField.svelte";
import Link from "@/router/Link.svelte";
import DocumentThumbnail from "./DocumentThumbnail.svelte";
import Annotation from "@/pages/viewer/Annotation.svelte";
Expand Down Expand Up @@ -145,13 +144,13 @@
{#if !embed}
<div class="actions">
{#if document.viewable}
<Link to="viewer" params={{ id: document.slugId }}>
<Button action={true}>{$_("document.open")}</Button>
</Link>
<a href={document.canonicalUrl}>

Check warning on line 147 in src/pages/app/Document.svelte

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
<Button action>{$_("document.open")}</Button>

Check warning on line 148 in src/pages/app/Document.svelte

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
</a>
{#if document.readable}
<div class="updating">
{$_("document.updating")}
<Progress initializing={true} progress={0} compact={true} />
<Progress initializing compact progress={0} />
</div>
{/if}
{:else if document.pending}
Expand Down Expand Up @@ -181,21 +180,21 @@
{#if document.projectIds != null}
{#each document.projectIds as id}
{#if $projects.projectsById[id] != null}
<Link toUrl={projectUrl($projects.projectsById[id])}>
<a href={projectUrl($projects.projectsById[id])}>
<Button plain={true}>
<div class="smallinfo">{$_("document.project")}</div>
{$projects.projectsById[id].title}
</Button>
</Link>
</a>

Check warning on line 188 in src/pages/app/Document.svelte

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
{/if}
{/each}
{#each document.dataPoints as { key, value }}
<Link toUrl={dataUrl(key, value)}>
<a href={dataUrl(key, value)}>
<Button plain={true}>
{#if key != TAG_KEY}{key}:{/if}
{value}
</Button>
</Link>
</a>
{/each}

Check warning on line 198 in src/pages/app/Document.svelte

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
{#if document.dataPoints.length > 0 && document.editAccess}
<button
Expand Down Expand Up @@ -243,9 +242,9 @@
<div class="highlights">
{#each highlights as highlight}
<div>
<Link
inlineBlock={true}
toUrl={document.relativePageUrl(highlight.page + 1)}
<a
class="ib"

Check warning on line 246 in src/pages/app/Document.svelte

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
href={document.relativePageUrl(highlight.page + 1)}
>
<div class="row">
<div class="page">
Expand All @@ -270,7 +269,7 @@
</div>
{/each}
</div>
</Link>
</a>

Check warning on line 272 in src/pages/app/Document.svelte

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 272 in src/pages/app/Document.svelte

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch

Check warning on line 272 in src/pages/app/Document.svelte

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
</div>
{/each}
</div>
Expand All @@ -291,7 +290,7 @@
<div class="highlights note-highlights">
{#each noteHighlights as highlight}
<div>
<Link toUrl={document.relativeNoteUrl(highlight.note)}>
<a href={document.relativeNoteUrl(highlight.note)}>

Check warning on line 293 in src/pages/app/Document.svelte

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function
<!-- to get correct aspect ratio we would need to store the page spec
in solr
--->
Expand All @@ -310,7 +309,7 @@
titlePassages={highlight.titlePassages}
hlContent={highlight.hlContent}
/>
</Link>
</a>

Check warning on line 312 in src/pages/app/Document.svelte

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 312 in src/pages/app/Document.svelte

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch

Check warning on line 312 in src/pages/app/Document.svelte

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
</div>
{/each}
</div>
Expand Down
5 changes: 5 additions & 0 deletions src/style/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ details.dc summary {

a {
color: inherit;
cursor: pointer;
text-decoration: inherit;
}

Expand All @@ -118,6 +119,10 @@ a.active .project:hover {
opacity: 1;
}

a.ib {
display: inline-block;
}

/* Mixins */
.document-cell {
display: table-cell;
Expand Down

0 comments on commit 9ef85d5

Please sign in to comment.