Skip to content

Commit

Permalink
fix ruler sorting and add track resolution message (#2854)
Browse files Browse the repository at this point in the history
  • Loading branch information
satellitestudiodesign authored Oct 1, 2024
2 parents 539fa8d + 3a3f12f commit 725bc62
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 14 deletions.
25 changes: 18 additions & 7 deletions apps/fishing-map/features/workspace/vessels/VesselsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ import { WORKSPACE_SEARCH } from 'routes/routes'
import { DEFAULT_WORKSPACE_CATEGORY, DEFAULT_WORKSPACE_ID } from 'data/workspaces'
import { selectWorkspace } from 'features/workspace/workspace.selectors'
import { useDataviewInstancesConnect } from 'features/workspace/workspace.hook'
import { selectVesselsDataviews } from 'features/dataviews/selectors/dataviews.instances.selectors'
import {
selectActiveVesselsDataviews,
selectVesselsDataviews,
} from 'features/dataviews/selectors/dataviews.instances.selectors'
import { selectIsGuestUser } from 'features/user/selectors/user.selectors'
import {
hasTracksWithNoData,
Expand All @@ -39,6 +42,7 @@ function VesselsSection(): React.ReactElement {
const { t } = useTranslation()
const { dispatchLocation } = useLocationConnect()
const dataviews = useSelector(selectVesselsDataviews)
const activeDataviews = useSelector(selectActiveVesselsDataviews)
const workspace = useSelector(selectWorkspace)
const guestUser = useSelector(selectIsGuestUser)
const { upsertDataviewInstance, deleteDataviewInstance } = useDataviewInstancesConnect()
Expand Down Expand Up @@ -173,13 +177,20 @@ function VesselsSection(): React.ReactElement {
</div>
)}
</SortableContext>
{hasVesselsWithNoTrack && guestUser && (
{activeDataviews.length > 0 && guestUser && (
<p className={styles.disclaimer}>
<Trans i18nKey="vessel.trackLogin">
One of your selected sources requires you to
<LocalStorageLoginLink className={styles.link}>login</LocalStorageLoginLink> to see
vessel tracks and events
</Trans>
{hasVesselsWithNoTrack ? (
<Trans i18nKey="vessel.trackLogin">
One of your selected sources requires you to
<LocalStorageLoginLink className={styles.link}>login</LocalStorageLoginLink> to see
vessel tracks and events
</Trans>
) : (
<Trans i18nKey="vessel.trackResolution">
<LocalStorageLoginLink className={styles.link}>Login</LocalStorageLoginLink> to see
more detailed vessel tracks (free, 2 minutes)
</Trans>
)}
</p>
)}
<VesselEventsLegend dataviews={dataviews} />
Expand Down
2 changes: 1 addition & 1 deletion apps/fishing-map/next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
2 changes: 2 additions & 0 deletions apps/fishing-map/public/locales/en/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,8 @@
"saved": "The current workspace has been saved and it's available in your profile.",
"saveLogin": "Register and log in to save workspaces (free, 2 minutes)",
"saveOwnerOnly": "This workspace can only be edited by its creator",
"sharePrivateDisclaimer": "This workspace contains datasets that require special permissions",
"sharePrivatePermissionsRequired": "permissions required",
"siteDescription": {
"default": "The Global Fishing Watch map is the first open-access platform for visualization and analysis of marine traffic and vessel-based human activity at sea.",
"fishing-activity": "The Global Fishing Watch map is the first open-access platform for visualization and analysis of marine traffic and vessel-based human activity at sea.",
Expand Down
2 changes: 2 additions & 0 deletions apps/fishing-map/public/locales/es/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,8 @@
"saved": "La vista actual ha sido guardada y está disponible en tu perfil de usuario",
"saveLogin": "Necesita iniciar sesión para guardar la vista actual (gratis y toma 2 minutos)",
"saveOwnerOnly": "Esta área de trabajo solo puede ser editada por su creador",
"sharePrivateDisclaimer": "This workspace contains datasets that require special permissions",
"sharePrivatePermissionsRequired": "permissions required",
"siteDescription": {
"default": "El mapa Global Fishing Watch es la primera plataforma de acceso abierto para la visualización y el análisis del tráfico marítimo y de la actividad humana basada en el comercio marítimo.",
"fishing-activity": "El mapa Global Fishing Watch es la primera plataforma de acceso abierto para la visualización y el análisis del tráfico marítimo y de la actividad humana basada en el comercio marítimo.",
Expand Down
2 changes: 2 additions & 0 deletions apps/fishing-map/public/locales/fr/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,8 @@
"saved": "La vue actuelle a été enregistrée et est disponible dans votre profil",
"saveLogin": "Vous devez vous connecter pour enregistrer les vues (gratuit, 2 minutes)",
"saveOwnerOnly": "Cet espace de travail ne peut être modifié que par l'utilisateur qui l'a créé",
"sharePrivateDisclaimer": "This workspace contains datasets that require special permissions",
"sharePrivatePermissionsRequired": "permissions required",
"siteDescription": {
"default": "La carte Global Fishing Watch est la première plate-forme libre d'accès pour la visualisation et l'analyse du trafic maritime et de l'activité humaine en mer.",
"fishing-activity": "La carte Global Fishing Watch est la première plateforme libre d'accès pour la visualisation et l'analyse du trafic maritime et de l'activité humaine en mer.",
Expand Down
2 changes: 2 additions & 0 deletions apps/fishing-map/public/locales/id/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,8 @@
"saved": "Tampilan saat ini telah disimpan dan tersedia di profil Anda",
"saveLogin": "Anda harus masuk untuk menyimpan tampilan (gratis, 2 menit)",
"saveOwnerOnly": "This workspace can only be edited by its creator",
"sharePrivateDisclaimer": "This workspace contains datasets that require special permissions",
"sharePrivatePermissionsRequired": "permissions required",
"siteDescription": {
"default": "Peta Global Fishing Watch adalah platform akses terbuka pertama untuk visualisasi dan analisis lalu lintas laut dan aktivitas manusia berbasis kapal di laut.",
"fishing-activity": "Peta Global Fishing Watch adalah platform akses terbuka pertama untuk visualisasi dan analisis lalu lintas laut dan aktivitas manusia berbasis kapal di laut.",
Expand Down
2 changes: 2 additions & 0 deletions apps/fishing-map/public/locales/pt/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,8 @@
"saved": "A visualização atual foi salva e está disponível no seu perfil de usuário",
"saveLogin": "Você precisa fazer login para salvar as visualizações",
"saveOwnerOnly": "This workspace can only be edited by its creator",
"sharePrivateDisclaimer": "This workspace contains datasets that require special permissions",
"sharePrivatePermissionsRequired": "permissions required",
"siteDescription": {
"default": "O mapa do Global Fishing Watch é a primeira plataforma de acesso aberto para visualização e análise do tráfego marítimo e da atividade humana no mar.",
"fishing-activity": "O mapa do Global Fishing Watch é a primeira plataforma de acesso aberto para visualização e análise do tráfego marítimo e da atividade humana no mar.",
Expand Down
1 change: 1 addition & 0 deletions apps/fishing-map/public/locales/source/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@
"trackAction": "Download vessel track",
"trackLimitExceeded": "You have already downloaded {{limit}} tracks today, please try again tomorrow",
"trackLogin": "Register and login to download vessel tracks (free, 2 minutes)",
"trackResolution": "Login to see more detailed vessel tracks (free, 2 minutes)",
"trackNotAllowed": "You don't have permissions to download tracks from this source",
"trackRemaining_one": "You can download {{count}} more track today",
"trackRemaining_other": "You can download {{count}} more tracks today",
Expand Down
2 changes: 2 additions & 0 deletions apps/fishing-map/public/locales/val/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,8 @@
"saved": "crwdns60733:0crwdne60733:0",
"saveLogin": "crwdns60735:0crwdne60735:0",
"saveOwnerOnly": "crwdns83254:0crwdne83254:0",
"sharePrivateDisclaimer": "crwdns83684:0crwdne83684:0",
"sharePrivatePermissionsRequired": "crwdns83686:0crwdne83686:0",
"siteDescription": {
"default": "crwdns60737:0crwdne60737:0",
"fishing-activity": "crwdns60739:0crwdne60739:0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ export class FourwingsClustersLayer extends CompositeLayer<
getPolygonOffset: (params: any) => getLayerGroupOffset(LayerGroup.Cluster, params),
stroked: true,
getLineColor: DEFAULT_LINE_COLOR,
lineWidthMinPixels: 1,
lineWidthMinPixels: 0.2,
pickable: true,
updateTriggers: {
getRadius: [radiusScale],
Expand All @@ -369,7 +369,7 @@ export class FourwingsClustersLayer extends CompositeLayer<
getPosition: this._getPosition,
getColor: DEFAULT_BACKGROUND_COLOR,
getSize: 12,
getPolygonOffset: (params: any) => getLayerGroupOffset(LayerGroup.Label, params),
getPolygonOffset: (params: any) => getLayerGroupOffset(LayerGroup.ClusterLabel, params),
sizeUnits: 'pixels',
getTextAnchor: 'middle',
getAlignmentBaseline: 'center',
Expand Down
4 changes: 3 additions & 1 deletion libs/deck-layers/src/utils/sort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export enum LayerGroup {
Cluster = 'cluster', // Cluster circles
Tool = 'tool', // Tools such as rulers, etc
Label = 'label', // All non-basemap layers labels
ClusterLabel = 'clusterLabel', // Cluster labels
Overlay = 'overlay', // Popups, ruler tool, etc
}

Expand All @@ -43,9 +44,10 @@ export const LAYER_GROUP_ORDER = [
LayerGroup.BasemapForeground,
LayerGroup.CustomLayer,
LayerGroup.OutlinePolygonsHighlighted,
LayerGroup.Label,
LayerGroup.Cluster,
LayerGroup.ClusterLabel,
LayerGroup.Tool,
LayerGroup.Label,
LayerGroup.Overlay,
]

Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -25474,16 +25474,16 @@ __metadata:
linkType: hard

"rollup@npm:^2.43.1":
version: 2.79.1
resolution: "rollup@npm:2.79.1"
version: 2.79.2
resolution: "rollup@npm:2.79.2"
dependencies:
fsevents: "npm:~2.3.2"
dependenciesMeta:
fsevents:
optional: true
bin:
rollup: dist/bin/rollup
checksum: 10/df087b701304432f30922bbee5f534ab189aa6938bd383b5686c03147e0d00cd1789ea10a462361326ce6b6ebe448ce272ad3f3cc40b82eeb3157df12f33663c
checksum: 10/095ba0a82811b1866a76d826987743278db0a87c45092656986bfff490326b66187d5f9ff0c24cf8d5682bc470aa00c36654e0044d6b6335ac0c1201b8280880
languageName: node
linkType: hard

Expand Down

0 comments on commit 725bc62

Please sign in to comment.