@devtron-labs/devtron-fe-common-lib 0.0.6-beta-22 → 0.0.6-beta-24

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.
Binary file
@@ -25,3 +25,12 @@ export declare const DEFAULT_TAG_DATA: {
25
25
  isInvalidKey: boolean;
26
26
  isInvalidValue: boolean;
27
27
  };
28
+ export declare const TOAST_ACCESS_DENIED: {
29
+ TITLE: string;
30
+ SUBTITLE: string;
31
+ };
32
+ export declare const ERROR_EMPTY_SCREEN: {
33
+ PAGE_NOT_FOUND: string;
34
+ PAGE_NOT_EXIST: string;
35
+ TAKE_BACK_HOME: string;
36
+ };
@@ -1,2 +1,3 @@
1
1
  export * from './TagLabelSelect';
2
2
  export * from './TagLabelValueSelector';
3
+ export * from './ResizableTagTextArea';
@@ -6,7 +6,7 @@ export declare class ErrorScreenManager extends Component<{
6
6
  subtitleClass?: string;
7
7
  reloadClass?: string;
8
8
  }> {
9
- getMessage(): JSX.Element | "Bad Request" | "Unauthorized" | "Not Found" | "Internal Server Error" | "Bad Gateway" | "Service Temporarily Unavailable";
9
+ getMessage(): JSX.Element | "Bad Request" | "Unauthorized" | "Internal Server Error" | "Bad Gateway" | "Service Temporarily Unavailable";
10
10
  render(): JSX.Element;
11
11
  }
12
12
  export declare class ErrorScreenNotAuthorized extends Component<{
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare function ErrorScreenNotFound(): JSX.Element;
3
+ export default ErrorScreenNotFound;
@@ -20,4 +20,4 @@ export declare class ToastBodyWithButton extends React.Component<{
20
20
  }> {
21
21
  render(): JSX.Element;
22
22
  }
23
- export declare const toastAccessDenied: (subtitle?: string) => React.ReactText;
23
+ export declare const toastAccessDenied: (title?: string, subtitle?: string) => React.ReactText;
@@ -20,11 +20,12 @@ export declare enum TippyTheme {
20
20
  white = "white"
21
21
  }
22
22
  export interface TagType {
23
+ id?: number;
23
24
  key: string;
24
25
  value?: string;
25
26
  description?: string;
26
27
  propagate: boolean;
27
- mandatoryProjectIdsCsv?: string[];
28
+ mandatoryProjectIdsCsv?: string;
28
29
  isInvalidKey?: boolean;
29
30
  isInvalidValue?: boolean;
30
31
  }
@@ -24,3 +24,4 @@ export * from './MultiSelectCustomization';
24
24
  export { default as InfoColourBar } from './InfoColorBar/InfoColourbar';
25
25
  export * from './Common.service';
26
26
  export * from './Checkbox';
27
+ export { default as EmptyState } from './EmptyState/EmptyState';
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var React = require('react');
5
5
  var ReactDOM = require('react-dom');
6
+ var reactRouter = require('react-router');
6
7
  var reactRouterDom = require('react-router-dom');
7
8
 
8
9
  function _interopNamespaceDefault(e) {
@@ -45,7 +46,17 @@ exports.KEY_VALUE = void 0;
45
46
  KEY_VALUE["KEY"] = "key";
46
47
  KEY_VALUE["VALUE"] = "value";
47
48
  })(exports.KEY_VALUE || (exports.KEY_VALUE = {}));
48
- var DEFAULT_TAG_DATA = { key: '', value: '', propagate: false, isInvalidKey: false, isInvalidValue: false };
49
+ var DEFAULT_TAG_DATA = { key: '', value: '', propagate: false, isInvalidKey: false, isInvalidValue: false };
50
+ var TOAST_ACCESS_DENIED = {
51
+ TITLE: 'Access denied',
52
+ SUBTITLE: 'You do not have required access to perform this action',
53
+ };
54
+ // Empty state messgaes
55
+ var ERROR_EMPTY_SCREEN = {
56
+ PAGE_NOT_FOUND: 'We could not find this page',
57
+ PAGE_NOT_EXIST: 'This page doesn’t exist or was removed. We suggest you go back to home',
58
+ TAKE_BACK_HOME: 'Take me home',
59
+ };
49
60
 
50
61
  /******************************************************************************
51
62
  Copyright (c) Microsoft Corporation.
@@ -1905,8 +1916,8 @@ var ToastBodyWithButton = /** @class */ (function (_super) {
1905
1916
  };
1906
1917
  return ToastBodyWithButton;
1907
1918
  }(React.Component));
