Skip to content

Commit

Permalink
Merge branch 'release/2021-09'
Browse files Browse the repository at this point in the history
  • Loading branch information
blaskodaniel committed Sep 30, 2021
2 parents 40e739c + 1d1ed4e commit f13669b
Show file tree
Hide file tree
Showing 46 changed files with 1,816 additions and 1,826 deletions.
8 changes: 4 additions & 4 deletions apps/sensenet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@app/sensenet",
"version": "1.23.0",
"version": "1.24.0",
"main": "dist/index.js",
"files": [
"dist",
Expand Down Expand Up @@ -87,7 +87,7 @@
"@sensenet/authentication-oidc-react": "^2.3.1",
"@sensenet/client-core": "^4.0.1",
"@sensenet/client-utils": "^2.1.2",
"@sensenet/controls-react": "^8.0.2",
"@sensenet/controls-react": "^8.0.3",
"@sensenet/default-content-types": "^5.0.0",
"@sensenet/document-viewer-react": "^4.2.1",
"@sensenet/hooks-react": "^1.6.2",
Expand All @@ -98,12 +98,12 @@
"autosuggest-highlight": "^3.1.1",
"clsx": "^1.1.1",
"date-fns": "^2.23.0",
"filesize": "^7.0.0",
"filesize": "^8.0.0",
"react": "^16.13.0",
"react-autosuggest": "^10.1.0",
"react-day-picker": "^7.4.10",
"react-dom": "^16.13.0",
"react-markdown": "^6.0.3",
"react-markdown": "6.0.3",
"react-monaco-editor": "0.44.0",
"react-responsive": "^8.2.0",
"react-virtualized": "^9.22.3",
Expand Down
13 changes: 8 additions & 5 deletions apps/sensenet/src/components/app-providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
ResponsiveContextProvider,
ThemeProvider,
} from '../context'
import { ShareProvider } from '../context/ShareProvider'
import {
CommandProviderManager,
CustomActionCommandProvider,
Expand Down Expand Up @@ -40,11 +41,13 @@ export default function AppProviders({ children }: AppProvidersProps) {
<BrowserRouter>
<ThemeProvider>
<RepositoryProvider>
<CurrentUserProvider>
<ResponsiveContextProvider>
<DialogProvider>{children}</DialogProvider>
</ResponsiveContextProvider>
</CurrentUserProvider>
<ShareProvider>
<CurrentUserProvider>
<ResponsiveContextProvider>
<DialogProvider>{children}</DialogProvider>
</ResponsiveContextProvider>
</CurrentUserProvider>
</ShareProvider>
</RepositoryProvider>
</ThemeProvider>
</BrowserRouter>
Expand Down
8 changes: 6 additions & 2 deletions apps/sensenet/src/components/dashboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,13 @@ const Dashboard = () => {
{localization.descriptionSecondLine}
</div>
<LearnMoreWidget />
<SubscriptionWidget subscription={data.subscription} version={data.version} isAdmin={isAdmin} />
{data.subscription && (
<SubscriptionWidget subscription={data.subscription} version={data.version} isAdmin={isAdmin} />
)}
{data?.usage?.user === 1 && <YourProjectWidget />}
<UsageWidget limitations={data.subscription.plan.limitations} used={data.usage} />
{data.subscription?.plan?.limitations && (
<UsageWidget limitations={data.subscription?.plan?.limitations} used={data.usage} />
)}
</Container>
</div>
)
Expand Down
4 changes: 2 additions & 2 deletions apps/sensenet/src/components/drawer/PermanentDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const PermanentDrawer = () => {
const localization = useLocalization().drawer
const location = useLocation()

const settingsItem = items.find((item) => item.primaryText === 'Settings')
const settingsItem = items.find((item) => item.itemType === 'Settings')

if (!settings.drawer.enabled) {
return null
Expand Down Expand Up @@ -114,7 +114,7 @@ export const PermanentDrawer = () => {
<AddButton aria-label={localization.add} isOpened={opened} />
) : null}
{items.map((item, index) => {
return item.primaryText !== 'Settings' && <PermanentDrawerItem item={item} opened={opened} key={index} />
return item.itemType !== 'Settings' && <PermanentDrawerItem item={item} opened={opened} key={index} />
})}
</li>
<li>{settingsItem && <PermanentDrawerItem item={settingsItem} opened={opened} />}</li>
Expand Down
4 changes: 2 additions & 2 deletions apps/sensenet/src/components/login/login-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ export default function LoginPage({ handleSubmit, isLoginInProgress }: LoginPage
</Typography>
</Grid>
<Grid container direction="column" justify="center" alignItems="center" style={{ flexBasis: 150 }}>
<Grid item alignContent="center" alignItems="center">
<Grid item>
<Typography align="center" variant="subtitle1" component="p">
{localization.demoTitle}
</Typography>
</Grid>
<Grid item alignContent="center" alignItems="center">
<Grid item>
<Button
onClick={handleDemoSubmit}
size="medium"
Expand Down
4 changes: 2 additions & 2 deletions apps/sensenet/src/components/settings/api-keys-secrets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ export const ApiSecretsWidget: React.FunctionComponent = () => {
method: 'GET',
})

setExternalClients(response.clients.filter((client) => client.type === ApiKeyType.ExternalClient))
setExternalSpas(response.clients.filter((client) => client.type === ApiKeyType.ExternalSpa))
setExternalClients(response.clients.filter((client: any) => client.type === ApiKeyType.ExternalClient))
setExternalSpas(response.clients.filter((client: any) => client.type === ApiKeyType.ExternalSpa))
})()
}, [repo])

