@devtron-labs/devtron-fe-common-lib 0.0.10-beta-18 → 0.0.10-beta-19
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/index.js +19 -20
- package/package.json +1 -1
- package/src/Common/ImageTags.tsx +18 -25
package/dist/index.js
CHANGED
|
@@ -22788,7 +22788,7 @@ var ImageTagsContainer = function (_a) {
|
|
|
22788
22788
|
lowercaseValue[0] == '.' ||
|
|
22789
22789
|
lowercaseValue[0] == '-') {
|
|
22790
22790
|
setTagErrorMessage('tag name cannot be empty or exceed 128 characters or cannot start with . or -');
|
|
22791
|
-
return;
|
|
22791
|
+
return false;
|
|
22792
22792
|
}
|
|
22793
22793
|
setTagErrorMessage('');
|
|
22794
22794
|
var isTagExistsInExistingTags = existingTags.includes(lowercaseValue);
|
|
@@ -22799,24 +22799,26 @@ var ImageTagsContainer = function (_a) {
|
|
|
22799
22799
|
}
|
|
22800
22800
|
if (isTagExistsInExistingTags || isTagExistsInDisplayedTags || lowercaseValue === 'latest') {
|
|
22801
22801
|
setTagErrorMessage('This tag is already being used in this application');
|
|
22802
|
-
return;
|
|
22802
|
+
return false;
|
|
22803
22803
|
}
|
|
22804
|
+
return true;
|
|
22804
22805
|
};
|
|
22805
22806
|
var handleTagCreate = function (newValue) {
|
|
22806
22807
|
var lowercaseValue = newValue.toLowerCase().trim();
|
|
22807
|
-
validateTag(lowercaseValue)
|
|
22808
|
-
|
|
22809
|
-
|
|
22810
|
-
|
|
22811
|
-
|
|
22812
|
-
|
|
22813
|
-
|
|
22814
|
-
|
|
22815
|
-
|
|
22816
|
-
|
|
22817
|
-
|
|
22818
|
-
|
|
22819
|
-
|
|
22808
|
+
if (validateTag(lowercaseValue)) {
|
|
22809
|
+
var newTag = {
|
|
22810
|
+
id: 0,
|
|
22811
|
+
tagName: lowercaseValue,
|
|
22812
|
+
appId: 0,
|
|
22813
|
+
deleted: false,
|
|
22814
|
+
artifactId: 0,
|
|
22815
|
+
duplicateTag: false,
|
|
22816
|
+
};
|
|
22817
|
+
setCreateTags(__spreadArray(__spreadArray([], __read(createTags), false), [newTag], false));
|
|
22818
|
+
setDisplayedTags(__spreadArray(__spreadArray([], __read(displayedTags), false), [newTag], false));
|
|
22819
|
+
setShowTagsWarning(true);
|
|
22820
|
+
setTextInput('');
|
|
22821
|
+
}
|
|
22820
22822
|
};
|
|
22821
22823
|
var handleTagSoftDelete = function (index) {
|
|
22822
22824
|
var updatedTags = __spreadArray([], __read(displayedTags), false);
|
|
@@ -22916,13 +22918,10 @@ var ImageTagsContainer = function (_a) {
|
|
|
22916
22918
|
updateCurrentAppMaterial(artifactId, tags, (_j = res.result) === null || _j === void 0 ? void 0 : _j.imageComment);
|
|
22917
22919
|
})
|
|
22918
22920
|
.catch(function (err) {
|
|
22919
|
-
var _a, _b, _c, _d, _e, _f
|
|
22921
|
+
var _a, _b, _c, _d, _e, _f;
|
|
22920
22922
|
// Fix toast message
|
|
22921
22923
|
if ((_d = (_c = (_b = (_a = err.errors) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.userMessage) === null || _c === void 0 ? void 0 : _c.appReleaseTags) === null || _d === void 0 ? void 0 : _d.length) {
|
|
22922
|
-
|
|
22923
|
-
__assign(__assign({}, (_e = err.errors) === null || _e === void 0 ? void 0 : _e[0]), { userMessage: (_g = (_f = err.errors) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.internalMessage }),
|
|
22924
|
-
] });
|
|
22925
|
-
toast.error(customError);
|
|
22924
|
+
toast.error((_f = (_e = err.errors) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.internalMessage);
|
|
22926
22925
|
errorStateHandling(err.errors);
|
|
22927
22926
|
}
|
|
22928
22927
|
else {
|
package/package.json
CHANGED
package/src/Common/ImageTags.tsx
CHANGED
|
@@ -115,7 +115,7 @@ export const ImageTagsContainer = ({
|
|
|
115
115
|
setTagErrorMessage('')
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
const validateTag = (lowercaseValue) => {
|
|
118
|
+
const validateTag = (lowercaseValue) : boolean => {
|
|
119
119
|
if (
|
|
120
120
|
lowercaseValue.length == 0 ||
|
|
121
121
|
lowercaseValue.length >= 128 ||
|
|
@@ -123,7 +123,7 @@ export const ImageTagsContainer = ({
|
|
|
123
123
|
lowercaseValue[0] == '-'
|
|
124
124
|
) {
|
|
125
125
|
setTagErrorMessage('tag name cannot be empty or exceed 128 characters or cannot start with . or -')
|
|
126
|
-
return
|
|
126
|
+
return false
|
|
127
127
|
}
|
|
128
128
|
setTagErrorMessage('')
|
|
129
129
|
const isTagExistsInExistingTags = existingTags.includes(lowercaseValue)
|
|
@@ -133,25 +133,27 @@ export const ImageTagsContainer = ({
|
|
|
133
133
|
}
|
|
134
134
|
if (isTagExistsInExistingTags || isTagExistsInDisplayedTags || lowercaseValue === 'latest') {
|
|
135
135
|
setTagErrorMessage('This tag is already being used in this application')
|
|
136
|
-
return
|
|
136
|
+
return false
|
|
137
137
|
}
|
|
138
|
+
return true
|
|
138
139
|
}
|
|
139
140
|
|
|
140
141
|
const handleTagCreate = (newValue) => {
|
|
141
142
|
const lowercaseValue = newValue.toLowerCase().trim()
|
|
142
|
-
validateTag(lowercaseValue)
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
143
|
+
if(validateTag(lowercaseValue)) {
|
|
144
|
+
const newTag: ReleaseTag = {
|
|
145
|
+
id: 0,
|
|
146
|
+
tagName: lowercaseValue,
|
|
147
|
+
appId: 0,
|
|
148
|
+
deleted: false,
|
|
149
|
+
artifactId: 0,
|
|
150
|
+
duplicateTag: false,
|
|
151
|
+
}
|
|
152
|
+
setCreateTags([...createTags, newTag])
|
|
153
|
+
setDisplayedTags([...displayedTags, newTag])
|
|
154
|
+
setShowTagsWarning(true)
|
|
155
|
+
setTextInput('')
|
|
150
156
|
}
|
|
151
|
-
setCreateTags([...createTags, newTag])
|
|
152
|
-
setDisplayedTags([...displayedTags, newTag])
|
|
153
|
-
setShowTagsWarning(true)
|
|
154
|
-
setTextInput('')
|
|
155
157
|
}
|
|
156
158
|
|
|
157
159
|
const handleTagSoftDelete = (index) => {
|
|
@@ -259,16 +261,7 @@ export const ImageTagsContainer = ({
|
|
|
259
261
|
.catch((err) => {
|
|
260
262
|
// Fix toast message
|
|
261
263
|
if (err.errors?.[0]?.userMessage?.appReleaseTags?.length) {
|
|
262
|
-
|
|
263
|
-
...err,
|
|
264
|
-
errors: [
|
|
265
|
-
{
|
|
266
|
-
...err.errors?.[0],
|
|
267
|
-
userMessage: err.errors?.[0]?.internalMessage,
|
|
268
|
-
},
|
|
269
|
-
],
|
|
270
|
-
}
|
|
271
|
-
toast.error(customError)
|
|
264
|
+
toast.error(err.errors?.[0]?.internalMessage)
|
|
272
265
|
errorStateHandling(err.errors)
|
|
273
266
|
} else {
|
|
274
267
|
showError(err)
|