1908
- var toastAccessDenied = function (subtitle) {
1909
- return toast.info(jsxRuntime.jsx(ToastBody, { title: "Access denied", subtitle: subtitle || "You do not have required access to perform this action" }), {
1919
+ var toastAccessDenied = function (title, subtitle) {
1920
+ return toast.info(jsxRuntime.jsx(ToastBody, { title: title || TOAST_ACCESS_DENIED.TITLE, subtitle: subtitle || TOAST_ACCESS_DENIED.SUBTITLE }), {
1910
1921
  className: 'devtron-toast unauthorized',
1911
1922
  });
1912
1923
  };
@@ -1923,6 +1934,16 @@ function Reload(_a) {
1923
1934
 
1924
1935
  var notAuthorized = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%22250%22%20height%3D%22200%22%20viewBox%3D%220%200%20250%20200%22%3E%20%20%20%20%3Cdefs%3E%20%20%20%20%20%20%20%20%3ClinearGradient%20id%3D%22ho9etwod5c%22%20x1%3D%2255.01%25%22%20x2%3D%2240.976%25%22%20y1%3D%220%25%22%20y2%3D%22100%25%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cstop%20offset%3D%220%25%22%20stop-color%3D%22%232A318C%22%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cstop%20offset%3D%22100%25%22%20stop-color%3D%22%231D225F%22%2F%3E%20%20%20%20%20%20%20%20%3C%2FlinearGradient%3E%20%20%20%20%20%20%20%20%3ClinearGradient%20id%3D%22mdhg2gjypd%22%20x1%3D%2250%25%22%20x2%3D%2250%25%22%20y1%3D%220%25%22%20y2%3D%22100%25%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cstop%20offset%3D%220%25%22%20stop-color%3D%22%23EEE%22%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cstop%20offset%3D%22100%25%22%20stop-color%3D%22%23D6D7D8%22%2F%3E%20%20%20%20%20%20%20%20%3C%2FlinearGradient%3E%20%20%20%20%20%20%20%20%3ClinearGradient%20id%3D%22xe2mx0bk0e%22%20x1%3D%220%25%22%20x2%3D%22100%25%22%20y1%3D%2218%25%22%20y2%3D%2282%25%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cstop%20offset%3D%220%25%22%20stop-color%3D%22%23E8B73F%22%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cstop%20offset%3D%22100%25%22%20stop-color%3D%22%23CF9F36%22%2F%3E%20%20%20%20%20%20%20%20%3C%2FlinearGradient%3E%20%20%20%20%20%20%20%20%3Cpath%20id%3D%2288gkjk6cca%22%20d%3D%22M0%200H250V200H0z%22%2F%3E%20%20%20%20%3C%2Fdefs%3E%20%20%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20transform%3D%22translate%28-590%20-308%29%20translate%28590%20308%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cmask%20id%3D%22pitr2853ub%22%20fill%3D%22%23fff%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cuse%20xlink%3Ahref%3D%22%2388gkjk6cca%22%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fmask%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20mask%3D%22url%28%23pitr2853ub%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M47.646%200c2.598%200%205.717%201.017%207.994%202.74%202.276%201.722%203.845%203.02%204.55%205.097.465%201.372.252%203.282-.641%205.728l.008-.072c-.013.145-.039.269-.071.387.574-1.048%201.638-1.624%202.576-1.283%201.07.39%201.5%201.803%201.013%203.14-.487%201.337-1.723%202.144-2.794%201.754-.536-.195-.91-.646-1.09-1.216.023.975.09%202.117.203%203.427l-2.317.161c-2.223%202.412-4.574%203.48-7.055%203.207-.6-.067-1.158-.18-1.675-.339-.588%201.007-1.177%202.688-1.766%205.043l-.064.031.005-.043c-.585%205.627-1.014%2011.07-1.287%2016.327l.001-.108c-.013.958-.003%201.853.028%202.684l.109-1.533c2.141%201.735%204.344%202.776%206.608%203.123%202.263.348%205.76-.128%2010.49-1.426%202.808-.962%205.555-2.299%208.243-4.011H63.94l16.84-20.83h2.756c0-1.439%201.165-2.604%202.604-2.604%201.378%200%202.506%201.07%202.597%202.425l.006.178h1.736c0-1.438%201.166-2.603%202.604-2.603%201.378%200%202.506%201.07%202.598%202.425l.006.178h5.284L89.832%2035.292c.097-.07.17-.106.212-.106.692%200%20.692%205.306-.057%207.152-.289.865-4.73%205.71-9.864%2010.844-2.78%202.78-6.605%206.366-11.477%2010.759l2.511%2011.858c-.568%201.157-2.01%201.928-4.324%202.314-5.208.579-10.415-1.736-16.78-1.736-1.852%200-3.142.343-4.269.744.841%208.545%202.264%2016.398%204.269%2023.558-1.157%201.157-1.946%201.682-2.808%202.052-1.015.394-2.305.789-3.009.86.776%202.429%201.318%204.584%201.627%206.464.38%202.322%202.518%2022.156%206.411%2059.5h-.044l2.037%201.697c2.308%201.962%2012.796%207.547%2014.132%208.307.891.506%202.067%201.794%203.526%203.864-16.575-.025-27.78-.05-33.613-.075l.053.075C12.788%20183.385%200%20183.346%200%20183.308c0-.116%201.154-3.288%202.538-7.095l2.44-6.658H1.761c-.4-1.385-.792-3.254-1.175-5.606-.75-4.788-.18-7.96%203.05-14.536%203.23-6.518%204.866-10.072%204.866-13.764.058-5.768%201.222-11.316%204.28-17.315%202.364-4.73%203.495-5.086%203.725-7.97l.367-5.421c-2.382-.231-5.928-.988-8.045-1.693l-4.21-1.385-.116-4.326C4.214%2085.6%205.08%2076.89%207.79%2065.757%2011.482%2050.47%2022.096%2034.84%2034.959%2025.668c3.055-2.203%204.272-3.049%205.093-2.807.79-.548%201.483-1.096%202.077-1.645-1.685-.52-3.275-1.222-4.77-2.105-2.311-1.366-4.444-3.194-6.398-5.483.397-.834.904-1.524%201.522-2.07.671-.592%201.935-1.108%203.169-1.822l-.065.021-1.204.401c-1.26.424-1.956.713-2.396%201.032-.829.601-1.259%201.275-1.312%202.032l-.005.191-.579.007c-.012-1.039.516-1.943%201.557-2.699.427-.31%201.013-.573%201.983-.916l1.755-.59.612-.213c.593-.213%201.063-.401%201.438-.584%201.296-1.399%202.17-3.971%204.089-5.678C43.642.855%2045.048%200%2047.646%200zM27.999%20144.476l-.189.512c-2.603%207.055-5.679%2015.219-9.228%2024.493l2.126%201.771c2.307%201.962%2012.795%207.547%2014.132%208.307l.035.021c.364-1.006.782-2.154%201.223-3.367l2.44-6.658h-4.242c-1.444-2.617-2.166-4.456-2.166-5.517%200-1.59.913-3.77.913-6.068%200-1.393-1.68-5.89-5.044-13.494zM78.827%2042.819l-1.242-.001c-2.375%202.17-3.972%203.706-4.791%204.61-.72.793-2.112%202.23-4.176%204.309%203.033-1.194%205.06-2.078%206.083-2.65%201.5-.865%202.077-1.673%203.807-5.307.082-.163.192-.506.319-.961zm7.313-22.857c-1.119%200-2.026.907-2.026%202.025h4.05c0-1.118-.906-2.025-2.024-2.025zm6.943%200c-1.119%200-2.025.907-2.025%202.025h4.05c0-1.118-.907-2.025-2.025-2.025zm-33.27-5.413c-.388%201.066-.065%202.132.666%202.398.73.266%201.664-.343%202.052-1.408.388-1.065.064-2.132-.667-2.398-.73-.266-1.664.343-2.052%201.408z%22%20transform%3D%22translate%2829%208%29%22%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20fill%3D%22%2380AEF2%22%20fill-rule%3D%22nonzero%22%20d%3D%22M36.56%20183.308c0-.116%201.153-3.288%202.538-7.095l2.538-6.922%206.46-.173%206.403-.173%202.768%202.307c2.308%201.962%2012.796%207.547%2014.132%208.307.891.506%202.067%201.794%203.526%203.864-25.577-.038-38.365-.077-38.365-.115z%22%20transform%3D%22translate%2829%208%29%22%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20fill%3D%22%2394BBF8%22%20fill-rule%3D%22nonzero%22%20d%3D%22M3%20183.308c0-.116%201.154-3.288%202.538-7.095l2.538-6.922%206.46-.173%206.403-.173%202.769%202.307c2.307%201.962%2012.795%207.547%2014.132%208.307.89.506%202.066%201.794%203.525%203.864C15.788%20183.385%203%20183.346%203%20183.308z%22%20transform%3D%22translate%2829%208%29%22%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20fill%3D%22%231D225F%22%20fill-rule%3D%22nonzero%22%20d%3D%22M46.655%20101.836c1.09%203.158%201.826%205.898%202.208%208.22.38%202.321%202.518%2022.155%206.411%2059.5H37.296c-1.444-2.618-2.166-4.457-2.166-5.518%200-1.59.913-3.77.913-6.068%200-1.532-2.034-6.823-6.104-15.871l3.931-39.349%2012.785-.914z%22%20transform%3D%22translate%2829%208%29%22%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20fill%3D%22url%28%23ho9etwod5c%29%22%20d%3D%22M21.554%20169.555H4.76c-.4-1.385-.792-3.254-1.175-5.606-.75-4.788-.18-7.96%203.05-14.536%203.23-6.518%204.866-10.072%204.866-13.764.058-5.768%201.222-11.316%204.28-17.315%202.364-4.73%203.495-5.086%203.725-7.97l.42-6.202h21.078c.512%201.433.696%204.075.55%207.925-.145%203.85-6.812%2023.006-20.001%2057.468z%22%20transform%3D%22translate%2829%208%29%22%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20fill%3D%22%2398BDF9%22%20d%3D%22M0%2024.302L16.84%203.472%2037.031%203.472%2019.592%2024.302z%22%20transform%3D%22translate%2829%208%29%20translate%2866.94%2018.516%29%22%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20fill%3D%22%232174DB%22%20d%3D%22M22.2.868c1.378%200%202.506%201.07%202.597%202.425l.006.179h-.578c0-1.119-.907-2.025-2.025-2.025-1.119%200-2.025.906-2.025%202.025%200%201.062.818%201.934%201.859%202.018l.166.007v.578c-1.438%200-2.604-1.165-2.604-2.603%200-1.438%201.166-2.604%202.604-2.604zM29.143.868c1.378%200%202.506%201.07%202.598%202.425l.006.179h-.579c0-1.119-.906-2.025-2.025-2.025-1.118%200-2.025.906-2.025%202.025%200%201.062.818%201.934%201.859%202.018l.166.007v.578c-1.438%200-2.604-1.165-2.604-2.603%200-1.438%201.166-2.604%202.604-2.604z%22%20transform%3D%22translate%2829%208%29%20translate%2866.94%2018.516%29%22%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20fill%3D%22%23F3A29D%22%20fill-rule%3D%22nonzero%22%20d%3D%22M65.472%2046.829c2.807-.962%205.554-2.299%208.242-4.011h6.871c-2.375%202.17-3.972%203.706-4.791%204.61-.82.903-2.509%202.638-5.068%205.205-1.091%205.781-2.254%208.21-3.487%207.285-1.85-1.386-7.939-10.897-1.767-13.09z%22%20transform%3D%22translate%2829%208%29%22%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20fill%3D%22%23FAB6AF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M69.254%2052.654c4.363-1.668%207.179-2.857%208.447-3.567%201.5-.865%202.077-1.673%203.807-5.307.23-.461.692-2.365%201.096-4.153.923-4.557%202.423-4.326%202.538.346.058%201.27.346%202.423.692%202.538.288.116%201.961-1.5%203.634-3.576%201.673-2.077%203.288-3.75%203.576-3.75.692%200%20.692%205.307-.057%207.153-.289.865-4.73%205.71-9.864%2010.844-3.422%203.423-8.431%208.068-15.026%2013.937l1.157-14.465z%22%20transform%3D%22translate%2829%208%29%22%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20fill%3D%22%23F3A29D%22%20fill-rule%3D%22nonzero%22%20d%3D%22M49.581%2027.774c.772-3.086%201.543-5.015%202.315-5.787-1.157-1.157-2.315-2.314-4.63-3.471-.77%201.543-2.314%203.086-4.628%204.629%200%202.314.771%203.857%202.314%204.629%201.543.771%203.086.771%204.63%200z%22%20transform%3D%22translate%2829%208%29%22%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20fill%3D%22url%28%23mdhg2gjypd%29%22%20fill-rule%3D%22nonzero%22%20d%3D%22M12.858%2082.16c-2.365-.174-6.23-.981-8.48-1.731l-4.21-1.385-.115-4.326c-.289-11.94.577-20.65%203.288-31.782C7.032%2027.65%2017.646%2012.019%2030.509%202.847c4.96-3.576%205.076-3.576%206.518-1.153.634%201.153%201.96%202.307%202.884%202.653l2.161.594c-3.046%2029.324-1.87%2053.63%203.531%2072.917-1.157%201.158-1.946%201.682-2.808%202.052-1.039.403-2.365.807-3.057.865-.693.058-3%20.519-5.25%201.038-4.21.923-13.382%201.096-21.63.346z%22%20transform%3D%22translate%2829%208%29%20translate%287.45%2022.82%29%22%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20fill%3D%22%23D6D7D8%22%20d%3D%22M58.022%2024.008l1.767%2011.311-19.972%202.645%201.106-15.653c2.141%201.735%204.344%202.776%206.608%203.123%202.263.348%205.76-.128%2010.49-1.426z%22%20transform%3D%22translate%2829%208%29%20translate%287.45%2022.82%29%22%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20fill%3D%22%23E9E9E9%22%20fill-rule%3D%22nonzero%22%20d%3D%22M61.804%2029.833l4.903%2023.145c-.568%201.157-2.01%201.929-4.324%202.314-5.208.579-10.415-1.736-16.78-1.736-6.365%200-6.09%204.05-15.348.58-6.172-2.315-8.68-12.73-7.523-31.246l18.054-1.73c-.078%205.782.655%209.252%202.198%2010.409%201.512%201.134%207.569.601%2018.17-1.6l.65-.136z%22%20transform%3D%22translate%2829%208%29%20translate%287.45%2022.82%29%22%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20fill%3D%22%23FAB6AF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M29.082%207.444c1.07%201.52%201.488%203.536%201.253%206.049-.062.656-.376.883-.376%202.052%200%201.12.07%202.506.212%204.157l-2.317.161c-2.222%202.412-4.574%203.48-7.055%203.207-2.48-.275-4.251-1.343-5.31-3.207-2.18-4.023-1.621-7.444%201.675-10.262%203.296-2.818%207.269-3.537%2011.918-2.157z%22%20transform%3D%22translate%2829%208%29%20translate%2832.223%29%22%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20fill%3D%22%23E94A47%22%20d%3D%22M18.423%200c2.598%200%205.717%201.017%207.994%202.74%202.277%201.722%203.845%203.02%204.55%205.097.47%201.384.248%203.314-.664%205.791.13-2.345-.048-3.647-.533-3.906-.67%201.653-1.595%201.987-2.703%202.787-.62.448-2.791.518-4.917.897-2.628%201.722-4.303%203.33-4.867%204.86-.448%201.218-.402%202.608.148%204.177l.126.339-.54.21c-.714-1.833-.81-3.478-.277-4.925.522-1.417%201.85-2.838%203.894-4.321-1.09.307-2.051.754-2.634%201.449-1.279%201.526-2.028%203.765-2.246%206.716-2.766-.5-5.305-1.433-7.617-2.8-2.312-1.366-4.445-3.194-6.398-5.483.396-.834.904-1.524%201.521-2.07.671-.592%201.935-1.108%203.169-1.822l-.065.021-1.204.401c-1.26.424-1.956.713-2.395%201.032-.83.601-1.26%201.275-1.313%202.032l-.005.191-.579.007c-.012-1.039.516-1.943%201.557-2.699.427-.31%201.013-.573%201.983-.916l1.756-.59.61-.213c.594-.213%201.064-.401%201.439-.584%201.296-1.399%202.17-3.971%204.09-5.678C14.418.855%2015.825%200%2018.422%200z%22%20transform%3D%22translate%2829%208%29%20translate%2832.223%29%22%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20fill%3D%22%23222768%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M1.025%203.16C1.622%201.52%203.194.563%204.56%201.06c1.061.386%201.653%201.524%201.586%202.781.36-.092.688-.137.988-.137l.208.008c.254.02.466.056.636.114.511-1.271%201.708-2.023%202.749-1.644%201.07.39%201.5%201.802%201.013%203.14-.487%201.337-1.723%202.143-2.794%201.754-.953-.347-1.397-1.504-1.14-2.697-.103-.038-.274-.072-.508-.09-.334-.025-.737.029-1.209.165l-.03.01c-.036.159-.083.318-.14.477-.597%201.64-2.17%202.597-3.536%202.1C1.017%206.543.428%204.8%201.025%203.16zm9.504-.434c-.73-.266-1.664.343-2.052%201.408-.388%201.065-.064%202.132.667%202.398.73.266%201.664-.343%202.052-1.408.387-1.066.064-2.132-.667-2.398zM4.362%201.604c-1.036-.378-2.297.39-2.793%201.754-.496%201.363-.024%202.762%201.012%203.14%201.036.376%202.298-.392%202.794-1.755s.023-2.762-1.013-3.14z%22%20transform%3D%22translate%2829%208%29%20translate%2832.223%29%20translate%2822.112%2010.415%29%22%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20mask%3D%22url%28%23pitr2853ub%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M30%200c12.15%200%2022%209.85%2022%2022v11h8v48H0V33h8V22C8%209.973%2017.654.198%2029.637.004zm0%207.934c-7.755%200-14.067%206.309-14.067%2014.067V33h28.133V22c0-7.652-6.14-13.896-13.752-14.063z%22%20transform%3D%22translate%28134%2061%29%22%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20fill%3D%22%23D6D7D8%22%20d%3D%22M55%2034.3V22C55%209.85%2045.15%200%2033%200S11%209.85%2011%2022v12.3m7.933%200V22c0-7.757%206.312-14.066%2014.068-14.066%207.756%200%2014.065%206.31%2014.065%2014.067v12.298%22%20transform%3D%22translate%28134%2061%29%22%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20fill%3D%22url%28%23xe2mx0bk0e%29%22%20d%3D%22M3%2033H63V81H3z%22%20transform%3D%22translate%28134%2061%29%22%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20fill%3D%22%233E3D4C%22%20fill-rule%3D%22nonzero%22%20d%3D%22M39%2056c0-3.314-2.686-6-6-6s-6%202.686-6%206c0%202.282%201.275%204.267%203.15%205.281l-.965%207.386h7.63l-.965-7.386C37.726%2060.267%2039%2058.282%2039%2056z%22%20transform%3D%22translate%28134%2061%29%22%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";
1925
1936
 
1937
+ var notFound = "27bfa7a87d0b7039.png";
1938
+
1939
+ function ErrorScreenNotFound() {
1940
+ var history = reactRouter.useHistory();
1941
+ var redirectToHome = function () {
1942
+ history.push('/app/list');
1943
+ };
1944
+ return (jsxRuntime.jsx("div", { children: jsxRuntime.jsxs(EmptyState, { children: [jsxRuntime.jsx(EmptyState.Image, { children: jsxRuntime.jsx("img", { src: notFound, alt: "Not Found" }) }), jsxRuntime.jsx(EmptyState.Title, { children: jsxRuntime.jsx("h3", __assign({ className: "title" }, { children: ERROR_EMPTY_SCREEN.PAGE_NOT_FOUND })) }), jsxRuntime.jsx(EmptyState.Subtitle, { children: jsxRuntime.jsx("p", { children: ERROR_EMPTY_SCREEN.PAGE_NOT_EXIST }) }), jsxRuntime.jsx(EmptyState.Button, { children: jsxRuntime.jsx("button", __assign({ className: "flex cta h-32", onClick: redirectToHome }, { children: ERROR_EMPTY_SCREEN.TAKE_BACK_HOME })) })] }) }));
1945
+ }
1946
+
1926
1947
  var ErrorScreenManager = /** @class */ (function (_super) {
1927
1948
  __extends(ErrorScreenManager, _super);
1928
1949
  function ErrorScreenManager() {
@@ -1937,7 +1958,7 @@ var ErrorScreenManager = /** @class */ (function (_super) {
1937
1958
  case 403:
1938
1959
  return (jsxRuntime.jsx(ErrorScreenNotAuthorized, { subtitle: this.props.subtitle, subtitleClass: this.props.subtitleClass }));
1939
1960
  case 404:
1940
- return 'Not Found';
1961
+ return jsxRuntime.jsx(ErrorScreenNotFound, {});
1941
1962
  case 500:
1942
1963
  return 'Internal Server Error';
1943
1964
  case 502:
@@ -8399,7 +8420,7 @@ function TippyCustomized(props) {
8399
8420
  };
8400
8421
  var getTippyContent = function () {
8401
8422
  var Icon = props.Icon, iconPath = props.iconPath, iconClass = props.iconClass, iconSize = props.iconSize, onImageLoadError = props.onImageLoadError, heading = props.heading, infoTextHeading = props.infoTextHeading, infoText = props.infoText, showCloseButton = props.showCloseButton, additionalContent = props.additionalContent, documentationLink = props.documentationLink, documentationLinkText = props.documentationLinkText;
8402
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", __assign({ className: "dc__word-break dc__hyphens-auto flex left ".concat(isWhiteTheme ? 'p-12 dc__border-bottom-n1 cn-9' : 'pt-20 pb-12 pr-20 pl-20 cn-0') }, { children: [iconPath ? (jsxRuntime.jsx("img", { className: "icon-dim-".concat(iconSize || 20, " mr-6 ").concat(iconClass || ''), src: iconPath, alt: heading, onError: onImageLoadError })) : (Icon && (jsxRuntime.jsx("div", __assign({ className: "icon-dim-".concat(iconSize || 20, " mr-6") }, { children: jsxRuntime.jsx(Icon, { className: "icon-dim-".concat(iconSize || 20, " ").concat(iconClass || '') }) })))), heading && jsxRuntime.jsx("span", __assign({ className: "fs-14 fw-6 lh-20 ".concat(showCloseButton ? 'mr-6' : '') }, { children: heading })), showCloseButton && (jsxRuntime.jsx("div", __assign({ className: "icon-dim-16 ml-auto" }, { children: jsxRuntime.jsx(SvgIcCross, { className: "icon-dim-16 cursor ".concat(isWhiteTheme ? 'fcn-9' : 'fcn-0'), onClick: closeTippy }) })))] })), infoTextHeading && (jsxRuntime.jsx("div", __assign({ className: "dc__word-break dc__hyphens-auto fs-14 fw-6 lh-20 ".concat(isWhiteTheme ? 'pl-12 pr-12' : 'pl-20 pr-20') }, { children: infoTextHeading }))), infoText && (jsxRuntime.jsx("div", __assign({ className: "dc__word-break dc__hyphens-auto fs-13 fw-4 lh-20 ".concat(isWhiteTheme
8423
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", __assign({ className: "dc__word-break dc__hyphens-auto flex left ".concat(isWhiteTheme ? 'p-12 dc__border-bottom-n1 cn-9' : 'pt-20 pb-12 pr-20 pl-20 cn-0 top') }, { children: [iconPath ? (jsxRuntime.jsx("img", { className: "icon-dim-".concat(iconSize || 20, " mr-6 ").concat(iconClass || ''), src: iconPath, alt: heading, onError: onImageLoadError })) : (Icon && (jsxRuntime.jsx("div", __assign({ className: "icon-dim-".concat(iconSize || 20, " mr-6") }, { children: jsxRuntime.jsx(Icon, { className: "icon-dim-".concat(iconSize || 20, " ").concat(iconClass || '') }) })))), heading && jsxRuntime.jsx("span", __assign({ className: "fs-14 fw-6 lh-20 ".concat(showCloseButton ? 'mr-6' : '') }, { children: heading })), showCloseButton && (jsxRuntime.jsx("div", __assign({ className: "icon-dim-16 ml-auto" }, { children: jsxRuntime.jsx(SvgIcCross, { className: "icon-dim-16 cursor ".concat(isWhiteTheme ? 'fcn-9' : 'fcn-0'), onClick: closeTippy }) })))] })), infoTextHeading && (jsxRuntime.jsx("div", __assign({ className: "dc__word-break dc__hyphens-auto fs-14 fw-6 lh-20 ".concat(isWhiteTheme ? 'pl-12 pr-12' : 'pl-20 pr-20') }, { children: infoTextHeading }))), infoText && (jsxRuntime.jsx("div", __assign({ className: "dc__word-break dc__hyphens-auto fs-13 fw-4 lh-20 ".concat(isWhiteTheme
8403
8424
  ? 'p-12'
8404
8425
  : "pl-20 pr-20 pt-4 ".concat(additionalContent && documentationLink ? 'pb-12' : 'pb-20')) }, { children: infoText }))), additionalContent, documentationLink && (jsxRuntime.jsx("div", __assign({ className: "pl-12 pb-12" }, { children: jsxRuntime.jsx("a", __assign({ href: documentationLink, target: "_blank", rel: "noreferrer noopener", className: "fs-13 cb-5", onClick: closeTippy }, { children: documentationLinkText || 'Learn more' })) })))] }));
8405
8426
  };
