Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
majkshkurti committed Oct 2, 2024
1 parent 9c65500 commit c560c14
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 3 additions & 1 deletion apps/web/hooks/auth/AuthZ.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { useMemo } from "react";

import { useOrganization, useUserProfile } from "@/lib/api/users";
import { FeatureName, featureToPlanMap, organizationRoles } from "@/lib/validations/organization";
import type { FeatureName } from "@/lib/validations/organization";
import { featureToPlanMap, organizationRoles } from "@/lib/validations/organization";
import { type Team, teamRoles } from "@/lib/validations/team";

interface Options {
Expand Down Expand Up @@ -40,6 +41,7 @@ export function useAuthZ(options: Options = {}) {
const isAppFeatureEnabled = (feature: FeatureName) => {
const organizationPlan = organization?.plan_name;
const plansEnabled = featureToPlanMap[feature];
// eslint-disable-next-line @typescript-eslint/no-explicit-any
if (organizationPlan && plansEnabled && plansEnabled.includes(organizationPlan as any)) {
return true;
}
Expand Down
7 changes: 3 additions & 4 deletions apps/web/lib/transformers/layer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { MapGeoJSONFeature } from "react-map-gl/maplibre";

import { MARKER_IMAGE_PREFIX } from "@/lib/transformers/map-image";
import { rgbToHex } from "@/lib/utils/helpers";
import type { FeatureLayerLineProperties, FeatureLayerPointProperties, Layer } from "@/lib/validations/layer";
import type { ProjectLayer } from "@/lib/validations/project";
Expand Down Expand Up @@ -130,7 +129,7 @@ export function getMapboxStyleMarker(data: ProjectLayer | Layer) {
const markerMaps = properties.marker_mapping;
const fieldName = properties.marker_field?.name;
const fieldType = properties.marker_field?.type;
const marker = `${MARKER_IMAGE_PREFIX}${properties.marker?.name}`;
const marker = `${data.id}-${properties.marker?.name}`;
if (markerMaps && fieldName) {
const valuesAndIcons = [] as (string | number)[];
markerMaps.forEach((markerMap) => {
Expand All @@ -144,15 +143,15 @@ export function getMapboxStyleMarker(data: ProjectLayer | Layer) {
} else {
valuesAndIcons.push(value);
}
valuesAndIcons.push(`${MARKER_IMAGE_PREFIX}${markerMapIcon.name}`);
valuesAndIcons.push(`${data.id}-${markerMapIcon.name}`);
});
} else {
if (fieldType === "number" && markerMapValue !== null) {
valuesAndIcons.push(Number(markerMapValue));
} else {
valuesAndIcons.push(markerMapValue);
}
valuesAndIcons.push(`${MARKER_IMAGE_PREFIX}${markerMapIcon.name}`);
valuesAndIcons.push(`${data.id}-${markerMapIcon.name}`);
}
});

Expand Down

0 comments on commit c560c14

Please sign in to comment.