@capillarytech/creatives-library 7.17.126 → 7.17.128

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "7.17.126",
4
+ "version": "7.17.128",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -47,7 +47,7 @@ import messages from './messages';
47
47
  import { selectCurrentOrgDetails } from "../../v2Containers/Cap/selectors";
48
48
  import './_formBuilder.scss';
49
49
  import {updateCharCount, checkUnicode} from "../../utils/smsCharCountV2";
50
- import { SMS, MOBILE_PUSH, LINE, ENABLE_AI_SUGGESTIONS } from '../../v2Containers/CreativesContainer/constants';
50
+ import { SMS, MOBILE_PUSH, LINE, ENABLE_AI_SUGGESTIONS,AI_CONTENT_BOT_DISABLED } from '../../v2Containers/CreativesContainer/constants';
51
51
  import { validateIfTagClosed } from '../../utils/tagValidations';
52
52
  import globalMessages from '../../v2Containers/Cap/messages';
53
53
  import { convert } from 'html-to-text';
@@ -56,6 +56,7 @@ import { GET_TRANSLATION_MAPPED } from '../../containers/TagList/constants';
56
56
  import moment from 'moment';
57
57
  import { CUSTOMER_BARCODE_TAG , COPY_OF} from '../../containers/App/constants';
58
58
  import { isEmailUnsubscribeTagMandatory } from '../../utils/common';
59
+ import { isUrl } from '../../v2Containers/Line/Container/Wrapper/utils';
59
60
  const TabPane = Tabs.TabPane;
60
61
  const {Column} = Table;
61
62
  const {TextArea} = CapInput;
@@ -73,11 +74,6 @@ const errorMessageForTags = {
73
74
  TAG_BRACKET_COUNT_MISMATCH_ERROR: 'tagBracketCountMismatchError'
74
75
  };
75
76
 
76
- const isUrl = (str) => {
77
- // eslint-disable-next-line no-useless-escape
78
- const res = str.match(/(http(s)?:\/\/)(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g);
79
- return res;
80
- };
81
77
  class FormBuilder extends React.Component { // eslint-disable-line react/prefer-stateless-function
82
78
  constructor(props) {
83
79
  super(props);
@@ -2344,8 +2340,8 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
2344
2340
  const { formatMessage } = this.props.intl;
2345
2341
 
2346
2342
  const { accessibleFeatures = [] } = this.props.currentOrgDetails || {};
2347
- const hasAiSuggestionsEnabled = accessibleFeatures.includes(
2348
- ENABLE_AI_SUGGESTIONS
2343
+ const isAiContentBotDisabled = accessibleFeatures?.includes(
2344
+ AI_CONTENT_BOT_DISABLED
2349
2345
  );
2350
2346
 
2351
2347
  let errorMessageText = false;
@@ -2384,7 +2380,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
2384
2380
  cols={cols}
2385
2381
  />
2386
2382
  {[SMS, MOBILE_PUSH].includes(this.props.schema?.channel)
2387
- && hasAiSuggestionsEnabled
2383
+ && !isAiContentBotDisabled
2388
2384
  && this.props.isFullMode
2389
2385
  && (
2390
2386
  <CapAskAira.ContentGenerationBot
@@ -17,6 +17,7 @@ import {
17
17
  ENABLE_AI_SUGGESTIONS,
18
18
  ENABLE_NEW_LEFT_NAVIGATION,
19
19
  DEFAULT_MODULE,
20
+ AI_DOCUMENTATION_BOT_ENABLED
20
21
  } from '../../v2Containers/Cap/constants';
21
22
  import CapNavigation from '@capillarytech/cap-ui-library/CapNavigation';
22
23
  import configPath from '../../config/path';
@@ -148,7 +149,7 @@ export class NavigationBar extends React.Component {
148
149
  handleLeftNavBarExpanded,
149
150
  leftNavbarExpandedProp,
150
151
  } = this.props;
151
- const showDocumentationBot = userData?.currentOrgDetails?.accessibleFeatures?.includes(ENABLE_AI_SUGGESTIONS);
152
+ const showDocumentationBot = userData?.currentOrgDetails?.accessibleFeatures?.includes(ENABLE_AI_SUGGESTIONS) || userData?.currentOrgDetails?.accessibleFeatures?.includes(AI_DOCUMENTATION_BOT_ENABLED);
152
153
  const dropdownMenuProps = this.getDropdownMenu();
153
154
  const {
154
155
  currentOrgDetails: {
@@ -39,6 +39,8 @@ export const ORG_REFRESH_SEC = 10;
39
39
  export const ORG_CHANGED = 'ORG_CHANGED';
40
40
 
41
41
  export const ENABLE_AI_SUGGESTIONS = 'ENABLE_AI_SUGGESTIONS';
42
+ export const AI_CONTENT_BOT_DISABLED = 'AI_CONTENT_BOT_DISABLED';
43
+ export const AI_DOCUMENTATION_BOT_ENABLED = 'AI_DOCUMENTATION_BOT_ENABLED';
42
44
  export const ERROR_IN_FETCHING_TAGS = 'Error in fetching tags';
43
45
  export const ENABLE_NEW_LEFT_NAVIGATION = 'ENABLE_NEW_LEFT_NAVIGATION';
44
46
 
@@ -193,8 +193,6 @@ export function* getSupportVideosConfig({ callback }) {
193
193
 
194
194
  function* watchFetchSchemaForEntity() {
195
195
  const watcher = yield takeLatest(types.GET_SCHEMA_FOR_ENTITY_REQUEST, fetchSchemaForEntity);
196
- yield take(LOCATION_CHANGE);
197
- yield cancel(watcher);
198
196
  }
199
197
 
200
198