@camunda/camunda-composite-components 0.2.2-rc.0 → 0.2.2-rc.3

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.
@@ -18,6 +18,7 @@ export const C3HelpCenter = ({ autoStartSurvey, origin, flags, isOpen, onRequest
18
18
  const [userId, setUserId] = useState("");
19
19
  const [token, setToken] = useState("");
20
20
  const [audience, setAudience] = useState("");
21
+ const [organizationId, setOrganizationId] = useState(null);
21
22
  const [organization, setOrganization] = useState(null);
22
23
  const [clusters, setClusters] = useState([]);
23
24
  const [helpCenterConfig, setHelpCenterConfig] = useState(defaultHelpCenterConfig);
@@ -75,11 +76,15 @@ export const C3HelpCenter = ({ autoStartSurvey, origin, flags, isOpen, onRequest
75
76
  }
76
77
  };
77
78
  React.useEffect(() => {
78
- if (token !== userToken && !!userToken) {
79
+ const tokenChanged = token !== userToken && !!userToken;
80
+ const orgChanged = organizationId !== activeOrganizationId && !!activeOrganizationId;
81
+ if (tokenChanged)
79
82
  setToken(userToken);
83
+ if (orgChanged)
84
+ setOrganizationId(activeOrganizationId);
85
+ if (tokenChanged || orgChanged)
80
86
  fetchData();
81
- }
82
- }, [userToken]);
87
+ }, [userToken, activeOrganizationId]);
83
88
  React.useEffect(() => {
84
89
  const tabs = helpCenterConfig.tabs;
85
90
  const firstTab = tabs[0].id;
@@ -1,4 +1,4 @@
1
- import { Button, Checkbox, FileUploaderDropContainer, FileUploaderItem, InlineLoading, RadioTile, Stack, TextArea, Tooltip, } from "@carbon/react";
1
+ import { ActionableNotification, Button, Checkbox, FileUploaderDropContainer, FileUploaderItem, InlineLoading, RadioTile, Stack, TextArea, Tooltip, } from "@carbon/react";
2
2
  import React, { useState } from "react";
3
3
  import { Idea, Debug, Information, Chat } from "@carbon/react/icons";
4
4
  import { submitFeedback } from "../../../api/help-center";
@@ -144,6 +144,7 @@ export const Feedback = (props) => {
144
144
  React.createElement("div", null,
145
145
  React.createElement(Stack, null,
146
146
  !orgIsEnterPriseOrPaidCC && (React.createElement("h5", { style: { marginBottom: "-16px" } }, content.title)),
147
+ orgIsEnterPriseOrPaidCC && (React.createElement(ActionableNotification, { inline: true, lowContrast: true, kind: "info", title: "If you are looking to get technical support, please use our Jira support system", hideCloseButton: true, style: { maxWidth: "100%" }, actionButtonLabel: "Open a ticket", onActionButtonClick: () => window.open("https://jira.camunda.com/projects/SUPPORT/queues", "_blank") })),
147
148
  React.createElement(TextArea, { labelText: "", id: "feedback-text", placeholder: content.placeholder, rows: 4, onChange: (event) => {
148
149
  setSuggestion(event.target.value);
149
150
  }, value: suggestion }),
@@ -162,20 +163,21 @@ export const Feedback = (props) => {
162
163
  paddingLeft: "0px",
163
164
  } })))),
164
165
  React.createElement("p", { className: "cds--label-description", style: { marginTop: "-24px" } }, "Max. file size is 5MB. Supported file types are .jpg and .png."))),
165
- (() => {
166
- if (file !== undefined) {
167
- return (React.createElement(FileUploaderItem, { name: file.name, iconDescription: "Delete file", invalid: (() => {
168
- return file.size > 5000000;
169
- })(), status: "edit", errorSubject: "File exceeds size limit.", size: "lg", style: { marginTop: "-32px", maxWidth: "100%" }, onDelete: () => {
170
- setFile(undefined);
171
- } }));
172
- }
173
- else {
174
- return (React.createElement(FileUploaderDropContainer, { labelText: "Drag and drop file here or click to upload", multiple: false, accept: ["image/jpeg", "image/jpg", "image/png"], onAddFiles: (_evt, { addedFiles }) => {
175
- setFile(addedFiles[0]);
176
- }, style: { marginTop: "-32px", maxWidth: "100%" } }));
177
- }
178
- })(),
166
+ !orgIsEnterPriseOrPaidCC &&
167
+ (() => {
168
+ if (file !== undefined) {
169
+ return (React.createElement(FileUploaderItem, { name: file.name, iconDescription: "Delete file", invalid: (() => {
170
+ return file.size > 5000000;
171
+ })(), status: "edit", errorSubject: "File exceeds size limit.", size: "lg", style: { marginTop: "-32px", maxWidth: "100%" }, onDelete: () => {
172
+ setFile(undefined);
173
+ } }));
174
+ }
175
+ else {
176
+ return (React.createElement(FileUploaderDropContainer, { labelText: "Drag and drop file here or click to upload", multiple: false, accept: ["image/jpeg", "image/jpg", "image/png"], onAddFiles: (_evt, { addedFiles }) => {
177
+ setFile(addedFiles[0]);
178
+ }, style: { marginTop: "-32px", maxWidth: "100%" } }));
179
+ }
180
+ })(),
179
181
  !orgIsEnterPriseOrPaidCC && (React.createElement("div", null,
180
182
  React.createElement(Checkbox, { id: "allow-contact", labelText: "Camunda may contact me about my feedback", checked: allowContact, onChange: () => {
181
183
  setAllowContact(!allowContact);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/camunda-composite-components",
3
- "version": "0.2.2-rc.0",
3
+ "version": "0.2.2-rc.3",
4
4
  "scripts": {
5
5
  "clean": "rimraf lib/",
6
6
  "build": "yarn clean && tsc",