Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "reactmap",
"version": "1.7.4",
"version": "1.7.5",
"description": "React based frontend map.",
"main": "ReactMap.js",
"author": "TurtIeSocks <58572875+TurtIeSocks@users.noreply.github.com>",
Expand Down
6 changes: 4 additions & 2 deletions public/base-locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"slider_def_iv": "Defense",
"slider_sta_iv": "Stamina",
"slider_level": "Level",
"slider_size": "Size",
"abbreviation_level": "L",
"lvl": "Lvl",
"cap": "Cap",
Expand Down Expand Up @@ -568,5 +569,6 @@
"size_3": "M",
"size_4": "XL",
"size_5": "XXL",
"show_size_indicator": "Show Size Indicator"
}
"show_size_indicator": "Show Size Indicator",
"size": "Size"
}
2 changes: 2 additions & 0 deletions server/src/graphql/poracleTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ module.exports = gql`
min_time: Int
rarity: Int
max_rarity: Int
size: Int
max_size: Int
pvp_ranking_worst: Int
pvp_ranking_best: Int
pvp_ranking_min_cp: Int
Expand Down
6 changes: 3 additions & 3 deletions server/src/services/initWebhooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ module.exports = async function initWebhooks(webhook, config) {

if (
major < 4 ||
(major === 4 && minor < 5) ||
(major === 4 && minor === 5 && patch < 1)
(major === 4 && minor < 6) ||
(major === 4 && minor === 6 && patch < 0)
) {
throw new Error(
`Poracle must be at least version 4.5.1, current version is ${hookConfig.version}`,
`Poracle must be at least version 4.6.0, current version is ${hookConfig.version}`,
)
}

Expand Down
22 changes: 16 additions & 6 deletions server/src/services/ui/webhook.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ module.exports = function webhookUi(provider, hookConfig, pvp, leagues) {
max_iv: 100,
min_level: 0,
max_level: 40,
size: 1,
max_size: 5,
rarity: -1,
max_rarity: 6,
sta: 0,
Expand Down Expand Up @@ -107,22 +109,30 @@ module.exports = function webhookUi(provider, hookConfig, pvp, leagues) {
low: 'sta',
high: 'max_sta',
},
{
name: 'size',
label: '',
noTextInput: true,
min: 1,
max: 5,
perm: 'iv',
low: 'size',
high: 'max_size',
marks: [1, 2, 3, 4, 5],
markI18n: 'size_',
},
],
texts: [
{
name: 'min_time',
type: 'number',
max: 60,
adornment: 's',
xs: 4,
sm: 4,
xs: 12,
sm: 6,
width: 100,
},
],
booleans: [
{ name: 'xs', xs: 4, sm: 4, override: true },
{ name: 'xl', xs: 4, sm: 4, override: true },
],
},
pvp: {
selects: [
Expand Down
20 changes: 17 additions & 3 deletions src/components/layout/dialogs/filters/SliderTile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ export default function SliderTile({
high,
step,
i18nKey,
marks,
markI18n,
noTextInput,
},
handleChange,
filterValues,
Expand Down Expand Up @@ -56,14 +59,16 @@ export default function SliderTile({
}
}

if (!tempValues) return null

const textColor =
(tempValues[0] === min && tempValues[1] === max) || disabled
(tempValues && tempValues[0] === min && tempValues[1] === max) || disabled
? '#616161'
: 'white'

return (
<Grid container direction="row" justifyContent="center" alignItems="center">
<Grid item xs={4}>
<Grid item xs={noTextInput ? 12 : 4}>
<Typography
noWrap={fullName}
onClick={() => setFullName(!fullName)}
Expand All @@ -72,7 +77,7 @@ export default function SliderTile({
{t(i18nKey || `slider_${name}`)}
</Typography>
</Grid>
{['min', 'max'].map((each, index) => (
{(noTextInput ? [] : ['min', 'max']).map((each, index) => (
<Grid
item
xs={4}
Expand Down Expand Up @@ -118,7 +123,16 @@ export default function SliderTile({
}}
disabled={disabled}
valueLabelDisplay="auto"
valueLabelFormat={marks ? (e) => t(`${markI18n}${e}`) : undefined}
step={step}
marks={
marks
? marks.map((each) => ({
value: each,
label: t(`${markI18n}${each}`),
}))
: undefined
}
/>
</Grid>
</Grid>
Expand Down
13 changes: 12 additions & 1 deletion src/components/layout/dialogs/webhooks/WebhookAdv.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const skipFields = [
'gender',
'description',
'uid',
'max_size',
'id',
'ping',
'pokemon_id',
Expand Down Expand Up @@ -348,10 +349,20 @@ export default function WebhookAdvanced({
}

const checkDefaults = (field) => {
if (
field === 'size' &&
(poracleValues.size > 1 || poracleValues.max_size < 5)
)
return poracleValues.size === poracleValues.max_size
? `size:${t(`size_${poracleValues.size}`)}`
: `size:${t(`size_${poracleValues.size}`)}-${t(
`size_${poracleValues.max_size}`,
)}`

if (
field === 'distance' &&
poracleValues.byDistance &&
parseInt(poracleValues.distance)
+poracleValues.distance
)
return `d${poracleValues.distance}`
if (field === 'min_time' && parseInt(poracleValues.min_time))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export default function PokemonTile({ data, rowIndex, columnIndex, style }) {
newFilters &&
!Object.keys(newFilters).every((key) => newFilters[key] === item[key])
) {
// eslint-disable-next-line camelcase
setTempFilters({ [id]: { ...newFilters, enabled: true } })
setSend(true)
}
Expand Down
14 changes: 13 additions & 1 deletion src/services/Poracle.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,8 @@ export default class Poracle {
reactMapFriendly[`${key}_iv`] = [values[key], values[`max_${key}`]]
} else if (key.startsWith('rarity')) {
reactMapFriendly.rarity = [values[key], values[`max_${key}`]]
} else if (key.startsWith('size')) {
reactMapFriendly.size = [values[key], values[`max_${key}`]]
} else {
reactMapFriendly[key] = values[key]
}
Expand Down Expand Up @@ -471,7 +473,7 @@ export default class Poracle {
),
)
}
fields.forEach(
new Set(fields).forEach(
(field) =>
(newPokemon[field] =
pkmn[field] === undefined ? defaults[field] : pkmn[field]),
Expand Down Expand Up @@ -560,6 +562,16 @@ export default class Poracle {
}-${item.max_sta}${item.clean ? ` | ${t('clean')} ` : ''}${
item.distance ? ` | d${item.distance}` : ''
}`
}${
item.size > 1 || item.max_size < 5
? `${t('size', 'Size')}:${
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

? ` | ${t('size', 'Size')}:${
| is missing ;)

item.size === item.max_size
? `size:${t(`size_${item.size}`)}`
: `size:${t(`size_${item.size}`)}-${t(
`size_${item.max_size}`,
)}`
}`
: ''
}`
default:
return item.description
Expand Down
2 changes: 2 additions & 0 deletions src/services/queries/webhook.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ const Pokemon = gql`
pvp_ranking_worst
pvp_ranking_cap
rarity
size
max_size
sta
template
uid
Expand Down