Expand Down
14 changes: 9 additions & 5 deletions apps/sensenet/src/components/settings/stats-storage-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,15 @@ export const StorageWidget: React.FunctionComponent<StorageWidgetProps> = (props
const numberFormatter = new Intl.NumberFormat('en-US')

const allUsage =
props.data.usage.storage.files +
props.data.usage.storage.content +
props.data.usage.storage.oldVersions +
props.data.usage.storage.log +
props.data.usage.storage.system
props.data?.usage?.storage.files +
props.data?.usage?.storage.content +
props.data?.usage?.storage.oldVersions +
props.data?.usage?.storage.log +
props.data?.usage?.storage.system

if (!allUsage) {
return null
}

return (
<div className={widgetClasses.root}>
Expand Down
54 changes: 34 additions & 20 deletions apps/sensenet/src/components/settings/stats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,45 +16,59 @@ export const Stats: React.FunctionComponent = () => {
const repository = useRepository()
const [versionInfo, setVersionInfo] = useState<VersionInfo>()
const [dashboardData, setDashboardData] = useState<DashboardData>()
const [versionInfoError, setVersionInfoError] = useState<boolean>(false)
const [dashboardDataError, setDashboardDataError] = useState<boolean>(false)

useEffect(() => {
;(async () => {
const response = await repository.executeAction<any, VersionInfo>({
idOrPath: '/Root',
name: 'GetVersionInfo',
method: 'GET',
})
try {
const response = await repository.executeAction<any, VersionInfo>({
idOrPath: '/Root',
name: 'GetVersionInfo',
method: 'GET',
})

setVersionInfo(response)
setVersionInfo(response)
} catch {
setVersionInfoError(true)
}
})()
}, [repository])

useEffect(() => {
;(async () => {
const response = await repository.executeAction<any, DashboardData>({
idOrPath: '/Root',
name: 'GetDashboardData',
method: 'GET',
oDataOptions: {
select: ['Plan'],
},
})

setDashboardData(response)
try {
const response = await repository.executeAction<any, DashboardData>({
idOrPath: '/Root',
name: 'GetDashboardData',
method: 'GET',
oDataOptions: {
select: ['Plan'],
},
})

setDashboardData(response)
} catch {
setDashboardDataError(true)
}
})()
}, [repository])

if (!versionInfo || !dashboardData) return <FullScreenLoader />
if ((!versionInfo && !versionInfoError) || (!dashboardData && !dashboardDataError)) return <FullScreenLoader />

return (
<div style={{ overflow: 'auto' }}>
<div className={clsx(globalClasses.contentTitle, globalClasses.centeredVertical)} style={{ display: 'grid' }}>
<span style={{ fontSize: '20px' }}>{localization.settings.stats}</span>
</div>
<Container fixed>
<StorageWidget data={dashboardData} />
<ComponentsWidget data={versionInfo} />
<InstalledPackagesWidget data={versionInfo} />
{dashboardData && !dashboardDataError && <StorageWidget data={dashboardData} />}
{versionInfo && !versionInfoError && (
<>
<ComponentsWidget data={versionInfo} />
<InstalledPackagesWidget data={versionInfo} />
</>
)}
</Container>
</div>
)
Expand Down
Loading

0 comments on commit f13669b

Please sign in to comment.