@devtron-labs/devtron-fe-common-lib 0.0.45-beta-1 → 0.0.45-beta-5
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/dist/Common/Helper.d.ts +17 -2
- package/dist/Common/Types.d.ts +1 -18
- package/dist/index.js +3 -3
- package/package.json +1 -1
- package/src/Common/Helper.tsx +5 -14
- package/src/Common/Types.ts +1 -19
package/dist/Common/Helper.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Sentry from '@sentry/browser';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { AsyncOptions,
|
|
3
|
+
import { AsyncOptions, UseSearchString } from './Types';
|
|
4
4
|
export declare function showError(serverError: any, showToastOnUnknownError?: boolean, hideAccessError?: boolean): void;
|
|
5
5
|
interface ConditionalWrapper<T> {
|
|
6
6
|
condition: boolean;
|
|
@@ -25,7 +25,22 @@ export declare function useForm(stateSchema: any, validationSchema: {}, callback
|
|
|
25
25
|
handleOnChange: (event: any) => void;
|
|
26
26
|
handleOnSubmit: (event: any) => void;
|
|
27
27
|
};
|
|
28
|
-
export declare function CustomInput({ name, value, error, onChange, onBlur, onFocus, label, type, disabled, labelClassName, placeholder, tabIndex, dataTestid,
|
|
28
|
+
export declare function CustomInput({ name, value, error, onChange, onBlur, onFocus, label, type, disabled, autoComplete, labelClassName, placeholder, tabIndex, dataTestid, }: {
|
|
29
|
+
name: any;
|
|
30
|
+
value: any;
|
|
31
|
+
error: any;
|
|
32
|
+
onChange: any;
|
|
33
|
+
onBlur?: (e: any) => void;
|
|
34
|
+
onFocus?: (e: any) => void;
|
|
35
|
+
label: any;
|
|
36
|
+
type?: string;
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
autoComplete?: string;
|
|
39
|
+
labelClassName?: string;
|
|
40
|
+
placeholder?: string;
|
|
41
|
+
tabIndex?: number;
|
|
42
|
+
dataTestid?: string;
|
|
43
|
+
}): JSX.Element;
|
|
29
44
|
export declare function handleUTCTime(ts: string, isRelativeTime?: boolean): string;
|
|
30
45
|
export declare function useSearchString(): UseSearchString;
|
|
31
46
|
export declare const closeOnEscKeyPressed: (e: any, actionClose: () => void) => void;
|
package/dist/Common/Types.d.ts
CHANGED
|
@@ -322,6 +322,7 @@ export interface CommonNodeAttr {
|
|
|
322
322
|
};
|
|
323
323
|
appReleaseTagNames?: string[];
|
|
324
324
|
tagsEditable?: boolean;
|
|
325
|
+
isGitOpsRepoNotConfigured?: boolean;
|
|
325
326
|
}
|
|
326
327
|
export declare enum DeploymentAppTypes {
|
|
327
328
|
HELM = "helm",
|
|
@@ -563,22 +564,4 @@ export interface CiPipeline {
|
|
|
563
564
|
isOffendingMandatoryPlugin?: boolean;
|
|
564
565
|
pipelineType?: string;
|
|
565
566
|
}
|
|
566
|
-
export interface CustomInputProps {
|
|
567
|
-
name: string;
|
|
568
|
-
value: string;
|
|
569
|
-
error?: React.ReactNode;
|
|
570
|
-
onChange: (e: any) => void;
|
|
571
|
-
onBlur?: (e: any) => void;
|
|
572
|
-
onFocus?: (e: any) => void;
|
|
573
|
-
label?: React.ReactNode;
|
|
574
|
-
type?: string;
|
|
575
|
-
disabled?: boolean;
|
|
576
|
-
labelClassName?: string;
|
|
577
|
-
placeholder?: string;
|
|
578
|
-
tabIndex?: number;
|
|
579
|
-
dataTestid?: string;
|
|
580
|
-
isRequiredField?: boolean;
|
|
581
|
-
autoFocus?: boolean;
|
|
582
|
-
rootClassName?: string;
|
|
583
|
-
}
|
|
584
567
|
export {};
|
package/dist/index.js
CHANGED
|
@@ -10096,11 +10096,11 @@ function handleError(error) {
|
|
|
10096
10096
|
return error;
|
|
10097
10097
|
}
|
|
10098
10098
|
function CustomInput(_a) {
|
|
10099
|
-
var name = _a.name, value = _a.value, error = _a.error, onChange = _a.onChange, _b = _a.onBlur, onBlur = _b === void 0 ? function (e) { } : _b, _c = _a.onFocus, onFocus = _c === void 0 ? function (e) { } : _c, label = _a.label, _d = _a.type, type = _d === void 0 ? 'text' : _d, _e = _a.disabled, disabled = _e === void 0 ? false : _e
|
|
10100
|
-
return (jsxRuntime.jsxs("div", __assign({ className: "flex column left top" }, { children: [
|
|
10099
|
+
var name = _a.name, value = _a.value, error = _a.error, onChange = _a.onChange, _b = _a.onBlur, onBlur = _b === void 0 ? function (e) { } : _b, _c = _a.onFocus, onFocus = _c === void 0 ? function (e) { } : _c, label = _a.label, _d = _a.type, type = _d === void 0 ? 'text' : _d, _e = _a.disabled, disabled = _e === void 0 ? false : _e; _a.autoComplete; var _g = _a.labelClassName, labelClassName = _g === void 0 ? '' : _g, _h = _a.placeholder, placeholder = _h === void 0 ? '' : _h, _j = _a.tabIndex, tabIndex = _j === void 0 ? 1 : _j, _k = _a.dataTestid, dataTestid = _k === void 0 ? '' : _k;
|
|
10100
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "flex column left top" }, { children: [jsxRuntime.jsx("label", __assign({ className: "form__label ".concat(labelClassName) }, { children: label })), jsxRuntime.jsx("input", { "data-testid": dataTestid, type: type, name: name, autoComplete: "off", className: "form__input", onChange: function (e) {
|
|
10101
10101
|
e.persist();
|
|
10102
10102
|
onChange(e);
|
|
10103
|
-
}, onBlur: onBlur, onFocus: onFocus, placeholder: placeholder, value: value, disabled: disabled, tabIndex: tabIndex
|
|
10103
|
+
}, onBlur: onBlur, onFocus: onFocus, placeholder: placeholder, value: value, disabled: disabled, tabIndex: tabIndex }), handleError(error).map(function (err) { return (jsxRuntime.jsxs("div", __assign({ className: "form__error" }, { children: [jsxRuntime.jsx(SvgIcWarning, { className: "form__icon form__icon--error" }), err] }), err)); })] })));
|
|
10104
10104
|
}
|
|
10105
10105
|
function handleUTCTime(ts, isRelativeTime) {
|
|
10106
10106
|
if (isRelativeTime === void 0) { isRelativeTime = false; }
|
package/package.json
CHANGED
package/src/Common/Helper.tsx
CHANGED
|
@@ -7,7 +7,7 @@ import { ReactComponent as FormError } from '../Assets/Icon/ic-warning.svg'
|
|
|
7
7
|
import { ERROR_EMPTY_SCREEN, TOKEN_COOKIE_NAME } from './Constants'
|
|
8
8
|
import { ServerErrors } from './ServerError'
|
|
9
9
|
import { toastAccessDenied } from './ToastBody'
|
|
10
|
-
import { AsyncOptions, AsyncState,
|
|
10
|
+
import { AsyncOptions, AsyncState, UseSearchString } from './Types'
|
|
11
11
|
|
|
12
12
|
toast.configure({
|
|
13
13
|
autoClose: 3000,
|
|
@@ -299,29 +299,21 @@ export function CustomInput({
|
|
|
299
299
|
label,
|
|
300
300
|
type = 'text',
|
|
301
301
|
disabled = false,
|
|
302
|
+
autoComplete = 'off',
|
|
302
303
|
labelClassName = '',
|
|
303
304
|
placeholder = '',
|
|
304
305
|
tabIndex = 1,
|
|
305
306
|
dataTestid = '',
|
|
306
|
-
|
|
307
|
-
autoFocus = true,
|
|
308
|
-
rootClassName = '',
|
|
309
|
-
}: CustomInputProps) {
|
|
307
|
+
}) {
|
|
310
308
|
return (
|
|
311
309
|
<div className="flex column left top">
|
|
312
|
-
|
|
313
|
-
<label className={`form__label ${labelClassName} ${isRequiredField ? 'dc__required-field' : ''}`}>
|
|
314
|
-
{label}
|
|
315
|
-
</label>
|
|
316
|
-
) : (
|
|
317
|
-
''
|
|
318
|
-
)}
|
|
310
|
+
<label className={`form__label ${labelClassName}`}>{label}</label>
|
|
319
311
|
<input
|
|
320
312
|
data-testid={dataTestid}
|
|
321
313
|
type={type}
|
|
322
314
|
name={name}
|
|
323
315
|
autoComplete="off"
|
|
324
|
-
className=
|
|
316
|
+
className="form__input"
|
|
325
317
|
onChange={(e) => {
|
|
326
318
|
e.persist()
|
|
327
319
|
onChange(e)
|
|
@@ -332,7 +324,6 @@ export function CustomInput({
|
|
|
332
324
|
value={value}
|
|
333
325
|
disabled={disabled}
|
|
334
326
|
tabIndex={tabIndex}
|
|
335
|
-
autoFocus={autoFocus}
|
|
336
327
|
/>
|
|
337
328
|
{handleError(error).map((err) => (
|
|
338
329
|
<div className="form__error" key={err}>
|
package/src/Common/Types.ts
CHANGED
|
@@ -354,6 +354,7 @@ export interface CommonNodeAttr {
|
|
|
354
354
|
}
|
|
355
355
|
appReleaseTagNames?: string[]
|
|
356
356
|
tagsEditable?: boolean
|
|
357
|
+
isGitOpsRepoNotConfigured?: boolean
|
|
357
358
|
}
|
|
358
359
|
|
|
359
360
|
export enum DeploymentAppTypes {
|
|
@@ -623,22 +624,3 @@ export interface CiPipeline {
|
|
|
623
624
|
isOffendingMandatoryPlugin?: boolean
|
|
624
625
|
pipelineType?: string
|
|
625
626
|
}
|
|
626
|
-
|
|
627
|
-
export interface CustomInputProps {
|
|
628
|
-
name: string
|
|
629
|
-
value: string
|
|
630
|
-
error?: React.ReactNode
|
|
631
|
-
onChange: (e: any) => void
|
|
632
|
-
onBlur?: (e: any) => void
|
|
633
|
-
onFocus?: (e: any) => void
|
|
634
|
-
label?: React.ReactNode
|
|
635
|
-
type?: string
|
|
636
|
-
disabled?: boolean
|
|
637
|
-
labelClassName?: string
|
|
638
|
-
placeholder?: string
|
|
639
|
-
tabIndex?: number
|
|
640
|
-
dataTestid?: string
|
|
641
|
-
isRequiredField?: boolean
|
|
642
|
-
autoFocus?: boolean
|
|
643
|
-
rootClassName?: string
|
|
644
|
-
}
|