Skip to content

Commit

Permalink
Merge pull request #3 from duffn/master
Browse files Browse the repository at this point in the history
Updating to new source
  • Loading branch information
Xunrel authored Mar 4, 2020
2 parents b26b92d + 66c27a3 commit 04987f0
Show file tree
Hide file tree
Showing 11 changed files with 210 additions and 97 deletions.
4 changes: 2 additions & 2 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ exports.createSchemaCustomization = ({ actions }) => {
category: String
price: Int
restricted: Boolean
encumbrance: Int
encumbrance: String
hp: Int
rarity: Int
rarity: String
index: String
generatedId: String!
}
Expand Down
84 changes: 45 additions & 39 deletions src/components/WeaponAttachmentsColumnProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,58 @@ import {
makeColumns,
RESTRICTED_COL_INDEX,
GENERATED_ID_COL_INDEX,
indexRender
indexRender,
} from "./shared/ColumnHelper"
import ProvideBookData from "./shared/BookDataProvider"

export default function WeaponAttachmentsColumnProvider({children, currentBook}){
export default function WeaponAttachmentsColumnProvider({
children,
currentBook,
}) {
let bookData = ProvideBookData()
let columns = makeColumns([
{
label: "Name",
name: "name",
options: {
customBodyRender: (value, tableMeta) => (
<Link
to={`/weapon-attachments/${tableMeta.rowData[GENERATED_ID_COL_INDEX]}/`}
>
{value}
</Link>
),
sortDirection: "asc",
filter: false,
let columns = makeColumns(
[
{
label: "Name",
name: "name",
options: {
customBodyRender: (value, tableMeta) => (
<Link
to={`/weapon-attachments/${tableMeta.rowData[GENERATED_ID_COL_INDEX]}/`}
>
{value}
</Link>
),
sortDirection: "asc",
filter: false,
},
},
},
{ label: "Category", name: "category" },
{
label: "Price",
name: "price",
options: {
customBodyRender: (value, tableMeta) =>
`${
tableMeta.rowData[RESTRICTED_COL_INDEX] ? "(R) " : ""
}${value.toLocaleString()}`,
{ label: "Category", name: "category" },
{
label: "Price",
name: "price",
options: {
customBodyRender: (value, tableMeta) =>
`${
tableMeta.rowData[RESTRICTED_COL_INDEX] ? "(R) " : ""
}${value.toLocaleString()}`,
},
},
},
{ label: "Encum.", name: "encumbrance" },
{ label: "HP", name: "hp" },
{ label: "Rarity", name: "rarity" },
{
label: "Index",
name: "index",
options: {
filter: false,
customBodyRender: (value, tableMeta) =>
indexRender(value, tableMeta, bookData, currentBook),
{ label: "Encum.", name: "encumbrance", options: { sort: false } },
{ label: "HP", name: "hp" },
{ label: "Rarity", name: "rarity", options: { sort: false } },
{
label: "Index",
name: "index",
options: {
filter: false,
customBodyRender: (value, tableMeta) =>
indexRender(value, tableMeta, bookData, currentBook),
},
},
},
], true)
],
true
)

return React.cloneElement(React.Children.only(children), { columns })
}
4 changes: 2 additions & 2 deletions src/components/shared/ColumnHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ export function indexRender(value, tableMeta, bookData, currentBook) {
.filter(node => node.generatedId === idAndPage[0])

return currentBook !== idAndPage[0] ? (
<span key={tableMeta.rowData[GENERATED_ID_COL_INDEX]}>
<span key={`${tableMeta.rowData[GENERATED_ID_COL_INDEX]}-${count}`}>
<Link to={`/books/${idAndPage[0]}/`}>{book[0].name}</Link>:
{idAndPage[1]}
{count !== indices.length - 1 ? ", " : ""}
</span>
) : (
<span key={tableMeta.rowData[GENERATED_ID_COL_INDEX]}>
<span key={`${tableMeta.rowData[GENERATED_ID_COL_INDEX]}-${count}`}>
{book[0].name}:{idAndPage[1]}
{count !== indices.length - 1 ? ", " : ""}
</span>
Expand Down
6 changes: 3 additions & 3 deletions src/components/shared/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@ export default function Dashboard({ children }) {
}}
inputProps={{
"aria-label": "toolbar search",
autocapitalize: "off",
autocorrect: "off",
autocomplete: "off",
autoCapitalize: "off",
autoCorrect: "off",
autoComplete: "off",
}}
name="q"
/>
Expand Down
7 changes: 3 additions & 4 deletions src/components/shared/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,20 @@ export default function SearchComponent({ searchIndex, location }) {
<Grid container item xs={12}>
<List>
{results.map(page => (
<>
<React.Fragment key={page.generatedId}>
<ListItem
color="inherit"
button
component={Link}
to={page.link}
key={page.generatedId}
>
<ListItemText
primary={page.name}
secondary={page.resourceType}
/>
</ListItem>
<Divider component="li" key={`div_${page.generatedId}`} />
</>
<Divider component="li" />
</React.Fragment>
))}
</List>
</Grid>
Expand Down
6 changes: 5 additions & 1 deletion src/data/abilities.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@
index: d7a5ca79-8e91-4d2a-bc3e-e158ec42530f:46
generatedId: a6954fe2-ec15-491d-a191-0f803ffc5d5e
- name: Four-armed
description: The [SPECIES gains [BOOST] on all Brawl checks and may spend [ADVANTAGE][ADVANTAGE] on a successful melee attack to hit a second target engaged with it, dealing the same damage as dealt to the original target.
description: The [SPECIES] gains [BOOST] on all Brawl checks and may spend [ADVANTAGE][ADVANTAGE] on a successful melee attack to hit a second target engaged with it, dealing the same damage as dealt to the original target.
index: 37ee73a9-01c8-440c-a734-ea52e2ff780a:415, cf023ae2-5206-49e0-9e39-550bba0f7f56:101
generatedId: b9d4dd3b-ceab-4c3c-8c2f-668edd8ceb81
- name: Frightening Visage
Expand Down Expand Up @@ -1223,3 +1223,7 @@
description: "Add [BOOST] equal to ranks in Trained Mount to a rider's Survival checks while mounted on a [SPECIES]."
index: 04196a88-99d9-4018-83ef-ca37d68a4869:121
generatedId: eec8a481-6369-433f-a682-e1e18cd7affa
- name: Four-armed
description: Gains an additional free maneuver per turn, but still may not perform more than two maneuvers per turn.
index: cf023ae2-5206-49e0-9e39-550bba0f7f56:101
generatedId: 81fafe1e-8829-4776-bd5c-6492f7aa2fc1
76 changes: 38 additions & 38 deletions src/data/content-status.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@
- book: Allies and Adversaries
resource: Armor
source: The Outer Rim
entered: No
audited: No
entered: Yes
audited: Yes
- book: Allies and Adversaries
resource: Creatures
source: The Outer Rim
Expand All @@ -312,13 +312,13 @@
- book: Allies and Adversaries
resource: Gear
source: The Outer Rim
entered: No
audited: No
entered: Yes
audited: Yes
- book: Allies and Adversaries
resource: Qualities
source: The Outer Rim
entered: No
audited: No
entered: Yes
audited: Yes
- book: Allies and Adversaries
resource: Skills
source: The Outer Rim
Expand All @@ -332,33 +332,33 @@
- book: Allies and Adversaries
resource: Starships
source: The Outer Rim
entered: No
audited: No
entered: Yes
audited: Yes
- book: Allies and Adversaries
resource: Talents
source: The Outer Rim
entered: No
audited: No
entered: Yes
audited: Yes
- book: Allies and Adversaries
resource: Vehicle Attachments
source: The Outer Rim
entered: No
audited: No
entered: Yes
audited: Yes
- book: Allies and Adversaries
resource: Vehicles
source: The Outer Rim
entered: No
audited: No
entered: Yes
audited: Yes
- book: Allies and Adversaries
resource: Weapon Attachments
source: The Outer Rim
entered: No
audited: No
entered: Yes
audited: Yes
- book: Allies and Adversaries
resource: Weapons
source: The Outer Rim
entered: No
audited: No
entered: Yes
audited: Yes
- book: Beyond the Rim
resource: Abilities
source: Viluppo
Expand Down Expand Up @@ -712,8 +712,8 @@
- book: Collapse of the Republic
resource: Weapon Attachments
source: The Outer Rim
entered: No
audited: No
entered: Yes
audited: Yes
- book: Collapse of the Republic
resource: Weapons
source: The Outer Rim
Expand Down Expand Up @@ -2432,92 +2432,92 @@
- book: Fully Operational
resource: Abilities
source: Viluppo
entered: Yes
entered: No
audited: No
- book: Fully Operational
resource: Adversaries
source: Viluppo
entered: Yes
entered: No
audited: No
- book: Fully Operational
resource: Adversaries Armor
source: Viluppo
entered: Yes
entered: No
audited: No
- book: Fully Operational
resource: Adversaries Gear
source: Viluppo
entered: Yes
entered: No
audited: No
- book: Fully Operational
resource: Adversaries Weapons
source: Viluppo
entered: Yes
entered: No
audited: No
- book: Fully Operational
resource: Armor
source: Viluppo
entered: Yes
entered: No
audited: No
- book: Fully Operational
resource: Creatures
source: Viluppo
entered: Yes
entered: No
audited: No
- book: Fully Operational
resource: Creatures Weapons
source: Viluppo
entered: Yes
entered: No
audited: No
- book: Fully Operational
resource: Gear
source: Viluppo
entered: Yes
entered: No
audited: No
- book: Fully Operational
resource: Qualities
source: Viluppo
entered: Yes
entered: No
audited: No
- book: Fully Operational
resource: Skills
source: Viluppo
entered: Yes
entered: No
audited: No
- book: Fully Operational
resource: Species
source: Viluppo
entered: Yes
entered: No
audited: No
- book: Fully Operational
resource: Starships
source: Viluppo
entered: Yes
entered: No
audited: No
- book: Fully Operational
resource: Talents
source: Viluppo
entered: Yes
entered: No
audited: No
- book: Fully Operational
resource: Vehicle Attachments
source: Viluppo
entered: Yes
entered: No
audited: No
- book: Fully Operational
resource: Vehicles
source: Viluppo
entered: Yes
entered: No
audited: No
- book: Fully Operational
resource: Weapon Attachments
source: Viluppo
entered: Yes
entered: No
audited: No
- book: Fully Operational
resource: Weapons
source: Viluppo
entered: Yes
entered: No
audited: No
- book: Gadgets and Gear
resource: Abilities
Expand Down
4 changes: 2 additions & 2 deletions src/data/skills.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
- name: Lightsaber
characteristic: Brawn
type: Combat
index: 37ee73a9-01c8-440c-a734-ea52e2ff780a:412, d7a5ca79-8e91-4d2a-bc3e-e158ec42530f:23, be0796d8-6ef1-43ec-9fd6-5164e1982bb8:130, cf023ae2-5206-49e0-9e39-550bba0f7f56:36, 47080550-507f-4fa7-b206-f84451a997c6:110, 04196a88-99d9-4018-83ef-ca37d68a4869:36
index: 37ee73a9-01c8-440c-a734-ea52e2ff780a:412, d7a5ca79-8e91-4d2a-bc3e-e158ec42530f:23, be0796d8-6ef1-43ec-9fd6-5164e1982bb8:130, cf023ae2-5206-49e0-9e39-550bba0f7f56:36, 47080550-507f-4fa7-b206-f84451a997c6:110, 04196a88-99d9-4018-83ef-ca37d68a4869:36, 5cf48215-d8d4-416b-bcc4-6397af0242eb:6
generatedId: aed34c1e-1872-4140-b2dd-d98530f2dcb5
- name: Lore
characteristic: Intellect
Expand Down Expand Up @@ -182,7 +182,7 @@
- name: Warfare
characteristic: Intellect
type: Knowledge
index: f34ec89d-b99e-4b0c-b9c6-562894526075:136, cf023ae2-5206-49e0-9e39-550bba0f7f56:36, 47080550-507f-4fa7-b206-f84451a997c6:110, 04196a88-99d9-4018-83ef-ca37d68a4869:36
index: f34ec89d-b99e-4b0c-b9c6-562894526075:136, cf023ae2-5206-49e0-9e39-550bba0f7f56:36, 47080550-507f-4fa7-b206-f84451a997c6:110, 04196a88-99d9-4018-83ef-ca37d68a4869:36, 5cf48215-d8d4-416b-bcc4-6397af0242eb:6
generatedId: a8f9b677-37f8-47b0-bfb1-d5421f904c4b
- name: Xenology
characteristic: Intellect
Expand Down
Loading

0 comments on commit 04987f0

Please sign in to comment.