Skip to content
Snippets Groups Projects
Commit 84133bcc authored by Arie Peterson's avatar Arie Peterson
Browse files

Only show version numbers to admins

parent f5343630
No related branches found
No related tags found
1 merge request!205Resolve "Do not show app versions to regular users"
# Changelog
## Unreleased
- Only show app version numbers in the dashboard tiles to admin users.
## 0.11.1
- Fix password reset form in case no email address is pre-filled.
......
......@@ -41,7 +41,7 @@ function App() {
) : (
<Layout>
<Routes>
<Route path="/dashboard" element={<Dashboard />} />
<Route path="/dashboard" element={<Dashboard isAdmin={isAdmin} />} />
<Route path="/users" element={<ProtectedRoute />}>
<Route index element={<Users />} />
</Route>
......
......@@ -15,7 +15,11 @@ import { AppStatusEnum } from 'src/services/apps/types';
import { DashboardCard, DashboardUtility, UpdateAlert, VersionInfo } from './components';
import { DASHBOARD_QUICK_ACCESS, HIDDEN_APPS, UTILITY_APPS } from './consts';
export const Dashboard: React.FC = () => {
type DashboardProps = {
isAdmin: boolean;
};
export const Dashboard = ({ isAdmin }: DashboardProps) => {
const host = window.location.hostname;
const splitedDomain = host.split('.');
splitedDomain.shift();
......@@ -67,7 +71,7 @@ export const Dashboard: React.FC = () => {
.filter((app) => app.status !== AppStatusEnum.NotInstalled)
// .filter((app) => !app.external)
.map((app) => {
const version = appVersions[app.slug as keyof typeof appVersions];
const version = isAdmin ? appVersions[app.slug as keyof typeof appVersions] : '';
return <DashboardCard app={app} key={app.name} version={version} />;
})}
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment