Skip to content

Commit

Permalink
Only show primary fittings on doctrines list and other improvements (m…
Browse files Browse the repository at this point in the history
…inmatarfleet#693)

* Only show primary fittings on doctrines list and other improvements

* Console log cleanup
  • Loading branch information
beautifulmim authored Sep 5, 2024
1 parent c32ad37 commit 9cd5dcf
Show file tree
Hide file tree
Showing 27 changed files with 45 additions and 60 deletions.
1 change: 0 additions & 1 deletion frontend/app/src/components/blocks/CharacterFinder.astro
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ import MagnifierIcon from '@components/icons/buttons/MagnifierIcon.astro';
e.preventDefault()
show_characters_finder().then( (character_id) => {
console.log(character_id)
if (!character_id)
return
Expand Down
1 change: 0 additions & 1 deletion frontend/app/src/components/blocks/CorporationInfo.astro
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ let get_corporation_info_error:string | false = false
try {
corporation = await get_corporation_info(corporation_id)
console.log(corporation)
} catch (error) {
get_corporation_info_error = (prod_error_messages() ? t('get_corporation_info_error') : error.message)
}
Expand Down
31 changes: 19 additions & 12 deletions frontend/app/src/components/blocks/DoctrineDetails.astro
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,24 @@ import ArmorIcon from '@components/icons/ArmorIcon.astro';
}
</Flexblock>

<Flexblock gap='var(--space-xl)'>
<TextBox>
<Flexblock gap='var(--space-3xs)'>
<h2>{t('recently_flied')}</h2>
<small x-text={`\`\${recently_fleets_count} \${recently_fleets_count != 1 ? '${t('fleets').toLowerCase()}' : '${t('fleet').toLowerCase()}'} ${t('in_past_30_days').toLowerCase()}\``}>
{recently_fleets.length} {recently_fleets.length != 1 ? t('fleets').toLowerCase() : t('fleet').toLowerCase()} {t('in_past_30_days').toLowerCase()}
</small>
</Flexblock>
</TextBox>

<FleetList fleets={recently_fleets} history={true} />
</Flexblock>
{recently_fleets &&
<Flexblock gap='var(--space-xl)'>
<TextBox>
<Flexblock gap='var(--space-3xs)'>
<h2>{t('recently_flied')}</h2>
<small x-text={`\`\${recently_fleets_count} \${recently_fleets_count != 1 ? '${t('fleets').toLowerCase()}' : '${t('fleet').toLowerCase()}'} ${t('in_past_30_days').toLowerCase()}\``}>
{recently_fleets.length} {recently_fleets.length != 1 ? t('fleets').toLowerCase() : t('fleet').toLowerCase()} {t('in_past_30_days').toLowerCase()}
</small>
</Flexblock>
</TextBox>

{recently_fleets.length > 0 ?
<FleetList fleets={recently_fleets} history={true} />
:
<Flexblock gap='var(--space-xl)' centered={true}>
<p>{t('no_recent_fleets')}</p>
</Flexblock>
}
</Flexblock>
}
</Flexblock>
20 changes: 13 additions & 7 deletions frontend/app/src/components/blocks/DoctrineItem.astro
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ const {
doctrine,
...attributes
} = Astro.props
const show_primary_fittings = true
const show_secondary_fittings = false
const show_support_fittings = false
const show_subtitles = ((show_primary_fittings ? 1 : 0) + (show_secondary_fittings ? 1 : 0) + (show_support_fittings ? 1 : 0)) > 1
---

<Flexblock
Expand Down Expand Up @@ -68,45 +74,45 @@ const {
row_gap='var(--space-s-m)'
column_gap='var(--space-s-m)'
>
{doctrine.primary_fittings.map((fitting) =>
{show_primary_fittings && doctrine.primary_fittings.map((fitting) =>
<a
class="[ items-center flex ]"
role="listitem"
href={translatePath(`/ships/fitting/${fitting.id}`)}
>
<Badge
title={fitting.fitting_name}
subtitle={t('primary')}
subtitle={show_subtitles ? t('primary') : null}
image={get_item_icon(fitting.ship_id)}
size={64}
highlight={true}
/>
</a>
)}
{doctrine.secondary_fittings.map((fitting) =>
{show_secondary_fittings && doctrine.secondary_fittings.map((fitting) =>
<a
class="[ items-center flex ]"
role="listitem"
href={translatePath(`/ships/fitting/${fitting.id}`)}
>
<Badge
title={fitting.fitting_name}
subtitle={t('secondary')}
subtitle={show_subtitles ? t('secondary') : null}
image={get_item_icon(fitting.ship_id)}
size={64}
highlight={true}
/>
</a>
)}
{doctrine.support_fittings.map((fitting) =>
{show_support_fittings && doctrine.support_fittings.map((fitting) =>
<a
class="[ items-center flex ]"
role="listitem"
href={translatePath(`/ships/fitting/${fitting.id}`)}
>
<Badge
title={fitting.fitting_name}
subtitle={t('support')}
subtitle={show_subtitles ? t('support') : null}
image={get_item_icon(fitting.ship_id)}
size={64}
highlight={true}
Expand All @@ -115,7 +121,7 @@ const {
)}
</Grid>
<FlexInline
class="[ w-full items-center ]"
class="[ !hidden w-full items-center ]"
gap='var(--space-m)'
justification='space-between'
>
Expand Down
2 changes: 0 additions & 2 deletions frontend/app/src/components/blocks/DoctrineTier.astro
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ const {
ideal_composition = {},
} = Astro.props
console.log(ideal_composition)
import Grid from '@components/compositions/Grid.astro';
import Badge from '@components/blocks/Badge.astro';
---
Expand Down
4 changes: 2 additions & 2 deletions frontend/app/src/components/blocks/GroupRequestItem.astro
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ import StylessButton from './StylessButton.astro';
target: '${`#group-request-list-${group_request.group_id}`}',
swap: 'outerHTML transition:true'
}
}).then( (group_id) => console.log(group_id) )
})
}
}`}
x-on:click="show_accept_group_request_dialog()"
Expand Down Expand Up @@ -139,7 +139,7 @@ import StylessButton from './StylessButton.astro';
target: '${`#group-request-list-${group_request.group_id}`}',
swap: 'outerHTML transition:true'
}
}).then( (group_id) => console.log(group_id) )
})
}
}`}
x-on:click="show_deny_group_request_dialog()"
Expand Down
1 change: 0 additions & 1 deletion frontend/app/src/components/blocks/MoneyInput.astro
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import Input from '@components/blocks/Input.astro';
clamp(num, min, max) { return Math.min(Math.max(num, min), max); },
updateValue(value, mult, min, max) {
const num = value.replace(/[^-0-9\.]/g, '');
console.log({value,num});
return clamp(num * mult, min, max);
},
}`}
Expand Down
1 change: 0 additions & 1 deletion frontend/app/src/components/blocks/PageFinder.astro
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ import MagnifierIcon from '@components/icons/buttons/MagnifierIcon.astro';
filtered_pages: [ false ],
pages: ${JSON.stringify(filter_pages)},
page_filter() {
console.log('asd')
if (this.search === '') {
this.filtered_pages = ${JSON.stringify(filter_pages.map( (i) => i.slug ))}
return
Expand Down
2 changes: 0 additions & 2 deletions frontend/app/src/components/blocks/PushNotifications.astro
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ import RifterIcon from '@components/icons/RifterIcon.astro';
this.unregister_sw()
const registration = await navigator.serviceWorker.register('/js/notifications_sw.js?endpoint=${SUBSCRIPTION_URL}')
console.log(registration)
},
unregister_sw() {
console.log('registering/./')
navigator.serviceWorker.getRegistrations().then(registrations => {
for (const registration of registrations) {
registration.unregister()
Expand Down
2 changes: 0 additions & 2 deletions frontend/app/src/components/blocks/StationAssets.astro
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,12 @@ import StylessButton from './StylessButton.astro';
asset_name_filter: '',
assets_style: 'icons',
filter () {
console.log('filter')
if (this.asset_name_filter === '') {
this.assets_filtered = this.station_assets
return
}
this.assets_filtered = this.station_assets.filter( (asset) => asset.name.toLowerCase().includes(this.asset_name_filter.toLowerCase()) )
console.log(this.assets_filtered)
}
}`}
@keydown.escape.prevent.stop="close()"
Expand Down
2 changes: 0 additions & 2 deletions frontend/app/src/components/blocks/StructureTimerList.astro
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ const {
create_fleet = false,
} = Astro.props
console.log(create_fleet)
import BlockList from '@components/compositions/BlockList.astro';
import StructureTimerListItem from '@components/blocks/StructureTimerListItem.astro';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ const {
...attributes
} = Astro.props
console.log(create_fleet)
import { get_item_icon, get_alliance_logo } from '@helpers/eve_image_server'
import Flexblock from '@components/compositions/Flexblock.astro';
Expand Down
4 changes: 1 addition & 3 deletions frontend/app/src/components/partials/FooterScripts.astro
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,8 @@
document.querySelector('.loader').classList.remove('active')
htmx.process(document.body)

if (ccpwgl_context) {
console.log('Removing context')
if (ccpwgl_context)
ccpwgl_context = null
}
})
</script>

Expand Down
2 changes: 0 additions & 2 deletions frontend/app/src/components/partials/HomepageRenders.astro
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export const WatermelonXData = `init_ccpwgl() {
scene.loadSun('res:/fisfx/lensflare/pink_hazy.red', function () {
scene.wrappedScene.lensflares.forEach(lensflare=> {
console.log(lensflare)
lensflare._transform = mat4.fromValues(
100, 0, 0, 0,
0, 100, 0, 0,
Expand Down Expand Up @@ -388,7 +387,6 @@ export const OurzadCameraXData = `
resize_canvas: null,
rotation_angle: 0,
resizeCanvasToDisplaySize(canvas, ccpwgl_context) {
console.log('recalculate')
// Lookup the size the browser is displaying the canvas in CSS pixels.
const displayWidth = canvas.clientWidth;
const displayHeight = canvas.clientHeight;
Expand Down
1 change: 0 additions & 1 deletion frontend/app/src/helpers/fit_parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ export async function parse_eft(fitting_eft: string) {
}
}

console.log('Done parsing eft')
return ship_fitting
}

Expand Down
1 change: 1 addition & 0 deletions frontend/app/src/i18n/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -941,5 +941,6 @@ export const ui = {
'edit': 'Edit',
'status': 'Status',
'default': 'Default',
'no_recent_fleets': 'No recent fleets using this doctrine.',
},
} as const;
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ const page_title = t('corporations.applications.page_title')
character_name: '',
corporation_filter: '-1',
filter() {
console.log(this.character_name)
if (this.character_name === '' && this.corporation_filter === '-1') {
this.corporations_filtered = this.corporations_unfiltered
this.corporations_filtered_applicationss_count = ${JSON.stringify(corporations_applications_count)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ const page_title = t('corporations.applications.records.page_title')
character_name: '',
corporation_filter: '-1',
filter() {
console.log(this.character_name)
if (this.character_name === '' && this.corporation_filter === '-1') {
this.corporations_filtered = this.corporations_unfiltered
this.corporations_filtered_applicationss_count = ${JSON.stringify(corporations_applications_count)}
Expand Down
1 change: 0 additions & 1 deletion frontend/app/src/pages/alliance/corporations/members.astro
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ const page_title = t('corporations.members.page_title')
character_name: '',
corporation_filter: '-1',
filter() {
console.log(this.character_name)
if (this.character_name === '' && this.corporation_filter === '-1') {
this.corporations_filtered = this.corporations_unfiltered
this.corporations_filtered_memberss_count = ${JSON.stringify(corporations_members_count)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ const page_title = t('corporations.members.mains.page_title')
character_name: '',
main_filter: '-1',
filter() {
console.log(this.character_name)
if (this.character_name === '') {
this.mains_filtered = this.mains_unfiltered
this.mains_filtered_alts_count = ${JSON.stringify(mains_alts_count)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ const page_title = t('corporations.members.unregistered.page_title')
character_name: '',
corporation_filter: '-1',
filter() {
console.log(this.character_name)
if (this.character_name === '' && this.corporation_filter === '-1') {
this.corporations_filtered = this.corporations_unfiltered
this.corporations_filtered_memberss_count = ${JSON.stringify(corporations_members_count)}
Expand Down
1 change: 0 additions & 1 deletion frontend/app/src/pages/market/freight/contract.astro
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ try {
const route_id = freight_routes_data.route_translation[route]
const route_cost = await get_route_cost(route_id, contract_size, collateral)
console.log(route_cost)
cost = route_cost.cost
origin = freight_routes_data.stations[route][0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ if (Astro.request.method === "POST") {
throw new Error(t('invalid_description'));
application = await create_corporation_application(auth_token, corporation.corporation_id, description)
console.log(application)
corporation.status = application.status as CorporationStatusType
console.log(corporation.status)
} catch (error) {
create_corporation_application_error = prod_error_messages() ? t('create_corporation_application_error') : error.message
}
Expand Down
2 changes: 0 additions & 2 deletions frontend/app/src/pages/partials/group_item_component.astro
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ if (delete_member_error) {
content: delete_member_error,
}
console.log(alert)
if (group) {
const params = query_string({
name: group.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ try {
get_groups_members_error = prod_error_messages() ? t('get_groups_members_error') : error.message
}
console.log(groups_members)
const GROUPS_MEMBERS_PARTIAL_URL = translatePath('/partials/groups_members_component')
const delay = parseInt(Astro.url.searchParams.get('delay') ?? '0')
Expand Down
6 changes: 3 additions & 3 deletions frontend/app/src/pages/ships/doctrines/list.astro
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { marked } from 'marked';
import Viewport from '@layouts/Viewport.astro';
import PageWide from '@components/page/PageWide.astro';
import PageDefault from '@components/page/PageDefault.astro';
import PageTitle from '@components/page/PageTitle.astro';
import TextBox from '@components/layout/TextBox.astro';
Expand All @@ -44,7 +44,7 @@ const page_title = t('doctrines.page_title');
title={page_title}
meta_description={t('doctrines.alliance.meta_description')}
>
<PageWide
<PageDefault
cover={{
image: "/images/doctrines-cover.jpg",
image_990: "/images/doctrines-cover-990.jpg",
Expand Down Expand Up @@ -105,5 +105,5 @@ const page_title = t('doctrines.page_title');
</Flexblock>
}
</Flexblock>
</PageWide>
</PageDefault>
</Viewport>
10 changes: 6 additions & 4 deletions frontend/app/src/pages/ships/doctrines/list/[doctrine_id].astro
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ import { fetch_fleets_auth, fetch_fleets } from '@helpers/fetching/fleets'
let doctrine:DoctrineType
let fetch_doctrine_error:string | false = false
let recently_fleets:FleetItem[] = []
let recently_fleets:FleetItem[] = null
try {
doctrine = await fetch_doctrine_by_id(parseInt(doctrine_id))
recently_fleets = auth_token ? await fetch_fleets_auth(auth_token as string, false) : await fetch_fleets(false)
recently_fleets = recently_fleets.filter((fleet) => fleet.doctrine_id === parseInt(doctrine_id))
if (auth_token) {
recently_fleets = auth_token ? await fetch_fleets_auth(auth_token as string, false) : null
recently_fleets = recently_fleets.filter((fleet) => fleet.doctrine_id === parseInt(doctrine_id))
}
} catch (error) {
fetch_doctrine_error = prod_error_messages() ? t('fetch_doctrine_error') : error.message
}
Expand Down Expand Up @@ -53,7 +55,7 @@ const page_title = `${doctrine?.name} ${t('doctrine')}`;
}}
x-data={`{
ideal_fleet_size: ${doctrine?.ideal_composition?.ideal_fleet_size ?? 0},
recently_fleets_count: ${recently_fleets.length},
recently_fleets_count: ${recently_fleets?.length},
}`}
>
<FlexInline slot="header" justification='space-between' class="[ w-full ]">
Expand Down

0 comments on commit 9cd5dcf

Please sign in to comment.