Skip to content

Commit

Permalink
Merge pull request #899 from terrestris/external-links-in-admin
Browse files Browse the repository at this point in the history
fix: moves extenal links from the landing page to  admin
  • Loading branch information
AmandaTamanda authored Nov 28, 2024
2 parents 5eac391 + 64ceba2 commit 289792c
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 7 deletions.
6 changes: 6 additions & 0 deletions assets/fallbackConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ var shogunApplicationConfig = {
},
logs: {
visible: true
},
graphiql: {
visible: true
},
swagger: {
visible: true
}
}
}
Expand Down
30 changes: 29 additions & 1 deletion src/Component/Menu/Navigation/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import {
TeamOutlined,
FileTextOutlined,
TagOutlined,
ApiOutlined
ApiOutlined,
BranchesOutlined
} from '@ant-design/icons';

import {
Expand Down Expand Up @@ -222,6 +223,33 @@ export const Navigation: React.FC<NavigationProps> = ({
});
}

if (navigationConf?.settings?.graphiql?.visible) {
settingsChildren.push({
key: 'graphiql',
icon: <BranchesOutlined />,
label: (
<>
<a href={`${window.location.origin}/graphiql?path=/graphql`} target='_blank' rel='noopener noreferrer'>
<span>{t('Navigation.graphiql')}</span>
</a>
</>
)
});
}
if (navigationConf?.settings?.swagger?.visible) {
settingsChildren.push({
key: 'swagger',
icon: <ApiOutlined />,
label: (
<>
<a href={`${window.location.origin}/swagger-ui/index.html`} target='_blank' rel='noopener noreferrer'>
<span>{t('Navigation.swagger')}</span>
</a>
</>
)
});
}

const items: ItemType[] = [];
if (navigationContentChildren.length > 0) {
items.push({
Expand Down
6 changes: 4 additions & 2 deletions src/Page/Portal/Portal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ import {
message
} from 'antd';
import _isEqual from 'lodash/isEqual';
import {Route,
Routes} from 'react-router-dom';
import {
Route,
Routes
} from 'react-router-dom';
import {
useSetRecoilState
} from 'recoil';
Expand Down
22 changes: 20 additions & 2 deletions src/custom.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,29 @@ declare module 'shogunApplicationConfig' {
visible: boolean;
};
/**
* Configuration for the settings->global menu entry.
* Configuration for the settings->logs menu entry.
*/
logs: {
/**
* Should the menu include the settings->global menu entry.
* Should the menu include the settings->logs menu entry.
*/
visible: boolean;
};
/**
* Configuration for the settings->graphQL menu entry.
*/
graphiql: {
/**
* Should the menu include the settings->graphQL menu entry.
*/
visible: boolean;
};
/**
* Configuration for the settings->swagger menu entry.
*/
swagger: {
/**
* Should the menu include the settings->swagger menu entry.
*/
visible: boolean;
};
Expand Down
8 changes: 6 additions & 2 deletions src/i18n/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ export default {
logLevels: 'Logging-Level',
configuration: 'Einstellungen',
global: 'Global',
image: 'Bilddateien'
image: 'Bilddateien',
graphiql: 'GraphiQL',
swagger: 'Swagger'
},
GeneralEntityRoot: {
save: '{{entity}} speichern',
Expand Down Expand Up @@ -318,7 +320,9 @@ export default {
logLevels: 'Logging levels',
configuration: 'Configuration',
global: 'Global',
image: 'Images'
image: 'Images',
graphiql: 'GraphiQL',
swagger: 'Swagger'
},
GeneralEntityRoot: {
save: 'Save {{entity}}',
Expand Down

0 comments on commit 289792c

Please sign in to comment.