@deix/rossini-core 0.6.2 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/lib/package.json +1 -1
  2. package/lib/src/components/buttons/Avatar/Avatar.d.ts +1 -1
  3. package/lib/src/components/buttons/Avatar/Avatar.d.ts.map +1 -1
  4. package/lib/src/components/buttons/Avatar/Avatar.js +9 -11
  5. package/lib/src/components/buttons/LanguageSelect/LanguageSelect.d.ts +2 -2
  6. package/lib/src/components/buttons/LanguageSelect/LanguageSelect.js +11 -11
  7. package/lib/src/components/display/StyledValue/ImprovementChip.d.ts +4 -3
  8. package/lib/src/components/display/StyledValue/ImprovementChip.d.ts.map +1 -1
  9. package/lib/src/components/display/StyledValue/ImprovementChip.js +41 -19
  10. package/lib/src/components/display/StyledValue/StyledValue.d.ts +2 -1
  11. package/lib/src/components/display/StyledValue/StyledValue.d.ts.map +1 -1
  12. package/lib/src/components/display/StyledValue/StyledValue.js +17 -8
  13. package/lib/src/components/display/StyledValue/translations.json +9 -0
  14. package/lib/src/components/layout/MinimalLayout/MinimalLayout.d.ts.map +1 -1
  15. package/lib/src/components/layout/MinimalLayout/MinimalLayout.js +3 -0
  16. package/lib/src/components/layout/StandardLayout/StandardLayout.d.ts.map +1 -1
  17. package/lib/src/components/layout/StandardLayout/StandardLayout.js +4 -1
  18. package/lib/src/components/layout/components/Sidebar/Sidebar.d.ts +3 -3
  19. package/lib/src/components/layout/components/Sidebar/Sidebar.js +40 -40
  20. package/lib/src/components/layout/components/Topbar/Topbar.d.ts +3 -3
  21. package/lib/src/components/layout/components/Topbar/Topbar.js +5 -5
  22. package/lib/src/utils/hooks/index.d.ts +2 -2
  23. package/lib/src/utils/hooks/index.js +2 -2
  24. package/lib/src/utils/hooks/{useKeycloak.d.ts → useUserInfo.d.ts} +2 -3
  25. package/lib/src/utils/hooks/useUserInfo.d.ts.map +1 -0
  26. package/lib/src/utils/hooks/useUserInfo.js +32 -0
  27. package/lib/tsconfig.tsbuildinfo +1 -1
  28. package/package.json +1 -1
  29. package/lib/src/utils/hooks/useKeycloak.d.ts.map +0 -1
  30. package/lib/src/utils/hooks/useKeycloak.js +0 -30
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUserInfo.d.ts","sourceRoot":"","sources":["../../../../src/utils/hooks/useUserInfo.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,QAAQ;IACvB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAqBD,eAAO,MAAM,WAAW,+DAKpB,CAAC"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.useUserInfo = void 0;
7
+ const axios_1 = __importDefault(require("axios"));
8
+ const react_query_1 = require("react-query");
9
+ const getUserInfo = async () => {
10
+ const fetch = axios_1.default
11
+ .get('/oauth2/userinfo')
12
+ .then((result) => {
13
+ console.log('User Info', result.data);
14
+ return result.data;
15
+ })
16
+ .catch((err) => {
17
+ console.error('Could not get user info');
18
+ console.error(err);
19
+ return {
20
+ email: '',
21
+ user: 'anonymous',
22
+ preferredUserName: 'anonymous',
23
+ };
24
+ });
25
+ return await fetch;
26
+ };
27
+ const useUserInfo = () => (0, react_query_1.useQuery)('user-info', () => getUserInfo(), {
28
+ keepPreviousData: true,
29
+ staleTime: Infinity,
30
+ cacheTime: Infinity,
31
+ });
32
+ exports.useUserInfo = useUserInfo;