Skip to content

Commit

Permalink
Merge pull request #397 from MuckRock/368-document-components
Browse files Browse the repository at this point in the history
Document components
  • Loading branch information
eyeseast authored Dec 20, 2023
2 parents 3f8ee9e + 4d90d73 commit 83e79b8
Show file tree
Hide file tree
Showing 17 changed files with 1,446 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ tests/fixtures/development.json

scratch/
dist/
storybook-static/
10 changes: 4 additions & 6 deletions src/common/dialog/DocumentPickerDialog.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@
}
</script>

<div>
<div class="mcontent">
<div class="documents">
<Documents dialog={true} embed={true} on:pick={handlePick} />
</div>
<div class="mcontent">
<div class="documents">
<Documents dialog={true} embed={true} on:pick={handlePick} />
</div>
</div>

<style lang="scss">
<style>
.documents {
padding: 0 10px;
}
Expand Down
2 changes: 2 additions & 0 deletions src/common/stories/Logo.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
export const meta = {
title: "Common / Logo",
component: Logo,
tags: ["autodocs"],
parameters: { layout: "centered" },
};
const args = {
Expand Down
28 changes: 20 additions & 8 deletions src/pages/app/Document.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -168,17 +168,23 @@
</Link>
{/each}
{#if document.dataPoints.length > 0 && document.editAccess}
<span class="pencil" on:click={() => editData([document])}>
<button
class="pencil buttonLike"
on:click={() => editData([document])}
>
{@html pencilSvg}
</span>
</button>
{/if}
{/if}
</div>
{#if document.highlights != null && document.highlights.length > 0 && !closeHighlights}
<div class="hinfo">
<span class="x" on:click={() => (closeHighlights = true)}>
<button
class="x buttonLike"
on:click={() => (closeHighlights = true)}
>
{@html closeSimpleSvg}
</span>
</button>

{#if moreToExpand}
<span>
Expand All @@ -189,9 +195,12 @@
},
})}
</span>
<span class="padleft" on:click={() => (expandHighlights = true)}>
<button
class="padleft buttonLike"
on:click={() => (expandHighlights = true)}
>
{$_("document.showAll")}
</span>
</button>
{:else}
<span>
{$_("document.matchingPages", {
Expand Down Expand Up @@ -239,9 +248,12 @@

{#if document.noteHighlights != null && document.noteHighlights.length > 0 && !closeNoteHighlights}
<div class="hinfo">
<span class="x" on:click={() => (closeNoteHighlights = true)}>
<button
class="x buttonLike"
on:click={() => (closeNoteHighlights = true)}
>
{@html closeSimpleSvg}
</span>
</button>

<span>Notes matching the query</span>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/pages/app/fixtures/addon_runs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "next": null, "previous": null, "results": [] }
46 changes: 46 additions & 0 deletions src/pages/app/fixtures/document.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"id": 1,
"access": "public",
"admin_noindex": false,
"asset_url": "https://s3.documentcloud.org/",
"canonical_url": "https://www.documentcloud.org/documents/1-a-i-g-bailout-the-inspector-generals-report",
"created_at": "2010-02-22T19:48:08.738905Z",
"data": {},
"description": "Neil Barofsky's report concludes that officials overseeing the rescue of the American International Group might have overpaid other banks to wrap up A.I.G.'s financial obligations.",
"edit_access": false,
"file_hash": "",
"noindex": false,
"language": "eng",
"organization": {
"id": 1,
"avatar_url": "https://cdn.muckrock.com/static/images/avatars/organization.png",
"individual": false,
"name": "DocumentCloud",
"slug": "dcloud",
"uuid": "99875da4-7b70-4150-b854-7ba5a3951f99"
},
"original_extension": "pdf",
"page_count": 47,
"page_spec": "612.0x792.0:0-46",
"projects": [46386, 6],
"publish_at": null,
"published_url": "",
"related_article": "",
"revision_control": false,
"slug": "a-i-g-bailout-the-inspector-generals-report",
"source": "Office of the Special Inspector General for T.A.R.P.",
"status": "success",
"title": "A.I.G. Bailout: The Inspector General's Report",
"updated_at": "2020-11-10T16:23:31.154198Z",
"user": {
"id": 1,
"avatar_url": "https://cdn.muckrock.com/static/images/avatars/profile.png",
"name": "Jeremy Ashkenas",
"organization": 24523,
"organizations": [24523],
"admin_organizations": [24523],
"username": "JeremyAshkenas_VfDHJpUE",
"uuid": "48175058-8eb8-44b8-943c-a705036ea840",
"verified_journalist": false
}
}
Loading

0 comments on commit 83e79b8

Please sign in to comment.