@zac-apps/commons 1.3.4 → 1.3.5-beta.2

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 (3) hide show
  1. package/README.md +1 -36
  2. package/dist/index.js +41 -22
  3. package/package.json +14 -12
package/README.md CHANGED
@@ -1,36 +1 @@
1
- This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
2
-
3
- ## Getting Started
4
-
5
- First, run the development server:
6
-
7
- ```bash
8
- npm run dev
9
- # or
10
- yarn dev
11
- # or
12
- pnpm dev
13
- # or
14
- bun dev
15
- ```
16
-
17
- Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
18
-
19
- You can start editing the page by modifying `app/page.js`. The page auto-updates as you edit the file.
20
-
21
- This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
22
-
23
- ## Learn More
24
-
25
- To learn more about Next.js, take a look at the following resources:
26
-
27
- - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28
- - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
29
-
30
- You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
31
-
32
- ## Deploy on Vercel
33
-
34
- The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
35
-
36
- Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
1
+ This package contains common components for the ZAC Apps
package/dist/index.js CHANGED
@@ -169,6 +169,8 @@ function AppTable(_ref) {
169
169
 
170
170
  function AppMenu(_ref) {
171
171
  var title = _ref.title,
172
+ iconUrl = _ref.iconUrl,
173
+ iconAlt = _ref.iconAlt,
172
174
  children = _ref.children;
173
175
  if (!title) {
174
176
  title = "JGU-ZAC Apps";
@@ -183,11 +185,11 @@ function AppMenu(_ref) {
183
185
  flexGrow: 1
184
186
  },
185
187
  children: title
186
- }), /*#__PURE__*/jsx("img", {
187
- src: "/zac_logo.png",
188
+ }), iconUrl ? /*#__PURE__*/jsx("img", {
189
+ src: iconUrl,
188
190
  width: "48px",
189
- alt: "zac-logo"
190
- })]
191
+ alt: iconAlt
192
+ }) : null]
191
193
  })
192
194
  });
193
195
  }
@@ -297,7 +299,9 @@ function AppWrapper(_ref) {
297
299
  footerContent = _ref.footerContent,
298
300
  children = _ref.children,
299
301
  basePath = _ref.basePath,
300
- menu = _ref.menu;
302
+ menu = _ref.menu,
303
+ iconUrl = _ref.iconUrl,
304
+ iconAlt = _ref.iconAlt;
301
305
  if (!basePath || basePath === null) {
302
306
  basePath = "/";
303
307
  }
@@ -307,13 +311,15 @@ function AppWrapper(_ref) {
307
311
  return /*#__PURE__*/jsxs(React__default.Fragment, {
308
312
  children: [/*#__PURE__*/jsx(AppMenu, {
309
313
  title: /*#__PURE__*/jsx(Link$1, {
314
+ component: Link$2,
315
+ href: basePath,
310
316
  sx: {
311
317
  color: AppTheme.palette.primary.contrastText
312
318
  },
313
- component: Link$2,
314
- href: basePath,
315
319
  children: title
316
320
  }),
321
+ iconUrl: iconUrl,
322
+ iconAlt: iconAlt,
317
323
  children: menu ? /*#__PURE__*/jsx(NextListMenu, {
318
324
  availApps: availApps,
319
325
  basePath: basePath,
@@ -446,21 +452,34 @@ function PublicFetch(_ref) {
446
452
  reload = false;
447
453
  }
448
454
  useEffect(function () {
449
- fetch(url, {
450
- headers: {
451
- "Content-Type": "application/json",
452
- Accept: "application/json"
453
- }
454
- }).then(function (response) {
455
- if (SetMetaData) {
456
- SetMetaData(response.headers);
457
- }
458
- console.log(response);
459
- return response.json();
460
- }).then(function (json) {
461
- console.log(json);
462
- SetState(json);
463
- });
455
+ try {
456
+ fetch(url, {
457
+ headers: {
458
+ "Content-Type": "application/json",
459
+ Accept: "application/json"
460
+ }
461
+ }).then(function (response) {
462
+ if (SetMetaData) {
463
+ SetMetaData(response.headers);
464
+ }
465
+ console.log(response);
466
+ if (!response.ok) {
467
+ return {
468
+ error: response.statusText
469
+ };
470
+ } else {
471
+ return response.json();
472
+ }
473
+ }).then(function (json) {
474
+ console.log(json);
475
+ SetState(json);
476
+ });
477
+ } catch (e) {
478
+ console.log(e);
479
+ SetState({
480
+ error: e
481
+ });
482
+ }
464
483
  if (SetReload) {
465
484
  SetReload(false);
466
485
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zac-apps/commons",
3
- "version": "1.3.4",
3
+ "version": "1.3.5-beta.2",
4
4
  "scripts": {
5
5
  "rollup": "node_modules/rollup/dist/rollup.js",
6
6
  "dev": "next dev",
@@ -20,7 +20,7 @@
20
20
  ],
21
21
  "repository": {
22
22
  "type": "git",
23
- "url": "https://gitlab.rlp.net/liermann/zac-apps-commons.git"
23
+ "url": "https://gitlab.rlp.net/zac/zac-apps-commons.git"
24
24
  },
25
25
  "keywords": [
26
26
  "JGU"
@@ -28,6 +28,8 @@
28
28
  "author": "ZAC",
29
29
  "license": "CC-BY-SA-4.0",
30
30
  "dependencies": {
31
+ "@emotion/react": "^11.11.4",
32
+ "@emotion/styled": "^11.11.0",
31
33
  "@mui/icons-material": "^5.15.14",
32
34
  "@mui/material": "^5.15.14"
33
35
  },
@@ -40,21 +42,21 @@
40
42
  "@semantic-release/git": "^10.0.1",
41
43
  "@semantic-release/gitlab": "^13.0.3",
42
44
  "@semantic-release/npm": "^12.0.0",
43
- "@storybook/addon-essentials": "^8.0.4",
44
- "@storybook/addon-interactions": "^8.0.4",
45
- "@storybook/addon-links": "^8.0.4",
46
- "@storybook/addon-onboarding": "^8.0.4",
47
- "@storybook/blocks": "^8.0.4",
48
- "@storybook/nextjs": "^8.0.4",
49
- "@storybook/react": "^8.0.4",
50
- "@storybook/test": "^8.0.4",
45
+ "@storybook/addon-essentials": "^8.0.5",
46
+ "@storybook/addon-interactions": "^8.0.5",
47
+ "@storybook/addon-links": "^8.0.5",
48
+ "@storybook/addon-onboarding": "^8.0.5",
49
+ "@storybook/blocks": "^8.0.5",
50
+ "@storybook/nextjs": "^8.0.5",
51
+ "@storybook/react": "^8.0.5",
52
+ "@storybook/test": "^8.0.5",
51
53
  "babel-loader": "^9.1.3",
52
54
  "eslint": "^8",
53
55
  "eslint-config-next": "14.1.4",
54
56
  "eslint-plugin-storybook": "^0.8.0",
55
- "rollup": "^4.13.0",
57
+ "rollup": "^4.13.1",
56
58
  "semantic-release": "^23.0.6",
57
- "storybook": "^8.0.4"
59
+ "storybook": "^8.0.5"
58
60
  },
59
61
  "peerDependencies": {
60
62
  "next": "^14.0.4",