@@ -8581,11 +8602,11 @@ function ResizableTagTextArea(_a) {
8581
8602
  var handleOnBlur = function (event) {
8582
8603
  refVar.current.style.height = 'auto';
8583
8604
  dependentRef.current.style.height = 'auto';
8584
- onBlur(event);
8605
+ onBlur && onBlur(event);
8585
8606
  };
8586
8607
  var handleOnFocus = function (event) {
8587
8608
  reInitHeight();
8588
- onFocus(event);
8609
+ onFocus && onFocus(event);
8589
8610
  };
8590
8611
  return (jsxRuntime.jsx("textarea", { rows: 1, ref: refVar, value: text, placeholder: placeholder, className: "".concat(className || '', " lh-20"), style: { resize: 'none' }, onChange: handleChange, onBlur: handleOnBlur, onFocus: handleOnFocus, tabIndex: tabIndex }));
8591
8612
  }
@@ -16263,12 +16284,12 @@ var MultiValueChipContainer = function (_a) {
16263
16284
  return (jsxRuntime.jsxs(components.MultiValueContainer, __assign({}, { data: data, innerProps: innerProps, selectProps: selectProps }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex fs-12 pl-4 pr-4" }, { children: [!isValidEmail && jsxRuntime.jsx(SvgIcErrorMedium, { className: "mr-4 icon-dim-16" }), jsxRuntime.jsx("div", __assign({ className: "".concat(isValidEmail ? 'cn-9' : 'cr-5') }, { children: label }))] })), children[1]] })));
16264
16285
  };
16265
16286
  var multiSelectStyles = {
16266
- control: function (base, state) { return (__assign(__assign({}, base), { cursor: state.isDisabled ? 'not-allowed' : 'normal', border: state.isFocused ? '1px solid #06c' : '1px solid #d6dbdf', boxShadow: 'none', minheight: '24px !important' })); },
16267
- menu: function (base, state) { return (__assign(__assign({}, base), { top: "40px" })); },
16287
+ control: function (base, state) { return (__assign(__assign({}, base), { cursor: state.isDisabled ? 'not-allowed' : 'normal', border: state.isFocused ? '1px solid #06c' : '1px solid #d6dbdf', boxShadow: 'none' })); },
16288
+ menu: function (base, state) { return (__assign({}, base)); },
16268
16289
  option: function (base, state) {
16269
- return (__assign(__assign({}, base), { backgroundColor: state.isFocused ? 'var(--N100)' : 'white', color: 'var(--N900)', padding: '8px 12px' }));
16290
+ return __assign(__assign({}, base), { backgroundColor: state.isFocused ? 'var(--N100)' : 'white', color: 'var(--N900)', padding: '8px 12px' });
16270
16291
  },
16271
- container: function (base, state) { return (__assign(__assign({}, base), { cursor: state.isDisabled ? 'not-allowed' : 'normal' })); },
16292
+ container: function (base, state) { return (__assign(__assign({}, base), { cursor: state.isDisabled ? 'not-allowed' : 'pointer' })); },
16272
16293
  valueContainer: function (base, state) { return (__assign(__assign({}, base), { color: state.selectProps.menuIsOpen ? 'var(--N500)' : base.color })); },
16273
16294
  };
16274
16295
  var CustomSelect = function (props) {
@@ -16356,6 +16377,8 @@ exports.DetailsProgressing = DetailsProgressing;
16356
16377
  exports.DialogForm = DialogForm;
16357
16378
  exports.DialogFormSubmit = DialogFormSubmit;
16358
16379
  exports.Drawer = Drawer;
16380
+ exports.ERROR_EMPTY_SCREEN = ERROR_EMPTY_SCREEN;
16381
+ exports.EmptyState = EmptyState;
16359
16382
  exports.ErrorScreenManager = ErrorScreenManager;
16360
16383
  exports.ErrorScreenNotAuthorized = ErrorScreenNotAuthorized;
16361
16384
  exports.ForceDeleteDialog = ForceDeleteDialog;
@@ -16374,9 +16397,11 @@ exports.ROUTES = ROUTES;
16374
16397
  exports.RadioGroup = RadioGroup;
16375
16398
  exports.RadioGroupItem = RadioGroupItem;
16376
16399
  exports.RequestTimeout = RequestTimeout;
16400
+ exports.ResizableTagTextArea = ResizableTagTextArea;
16377
16401
  exports.ServerError = ServerError;
16378
16402
  exports.ServerErrors = ServerErrors;
16379
16403
  exports.SingleSelectOption = SingleSelectOption;
16404
+ exports.TOAST_ACCESS_DENIED = TOAST_ACCESS_DENIED;
16380
16405
  exports.TagLabelSelect = TagLabelSelect;
16381
16406
  exports.TagLabelValueSelector = TagLabelValueSelector;
16382
16407
  exports.TippyCustomized = TippyCustomized;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtron-labs/devtron-fe-common-lib",
3
- "version": "0.0.6-beta-22",
3
+ "version": "0.0.6-beta-24",
4
4
  "description": "Supporting common component library",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -23,4 +23,16 @@ export enum KEY_VALUE {
23
23
  VALUE= 'value'
24
24
  }
25
25
 
26
- export const DEFAULT_TAG_DATA = { key: '', value: '', propagate: false, isInvalidKey: false, isInvalidValue: false }
26
+ export const DEFAULT_TAG_DATA = { key: '', value: '', propagate: false, isInvalidKey: false, isInvalidValue: false }
27
+
28
+ export const TOAST_ACCESS_DENIED = {
29
+ TITLE: 'Access denied',
30
+ SUBTITLE: 'You do not have required access to perform this action',
31
+ }
32
+
33
+ // Empty state messgaes
34
+ export const ERROR_EMPTY_SCREEN = {
35
+ PAGE_NOT_FOUND: 'We could not find this page',
36
+ PAGE_NOT_EXIST: 'This page doesn’t exist or was removed. We suggest you go back to home',
37
+ TAKE_BACK_HOME: 'Take me home',
38
+ }
@@ -49,12 +49,12 @@ export function ResizableTagTextArea({
49
49
  const handleOnBlur = (event) => {
50
50
  refVar.current.style.height = 'auto'
51
51
  dependentRef.current.style.height = 'auto'
52
- onBlur(event)
52
+ onBlur && onBlur(event)
53
53
  }
54
54
 
55
55
  const handleOnFocus = (event) => {
56
56
  reInitHeight()
57
- onFocus(event)
57
+ onFocus && onFocus(event)
58
58
  }
59
59
 
60
60
  return (
@@ -1,2 +1,3 @@
1
1
  export * from './TagLabelSelect'
2
- export * from './TagLabelValueSelector'
2
+ export * from './TagLabelValueSelector'
3
+ export * from './ResizableTagTextArea'
@@ -2,6 +2,7 @@ import React, { Component } from 'react'
2
2
  import EmptyState from './EmptyState/EmptyState'
3
3
  import notAuthorized from '../Assets/Img/ic-not-authorized.svg'
4
4
  import Reload from './Reload'
5
+ import ErrorScreenNotFound from './ErrorScreenNotFound'
5
6
 
6
7
  export class ErrorScreenManager extends Component<{
7
8
  code?: number
@@ -21,7 +22,7 @@ export class ErrorScreenManager extends Component<{
21
22
  <ErrorScreenNotAuthorized subtitle={this.props.subtitle} subtitleClass={this.props.subtitleClass} />
22
23
  )
23
24
  case 404:
24
- return 'Not Found'
25
+ return <ErrorScreenNotFound />
25
26
  case 500:
26
27
  return 'Internal Server Error'
27
28
  case 502:
@@ -0,0 +1,38 @@
1
+ import React from 'react'
2
+ import notFound from '../Assets/Img/ic-empty-error@2x.png'
3
+ import { useHistory } from 'react-router'
4
+ import EmptyState from './EmptyState/EmptyState'
5
+ import { ERROR_EMPTY_SCREEN } from './Constants'
6
+
7
+ function ErrorScreenNotFound() {
8
+ const history = useHistory()
9
+
10
+ const redirectToHome = () => {
11
+ history.push('/app/list')
12
+ }
13
+
14
+ return (
15
+ <div>
16
+ <EmptyState>
17
+ <EmptyState.Image>
18
+ <img src={notFound} alt="Not Found" />
19
+ </EmptyState.Image>
20
+ <EmptyState.Title>
21
+ <h3 className="title">{ERROR_EMPTY_SCREEN.PAGE_NOT_FOUND}</h3>
22
+ </EmptyState.Title>
23
+ <EmptyState.Subtitle >
24
+ <p>{ERROR_EMPTY_SCREEN.PAGE_NOT_EXIST}</p>
25
+ </EmptyState.Subtitle>
26
+ <EmptyState.Button>
27
+ <button className="flex cta h-32"
28
+ onClick={redirectToHome}
29
+ >
30
+ {ERROR_EMPTY_SCREEN.TAKE_BACK_HOME}
31
+ </button>
32
+ </EmptyState.Button>
33
+ </EmptyState>
34
+ </div>
35
+ )
36
+ }
37
+
38
+ export default ErrorScreenNotFound
@@ -78,12 +78,12 @@ export const MultiValueRemove = (props) => {
78
78
  )
79
79
  }
80
80
 
81
- export const MultiValueChipContainer = ({ validator, isAllSelected = false, ...props }) => {
81
+ export const MultiValueChipContainer = ({ validator, isAllSelected = false, ...props }) => {
82
82
  const { children, data, innerProps, selectProps } = props
83
83
  const { label, value } = data
84
84
  const isValidEmail = validator ? validator(value) : true
85
85
 
86
- if(isAllSelected && value !== '*') return null
86
+ if (isAllSelected && value !== '*') return null
87
87
 
88
88
  return (
89
89
  <components.MultiValueContainer {...{ data, innerProps, selectProps }}>
@@ -97,33 +97,31 @@ export const MultiValueChipContainer = ({ validator, isAllSelected = false, ...
97
97
  }
98
98
 
99
99
  export const multiSelectStyles = {
100
- control: (base, state) => ({
101
- ...base,
102
- cursor: state.isDisabled ? 'not-allowed' : 'normal',
103
- border: state.isFocused ? '1px solid #06c' : '1px solid #d6dbdf',
104
- boxShadow: 'none',
105
- minheight: '24px !important'
106
- }),
107
- menu: (base, state) => ({
108
- ...base,
109
- top: `40px`,
110
- }),
111
- option: (base, state) => {
112
- return ({
113
- ...base,
114
- backgroundColor: state.isFocused ? 'var(--N100)' : 'white',
115
- color: 'var(--N900)',
116
- padding: '8px 12px',
117
- })
118
- },
119
- container: (base, state) => ({
120
- ...base,
121
- cursor: state.isDisabled ? 'not-allowed' : 'normal'
122
- }),
123
- valueContainer: (base, state) => ({
124
- ...base,
125
- color: state.selectProps.menuIsOpen ? 'var(--N500)' : base.color,
126
- }),
100
+ control: (base, state) => ({
101
+ ...base,
102
+ cursor: state.isDisabled ? 'not-allowed' : 'normal',
103
+ border: state.isFocused ? '1px solid #06c' : '1px solid #d6dbdf',
104
+ boxShadow: 'none',
105
+ }),
106
+ menu: (base, state) => ({
107
+ ...base,
108
+ }),
109
+ option: (base, state) => {
110
+ return {
111
+ ...base,
112
+ backgroundColor: state.isFocused ? 'var(--N100)' : 'white',
113
+ color: 'var(--N900)',
114
+ padding: '8px 12px',
115
+ }
116
+ },
117
+ container: (base, state) => ({
118
+ ...base,
119
+ cursor: state.isDisabled ? 'not-allowed' : 'pointer',
120
+ }),
121
+ valueContainer: (base, state) => ({
122
+ ...base,
123
+ color: state.selectProps.menuIsOpen ? 'var(--N500)' : base.color,
124
+ }),
127
125
  }
128
126
 
129
127
  interface CustomSelect {
@@ -1,8 +1,8 @@
1
- import React, { Component, createContext } from 'react';
2
- const RadioGroupContext = createContext({ name: '', value: '', disabled: false, onChange: (event) => {} });
1
+ import React, { Component, createContext } from 'react'
2
+ const RadioGroupContext = createContext({ name: '', value: '', disabled: false, onChange: (event) => {} })
3
3
 
4
4
  export interface RadioGroupItemProps {
5
- value: string;
5
+ value: string
6
6
  }
7
7
 
8
8
  export class RadioGroupItem extends Component<RadioGroupItemProps> {
@@ -28,19 +28,19 @@ export class RadioGroupItem extends Component<RadioGroupItemProps> {
28
28
  </span>
29
29
  </label>
30
30
  </>
31
- );
31
+ )
32
32
  }}
33
33
  </RadioGroupContext.Consumer>
34
- );
34
+ )
35
35
  }
36
36
  }
37
37
 
38
38
  export interface RadioGroupProps {
39
- value: string;
40
- name: string;
41
- disabled?: boolean;
42
- onChange: (event) => void;
43
- className?: string;
39
+ value: string
40
+ name: string
41
+ disabled?: boolean
42
+ onChange: (event) => void
43
+ className?: string
44
44
  }
45
45
 
46
46
  export class RadioGroup extends Component<RadioGroupProps> {
@@ -58,6 +58,6 @@ export class RadioGroup extends Component<RadioGroupProps> {
58
58
  {this.props.children}
59
59
  </RadioGroupContext.Provider>
60
60
  </div>
61
- );
61
+ )
62
62
  }
63
63
  }
@@ -79,7 +79,7 @@ export function TippyCustomized(props: TippyCustomizedProps) {
79
79
  <>
80
80
  <div
81
81
  className={`dc__word-break dc__hyphens-auto flex left ${
82
- isWhiteTheme ? 'p-12 dc__border-bottom-n1 cn-9' : 'pt-20 pb-12 pr-20 pl-20 cn-0'
82
+ isWhiteTheme ? 'p-12 dc__border-bottom-n1 cn-9' : 'pt-20 pb-12 pr-20 pl-20 cn-0 top'
83
83
  }`}
84
84
  >
85
85
  {iconPath ? (
@@ -1,5 +1,6 @@
1
1
  import React from 'react'
2
2
  import { toast } from 'react-toastify'
3
+ import { TOAST_ACCESS_DENIED } from './Constants'
3
4
 
4
5
  export class ToastBody extends React.Component<{
5
6
  title: string
@@ -51,14 +52,11 @@ export class ToastBodyWithButton extends React.Component<{
51
52
  }
52
53
  }
53
54
 
54
- export const toastAccessDenied = (subtitle?: string) => {
55
+ export const toastAccessDenied = (title?: string, subtitle?: string) => {
55
56
  return toast.info(
56
- <ToastBody
57
- title="Access denied"
58
- subtitle={subtitle || "You do not have required access to perform this action"}
59
- />,
57
+ <ToastBody title={title || TOAST_ACCESS_DENIED.TITLE} subtitle={subtitle || TOAST_ACCESS_DENIED.SUBTITLE} />,
60
58
  {
61
59
  className: 'devtron-toast unauthorized',
62
60
  },
63
61
  )
64
- }
62
+ }
@@ -24,67 +24,68 @@ export enum TippyTheme {
24
24
  }
25
25
 
26
26
  export interface TagType {
27
- key: string
28
- value?: string
29
- description?: string
30
- propagate: boolean
31
- mandatoryProjectIdsCsv?: string[]
32
- isInvalidKey?: boolean
33
- isInvalidValue?: boolean
27
+ id?: number
28
+ key: string
29
+ value?: string
30
+ description?: string
31
+ propagate: boolean
32
+ mandatoryProjectIdsCsv?: string
33
+ isInvalidKey?: boolean
34
+ isInvalidValue?: boolean
34
35
  }
35
36
 
36
37
  export interface TagErrorType {
37
- isValid: boolean
38
- messages: string[]
38
+ isValid: boolean
39
+ messages: string[]
39
40
  }
40
41
  export interface TagLabelSelectType {
41
- isCreateApp?: boolean
42
- labelTags: TagType[]
43
- setLabelTags: (tagList: TagType[]) => void
44
- tabIndex?: number
42
+ isCreateApp?: boolean
43
+ labelTags: TagType[]
44
+ setLabelTags: (tagList: TagType[]) => void
45
+ tabIndex?: number
45
46
  }
46
47
 
47
48
  export interface TagDetailType {
48
- index: number
49
- tagData: TagType
50
- setTagData: (index: number, tagData: TagType) => void
51
- removeTag: (index: number) => void
52
- tabIndex?: number
49
+ index: number
50
+ tagData: TagType
51
+ setTagData: (index: number, tagData: TagType) => void
52
+ removeTag: (index: number) => void
53
+ tabIndex?: number
53
54
  }
54
55
 
55
56
  export interface TagLabelValueSelectorType {
56
- selectedTagIndex: number
57
- tagData: TagType
58
- setTagData: (index: number, tagData: TagType) => void
59
- tagOptions?: OptionType[]
60
- isRequired?: boolean
61
- tagInputType?: KEY_VALUE
62
- placeholder?: string
63
- tabIndex?: number
64
- refVar?: React.MutableRefObject<HTMLTextAreaElement>
65
- dependentRef?: React.MutableRefObject<HTMLTextAreaElement>
57
+ selectedTagIndex: number
58
+ tagData: TagType
59
+ setTagData: (index: number, tagData: TagType) => void
60
+ tagOptions?: OptionType[]
61
+ isRequired?: boolean
62
+ tagInputType?: KEY_VALUE
63
+ placeholder?: string
64
+ tabIndex?: number
65
+ refVar?: React.MutableRefObject<HTMLTextAreaElement>
66
+ dependentRef?: React.MutableRefObject<HTMLTextAreaElement>
66
67
  }
67
68
 
68
69
  export interface ResizableTagTextAreaProps {
69
- className?: string
70
- minHeight?: number
71
- maxHeight?: number
72
- value?: string
73
- onChange?: (e) => void
74
- onBlur?: (e) => void
75
- onFocus?: (e) => void
76
- placeholder?: string
77
- tabIndex?: number
78
- refVar?: React.MutableRefObject<HTMLTextAreaElement>
79
- dependentRef?: React.MutableRefObject<HTMLTextAreaElement>
70
+ className?: string
71
+ minHeight?: number
72
+ maxHeight?: number
73
+ value?: string
74
+ onChange?: (e) => void
75
+ onBlur?: (e) => void
76
+ onFocus?: (e) => void
77
+ placeholder?: string
78
+ tabIndex?: number
79
+ refVar?: React.MutableRefObject<HTMLTextAreaElement>
80
+ dependentRef?: React.MutableRefObject<HTMLTextAreaElement>
80
81
  }
81
82
 
82
83
  export interface TeamList extends ResponseType {
83
- result: Teams[];
84
+ result: Teams[]
84
85
  }
85
86
 
86
87
  export interface Teams {
87
- id: number;
88
- name: string;
89
- active: boolean;
90
- }
88
+ id: number
89
+ name: string
90
+ active: boolean
91
+ }
@@ -21,6 +21,7 @@ export * from './TippyCustomized'
21
21
  export * from './CustomTagSelector'
22
22
  export * from './Dialogs'
23
23
  export * from './MultiSelectCustomization'
24
- export {default as InfoColourBar} from './InfoColorBar/InfoColourbar'
24
+ export { default as InfoColourBar } from './InfoColorBar/InfoColourbar'
25
25
  export * from './Common.service'
26
- export * from './Checkbox'
26
+ export * from './Checkbox'
27
+ export { default as EmptyState } from './EmptyState/EmptyState'