Skip to content

Commit

Permalink
feat(subscription details): implement loader for subscription (#959)
Browse files Browse the repository at this point in the history
  • Loading branch information
kunalgaurav-bmw authored Jul 23, 2024
1 parent df7a014 commit d6db4f1
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
### Feature

- Use scroll to top button from shared components
- Subscription Overlay
- implement loading state for provider subscription detail overlay

### Bugfixes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
StaticTable,
type TableType,
Typography,
CircleProgress,
} from '@catena-x/portal-shared-components'
import HelpOutlineIcon from '@mui/icons-material/HelpOutline'
import { useTranslation, Trans } from 'react-i18next'
Expand Down Expand Up @@ -171,8 +172,23 @@ const ActivateSubscriptionOverlay = ({
onCloseWithIcon={() => dispatch(closeOverlay())}
/>
<DialogContent>
<StaticTable data={tableData1} horizontal={false} />
<StaticTable data={tableData2} horizontal={false} />
{loading ? (
<div className="loading-progress">
<CircleProgress
size={40}
step={1}
interval={0.1}
colorVariant={'primary'}
variant={'indeterminate'}
thickness={8}
/>
</div>
) : (
<>
<StaticTable data={tableData1} horizontal={false} />
<StaticTable data={tableData2} horizontal={false} />
</>
)}
</DialogContent>
<DialogActions>
<Button variant="outlined" onClick={closeActivationOverlay}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
EditField,
type TableCellType,
Tooltips,
CircleProgress,
} from '@catena-x/portal-shared-components'
import {
ProcessStep,
Expand All @@ -44,6 +45,7 @@ import { SubscriptionStatus } from 'features/apps/types'
import UserService from 'services/UserService'
import { ROLES } from 'types/Constants'
import { useState } from 'react'
import './style.scss'
import { SuccessErrorType } from 'features/admin/appuserApiSlice'
import { isURL } from 'types/Patterns'
import { SubscriptionTypes } from 'components/shared/templates/Subscription'
Expand Down Expand Up @@ -78,7 +80,7 @@ const AppSubscriptionDetailOverlay = ({
const fetchAPI = isAppSubscription
? useFetchSubscriptionDetailQuery
: useFetchServiceSubDetailQuery
const { data, refetch } = fetchAPI({
const { data, refetch, isFetching } = fetchAPI({
appId,
subscriptionId,
})
Expand Down Expand Up @@ -348,12 +350,29 @@ const AppSubscriptionDetailOverlay = ({
numberOfSteps={3}
activePage={getActiveSteps()}
/>
<div style={{ marginTop: '30px' }}>
<StaticTable data={subscriptionDetails} />
</div>
<div style={{ marginTop: '20px' }}>
<VerticalTableNew data={technicalDetails} />
</div>
{isFetching ? (
<div className="app-subscription-overlay">
<div className="loading-progress">
<CircleProgress
size={40}
step={1}
interval={0.1}
colorVariant={'primary'}
variant={'indeterminate'}
thickness={8}
/>
</div>
</div>
) : (
<div>
<div style={{ marginTop: '30px' }}>
<StaticTable data={subscriptionDetails} />
</div>
<div style={{ marginTop: '20px' }}>
<VerticalTableNew data={technicalDetails} />
</div>
</div>
)}
<div style={{ marginTop: '20px' }}>
<Typography
variant="caption2"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/********************************************************************************
* Copyright (c) 2021, 2024 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

.app-subscription-overlay {
.loading-progress {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
}

0 comments on commit d6db4f1

Please sign in to comment.