Skip to content

Commit

Permalink
feat(app): ECB-56: temporarily set alertData to empty array so the al…
Browse files Browse the repository at this point in the history
…ert page section is not displayed - fix TS errors (#1445)

<!--- Please provide a general summary of your changes in the title
above -->

# Pull Request type

<!-- Please try to limit your pull request to one type; submit multiple
pull requests if needed. -->

Please check the type of change your PR introduces:

- [ ] Bugfix
- [x] Feature
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (no functional changes, no API changes)
- [ ] Build-related changes
- [ ] Documentation content changes
- [ ] Other (please describe):

## What is the current behavior?

<!-- Please describe the current behavior that you are modifying, or
link to a relevant issue. -->

Issue Number: N/A

## What is the new behavior?
this PR addresses some TS and lint errors from the previous PR of a
similar name

-
-
-

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this does introduce a breaking change, please describe the
impact and migration path for existing applications below. -->

## Other information

<!-- Any other information that is important to this PR, such as
screenshots of how the component looks before and after the change. -->
  • Loading branch information
trigal2012 authored Jan 12, 2025
2 parents afde012 + dac5a57 commit e00bc69
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
8 changes: 7 additions & 1 deletion apps/app/src/pages/org/[slug]/[orgLocationId]/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,13 @@ const OrgLocationPage: NextPage<InferGetServerSidePropsType<typeof getServerSide
const { data, status } = api.location.forLocationPageEdits.useQuery({ id: orgLocationId })
const { mutate: revalidatePage } = api.misc.revalidatePage.useMutation()

const { data: alertData } = { data: [] }
interface Alert {
key: string
icon: string
text: string
}

const { data: alertData }: { data: Alert[] } = { data: [] }

// for use with MultiSelectPopover

Expand Down
9 changes: 7 additions & 2 deletions apps/app/src/pages/org/[slug]/[orgLocationId]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,13 @@ const OrgLocationPage: NextPage = () => {
error: pageFetchError,
} = api.location.forLocationPage.useQuery({ id: orgLocationId }, { enabled: router.isReady })

const { data: alertData } = { data: [] }
const hasAlerts = useMemo(() => Array.isArray(alertData) && alertData.length > 0, [alertData])
interface Alert {
key: string
icon: string
text: string
}

const { data: alertData }: { data: Alert[] } = { data: [] }
const { classes } = useStyles()

const servicesRef = useRef<HTMLDivElement>(null)
Expand Down
10 changes: 9 additions & 1 deletion apps/app/src/pages/org/[slug]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,15 @@ const OrganizationPage = ({
select: (serviceInfoResult) => serviceInfoResult.length !== 0,
}
)
const { data: alertData } = { data: [] }

interface Alert {
key: string
icon: string
text: string
}

const { data: alertData }: { data: Alert[] } = { data: [] }

const hasAlerts = Array.isArray(alertData) && alertData.length > 0
const { ref, width } = useElementSize()
const { searchState } = useSearchState()
Expand Down

0 comments on commit e00bc69

Please sign in to comment.