Skip to content

Commit

Permalink
fix: type related issues
Browse files Browse the repository at this point in the history
  • Loading branch information
samshara committed Mar 27, 2024
1 parent 4ea29d1 commit 2c77858
Show file tree
Hide file tree
Showing 5 changed files with 415 additions and 2,150 deletions.
27 changes: 13 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,24 +71,23 @@ jobs:

- name: Css Lint
run: yarn lint:css
# typecheck:
# name: Typecheck
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# with:
# node-version: 20
# cache: 'yarn'
typecheck:
name: Typecheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'

# - name: Install dependencies
# run: yarn install
- name: Install dependencies
run: yarn install

# - name: Typecheck
# run: yarn typecheck
- name: Typecheck
run: yarn typecheck
build:
name: Build
# needs: [lint, css-lint, typecheck, test]
needs: [lint, css-lint, typecheck, test]
runs-on: ubuntu-latest
steps:
Expand Down
3 changes: 2 additions & 1 deletion env.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { defineConfig, Schema } from '@julr/vite-plugin-validate-env';

// TODO: Integrate .env for CI and remove optional() call on required fields
export default defineConfig({
APP_TITLE: Schema.string.optional(),
APP_MAPBOX_ACCESS_TOKEN: Schema.string(),
APP_MAPBOX_ACCESS_TOKEN: Schema.string.optional(),
})
3 changes: 2 additions & 1 deletion src/components/Page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ import useCurrentLanguage from '#hooks/domain/useCurrentLanguage';
import i18n from './i18n.json';
import styles from './styles.module.css';

type TranslationModuleOriginalLanguageEnum = components<'read'>['schemas']['TranslationModuleOriginalLanguageEnum'];
// TODO use enum field from alert hub api
type TranslationModuleOriginalLanguageEnum = 'en' | 'es' | 'ar' | 'fr';

interface Props {
className?: string;
Expand Down
18 changes: 1 addition & 17 deletions src/utils/map.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import getBbox from '@turf/bbox';
import type {
FillLayer,
Map,
Expand All @@ -11,6 +10,7 @@ import {
COLOR_LIGHT_GREY,
} from '#utils/constants';

// TODO: Verify if we are using the ifrc go mapbox api and styles
export const defaultMapStyle = 'mapbox://styles/go-ifrc/ckrfe16ru4c8718phmckdfjh0';
type NavControlOptions = NonNullable<ConstructorParameters<typeof NavigationControl>[0]>;
export const defaultNavControlOptions: NavControlOptions = {
Expand Down Expand Up @@ -160,19 +160,3 @@ export const adminFillLayerOptions: Omit<FillLayer, 'id'> = {
],
},
};

export function getCountryListBoundingBox(countryList: Country[]) {
if (countryList.length < 1) {
return undefined;
}

const collection = {
type: 'FeatureCollection' as const,
features: countryList.map((country) => ({
type: 'Feature' as const,
geometry: country.bbox,
})),
};

return getBbox(collection);
}
Loading

0 comments on commit 2c77858

Please sign in to comment.