Skip to content

Commit

Permalink
feat(miniapp-utils): DOMA-10721 added collections helpers (#5518)
Browse files Browse the repository at this point in the history
* feat(miniapp-utils): DOMA-10721 added collections helpers

* refactor(global): DOMA-10721 replaced app utils to package one

* refactor(global): DOMA-10721 replaced app utils to package one
  • Loading branch information
SavelevMatthew authored Nov 20, 2024
1 parent ef107ba commit 55844fa
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React, { useCallback, useState } from 'react'
import { useIntl } from 'react-intl'

import { PlusCircle } from '@open-condo/icons'
import { nonNull } from '@open-condo/miniapp-utils/helpers/collections'
import { Button, Modal, Input, Alert, Typography } from '@open-condo/ui'

import { EmptyTableFiller } from '@/domains/common/components/EmptyTableFiller'
Expand All @@ -21,7 +22,6 @@ import {
import { useFileSizeFormatter } from '@/domains/miniapp/hooks/useFileSizeFormatter'
import { useFileValidator } from '@/domains/miniapp/hooks/useFileValidator'
import { useMutationCompletedHandler } from '@/domains/miniapp/hooks/useMutationCompletedHandler'
import { nonNull } from '@/domains/miniapp/utils/nonNull'
import { getCurrentPage } from '@/domains/miniapp/utils/query'
import { INVALID_MIMETYPE } from '@dev-api/domains/common/constants/errors'
import { B2C_APP_BUILD_UNIQUE_VERSION_CONSTRAINT } from '@dev-api/domains/miniapp/constants/constraints'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import React, { useCallback, useEffect, useState } from 'react'
import { useIntl } from 'react-intl'

import { PlusCircle, Trash } from '@open-condo/icons'
import { nonNull } from '@open-condo/miniapp-utils/helpers/collections'
import { Button } from '@open-condo/ui'


import { EmptyTableFiller } from '@/domains/common/components/EmptyTableFiller'
import { useMutationErrorHandler } from '@/domains/common/hooks/useMutationErrorHandler'
import { getClientSideSenderInfo } from '@/domains/common/utils/userid.utils'
import { DEFAULT_PAGE_SIZE } from '@/domains/miniapp/constants/common'
import { nonNull } from '@/domains/miniapp/utils/nonNull'
import { getCurrentPage } from '@/domains/miniapp/utils/query'

import { CreatePropertyModal } from './CreatePropertyModal'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import { Form } from 'antd'
import React, { useCallback, useState } from 'react'
import { useIntl } from 'react-intl'

import { nonNull } from '@open-condo/miniapp-utils/helpers/collections'
import { Checkbox, Select, Button } from '@open-condo/ui'
import type { CheckboxProps } from '@open-condo/ui'

import { useValidations } from '@/domains/common/hooks/useValidations'
import styles from '@/domains/miniapp/components/B2CApp/edit/publishing/PublishForm.module.css'
import { DEFAULT_PAGE_SIZE } from '@/domains/miniapp/constants/common'
import { nonNull } from '@/domains/miniapp/utils/nonNull'

import { useAllB2CAppBuildsLazyQuery } from '@/lib/gql'

Expand Down
1 change: 1 addition & 0 deletions apps/dev-portal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"@open-condo/cli": "workspace:^",
"@open-condo/config": "workspace:^",
"@open-condo/icons": "workspace:^",
"@open-condo/miniapp-utils": "workspace:^",
"@open-condo/next": "workspace:^",
"@open-condo/tsconfig": "workspace:^",
"@open-condo/ui": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion apps/resident-app
8 changes: 8 additions & 0 deletions packages/miniapp-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
"helpers/apollo": [
"dist/types/helpers/apollo.d.ts"
],
"helpers/collections": [
"dist/types/helpers/collections.d.ts"
],
"helpers/environment": [
"dist/types/helpers/environment.d.ts"
],
Expand All @@ -62,6 +65,11 @@
"require": "./dist/cjs/helpers/apollo.js",
"import": "./dist/esm/helpers/apollo.js"
},
"./helpers/collections": {
"types": "./dist/types/helpers/collections.d.ts",
"require": "./dist/cjs/helpers/collections.js",
"import": "./dist/esm/helpers/collections.js"
},
"./helpers/environment": {
"types": "./dist/types/helpers/environment.d.ts",
"require": "./dist/cjs/helpers/environment.js",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export function nonNull<TVal> (val: TVal): val is NonNullable<TVal> {
return val !== null && val !== undefined
}
}
2 changes: 2 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,7 @@ __metadata:
"@open-condo/cli": "workspace:^"
"@open-condo/config": "workspace:^"
"@open-condo/icons": "workspace:^"
"@open-condo/miniapp-utils": "workspace:^"
"@open-condo/next": "workspace:^"
"@open-condo/tsconfig": "workspace:^"
"@open-condo/ui": "workspace:^"
Expand Down Expand Up @@ -2003,6 +2004,7 @@ __metadata:
"@open-condo/config": "workspace:^"
"@open-condo/icons": "workspace:^"
"@open-condo/locales": "workspace:^"
"@open-condo/miniapp-utils": "workspace:^"
"@open-condo/tsconfig": "workspace:^"
"@open-condo/ui": "workspace:^"
"@parcel/watcher": ^2.3.0
Expand Down

0 comments on commit 55844fa

Please sign in to comment.