Repository: etendosoftware/com.etendoerp.subapp.docsmanager
Pull request #7: Feature ETP-501: Handle goBack dynamically based on file count
Author: login: tomirodeghiero
Created: 2025-03-05T17:35:07Z | Merged: 2025-03-06T15:06:33Z



Diff:
diff --git a/subapp/package.json b/subapp/package.json
index cdc01ea..b3e6891 100644
--- a/subapp/package.json
+++ b/subapp/package.json
@@ -18,7 +18,7 @@
     "@react-navigation/native-stack": "^6.9.13",
     "@react-navigation/stack": "^6.3.17",
     "@types/date-fns": "^2.6.0",
-    "etendo-ui-library": "1.5.4",
+    "etendo-ui-library": "1.8.0",
     "i18n-js": "^3.5.1",
     "i18next": "^23.5.1",
     "react": "18.1.0",
diff --git a/subapp/src/screens/home/index.tsx b/subapp/src/screens/home/index.tsx
index f760649..e372fff 100644
--- a/subapp/src/screens/home/index.tsx
+++ b/subapp/src/screens/home/index.tsx
@@ -10,7 +10,6 @@ import {
 import Pdf from 'react-native-pdf';
 import Sound from 'react-native-sound';
 import RNFS from 'react-native-fs';
-
 import { styles } from './styles';
 import { cleanFileName } from '../../utils';
 import { HomeProps, IFile } from '../../interfaces';
@@ -22,16 +21,14 @@ const Home: React.FC<HomeProps> = ({ navigationContainer, sharedFiles }) => {
   const [textContent, setTextContent] = useState<string>('');
   const [selectedFile, setSelectedFile] = useState<IFile | null>(null);
 
+  // Set initial selected file based on sharedFiles
   useEffect(() => {
     if (sharedFiles && sharedFiles.length > 0) {
-      if (sharedFiles.length === 1) {
-        setSelectedFile(sharedFiles[0]);
-      } else {
-        setSelectedFile(null);
-      }
+      setSelectedFile(sharedFiles.length === 1 ? sharedFiles[0] : null);
     }
   }, [sharedFiles]);
 
+  // Handle file content loading and cleanup
   useEffect(() => {
     let sound: Sound | null = null;
 
@@ -62,9 +59,7 @@ const Home: React.FC<HomeProps> = ({ navigationContainer, sharedFiles }) => {
     }
 
     return () => {
-      if (sound) {
-        sound.release();
-      }
+      if (sound) sound.release();
     };
   }, [selectedFile]);
 
@@ -75,10 +70,8 @@ const Home: React.FC<HomeProps> = ({ navigationContainer, sharedFiles }) => {
         setIsPlaying(false);
       } else {
         audioPlayer.play(success => {
-          if (!success) {
-            console.error('Error in playback');
-          }
           setIsPlaying(false);
+          if (!success) console.error('Error in playback');
         });
         setIsPlaying(true);
       }
@@ -96,9 +89,7 @@ const Home: React.FC<HomeProps> = ({ navigationContainer, sharedFiles }) => {
           <Pdf
             source={{ uri: file.filePath }}
             style={styles.pdf}
-            onError={error => {
-              console.error(error);
-            }}
+            onError={error => console.error(error)}
           />
         );
       case file.fileMimeType.startsWith('image/'):
@@ -128,23 +119,26 @@ const Home: React.FC<HomeProps> = ({ navigationContainer, sharedFiles }) => {
       default:
         return (
           <View style={styles.unsupportedContainer}>
-            <Text style={styles.unsupportedText}>
-              File type not supported.
-            </Text>
+            <Text style={styles.unsupportedText}>File type not supported.</Text>
           </View>
         );
     }
   };
 
   const renderFileItem = ({ item }: { item: IFile }) => (
-    <TouchableOpacity
-      style={styles.fileItem}
-      onPress={() => handleFileSelect(item)}
-    >
+    <TouchableOpacity style={styles.fileItem} onPress={() => handleFileSelect(item)}>
       <Text style={styles.fileItemText}>{item.fileName}</Text>
     </TouchableOpacity>
   );
 
+  const handleGoBack = () => {
+    if (selectedFile && sharedFiles?.length > 1) {
+      setSelectedFile(null);
+    } else {
+      navigationContainer.goBack();
+    }
+  };
+
   return (
     <View style={styles.container}>
       {/* Header */}
@@ -153,7 +147,7 @@ const Home: React.FC<HomeProps> = ({ navigationContainer, sharedFiles }) => {
         <Button
           typeStyle='terciary'
           text='Go back'
-          onPress={() => { setSelectedFile(null); navigationContainer.navigate('Home'); }}
+          onPress={handleGoBack}
           iconLeft={<ArrowLeftIcon />}
         />
       </View>
@@ -167,7 +161,7 @@ const Home: React.FC<HomeProps> = ({ navigationContainer, sharedFiles }) => {
         ) : sharedFiles.length > 1 ? (
           <FlatList
             data={sharedFiles}
-            keyExtractor={(item, index) => index.toString()}
+            keyExtractor={(_, index) => index.toString()}
             renderItem={renderFileItem}
             contentContainerStyle={{ paddingBottom: 16 }}
           />
diff --git a/web/com.etendoerp.subapp.docsmanager/dist.js b/web/com.etendoerp.subapp.docsmanager/dist.js
index 4e406f5..ed0ebd4 100644
--- a/web/com.etendoerp.subapp.docsmanager/dist.js
+++ b/web/com.etendoerp.subapp.docsmanager/dist.js
@@ -55,8 +55,8 @@ function __awaiter(thisArg, _arguments, P, generator) {
 }
 
 function __generator(thisArg, body) {
-    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
-    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
+    return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
     function verb(n) { return function (v) { return step([n, v]); }; }
     function step(op) {
         if (f) throw new TypeError("Generator is already executing.");
@@ -309,16 +309,13 @@ var Home = function (_a) {
     var _c = React.useState(false), isPlaying = _c[0], setIsPlaying = _c[1];
     var _d = React.useState(''), textContent = _d[0], setTextContent = _d[1];
     var _e = React.useState(null), selectedFile = _e[0], setSelectedFile = _e[1];
+    // Set initial selected file based on sharedFiles
     React.useEffect(function () {
         if (sharedFiles && sharedFiles.length > 0) {
-            if (sharedFiles.length === 1) {
-                setSelectedFile(sharedFiles[0]);
-            }
-            else {
-                setSelectedFile(null);
-            }
+            setSelectedFile(sharedFiles.length === 1 ? sharedFiles[0] : null);
         }
     }, [sharedFiles]);
+    // Handle file content loading and cleanup
     React.useEffect(function () {
         var sound = null;
         setAudioPlayer(null);
@@ -357,9 +354,8 @@ var Home = function (_a) {
             }
         }
         return function () {
-            if (sound) {
+            if (sound)
                 sound.release();
-            }
         };
     }, [selectedFile]);
     var toggleAudioPlayback = React.useCallback(function () {
@@ -370,10 +366,9 @@ var Home = function (_a) {
             }
             else {
                 audioPlayer.play(function (success) {
-                    if (!success) {
-                        console.error('Error in playback');
-                    }
                     setIsPlaying(false);
+                    if (!success)
+                        console.error('Error in playback');
                 });
                 setIsPlaying(true);
             }
@@ -385,9 +380,7 @@ var Home = function (_a) {
     var renderFileContent = function (file) {
         switch (true) {
             case file.fileMimeType === 'application/pdf':
-                return (React__default["default"].createElement(Pdf__default["default"], { source: { uri: file.filePath }, style: styles.pdf, onError: function (error) {
-                        console.error(error);
-                    } }));
+                return (React__default["default"].createElement(Pdf__default["default"], { source: { uri: file.filePath }, style: styles.pdf, onError: function (error) { return console.error(error); } }));
             case file.fileMimeType.startsWith('image/'):
                 return (React__default["default"].createElement(reactNative.Image, { source: { uri: file.filePath }, style: styles.image, resizeMode: "contain" }));
             case file.fileMimeType.startsWith('audio/'):
@@ -406,13 +399,21 @@ var Home = function (_a) {
         return (React__default["default"].createElement(reactNative.TouchableOpacity, { style: styles.fileItem, onPress: function () { return handleFileSelect(item); } },
             React__default["default"].createElement(reactNative.Text, { style: styles.fileItemText }, item.fileName)));
     };
+    var handleGoBack = function () {
+        if (selectedFile && (sharedFiles === null || sharedFiles === void 0 ? void 0 : sharedFiles.length) > 1) {
+            setSelectedFile(null);
+        }
+        else {
+            navigationContainer.goBack();
+        }
+    };
     return (React__default["default"].createElement(reactNative.View, { style: styles.container },
         React__default["default"].createElement(reactNative.View, { style: styles.header },
             React__default["default"].createElement(reactNative.Text, { style: styles.headerTitle }, "Shared Files"),
-            React__default["default"].createElement(etendoUiLibrary.Button, { typeStyle: 'terciary', text: 'Go back', onPress: function () { setSelectedFile(null); navigationContainer.navigate('Home'); }, iconLeft: React__default["default"].createElement(etendoUiLibrary.ArrowLeftIcon, null) })),
+            React__default["default"].createElement(etendoUiLibrary.Button, { typeStyle: 'terciary', text: 'Go back', onPress: handleGoBack, iconLeft: React__default["default"].createElement(etendoUiLibrary.ArrowLeftIcon, null) })),
         sharedFiles && sharedFiles.length > 0 ? (selectedFile && sharedFiles.length > 1 ? (React__default["default"].createElement(reactNative.View, { style: styles.fileContainer },
             React__default["default"].createElement(reactNative.Text, { style: styles.fileName }, selectedFile.fileName),
-            renderFileContent(selectedFile))) : sharedFiles.length > 1 ? (React__default["default"].createElement(reactNative.FlatList, { data: sharedFiles, keyExtractor: function (item, index) { return index.toString(); }, renderItem: renderFileItem, contentContainerStyle: { paddingBottom: 16 } })) : (React__default["default"].createElement(reactNative.View, { style: styles.fileContainer },
+            renderFileContent(selectedFile))) : sharedFiles.length > 1 ? (React__default["default"].createElement(reactNative.FlatList, { data: sharedFiles, keyExtractor: function (_, index) { return index.toString(); }, renderItem: renderFileItem, contentContainerStyle: { paddingBottom: 16 } })) : (React__default["default"].createElement(reactNative.View, { style: styles.fileContainer },
             React__default["default"].createElement(reactNative.Text, { style: styles.fileName }, cleanFileName(sharedFiles[0].fileName)),
             renderFileContent(sharedFiles[0])))) : (React__default["default"].createElement(reactNative.View, { style: styles.noFileContainer },
             React__default["default"].createElement(reactNative.Text, { style: styles.noFileText }, "No files uploaded.")))));
@@ -433,4 +434,4 @@ var App = function (_a) {
 
 exports.App = App;
 exports["default"] = App;
-//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGlzdC5qcyIsInNvdXJjZXMiOlsiLi4vLi4vc3ViYXBwL25vZGVfbW9kdWxlcy90c2xpYi90c2xpYi5lczYuanMiLCIuLi8uLi9zcmMvbG9jYWxpemF0aW9uL2xvY2FsZS50cyIsIi4uLy4uL3NyYy9zdHlsZXMvY29sb3JzLnRzIiwiLi4vLi4vc3JjL3NjcmVlbnMvaG9tZS9zdHlsZXMudHMiLCIuLi8uLi9zcmMvdXRpbHMvaW5kZXgudHMiLCIuLi8uLi9zcmMvc2NyZWVucy9ob21lL2luZGV4LnRzeCIsIi4uLy4uL0FwcC50c3giXSwic291cmNlc0NvbnRlbnQiOlsiLyoqK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sIGFyID0gW10sIGU7XHJcbiAgICB0cnkge1xyXG4gICAgICAgIHdoaWxlICgobiA9PT0gdm9pZCAwIHx8IG4tLSA+IDApICYmICEociA9IGkubmV4dCgpKS5kb25lKSBhci5wdXNoKHIudmFsdWUpO1xyXG4gICAgfVxyXG4gICAgY2F0Y2ggKGVycm9yKSB7IGUgPSB7IGVycm9yOiBlcnJvciB9OyB9XHJcbiAgICBmaW5hbGx5IHtcclxuICAgICAgICB0cnkge1xyXG4gICAgICAgICAgICBpZiAociAmJiAhci5kb25lICYmIChtID0gaVtcInJldHVyblwiXSkpIG0uY2FsbChpKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZmluYWxseSB7IGlmIChlKSB0aHJvdyBlLmVycm9yOyB9XHJcbiAgICB9XHJcbiAgICByZXR1cm4gYXI7XHJcbn1cclxuXHJcbi8qKiBAZGVwcmVjYXRlZCAqL1xyXG5leHBvcnQgZnVuY3Rpb24gX19zcHJlYWQoKSB7XHJcbiAgICBmb3IgKHZhciBhciA9IFtdLCBpID0gMDsgaSA8IGFyZ3VtZW50cy5sZW5ndGg7IGkrKylcclxuICAgICAgICBhciA9IGFyLmNvbmNhdChfX3JlYWQoYXJndW1lbnRzW2ldKSk7XHJcbiAgICByZXR1cm4gYXI7XHJcbn1cclxuXHJcbi8qKiBAZGVwcmVjYXRlZCAqL1xyXG5leHBvcnQgZnVuY3Rpb24gX19zcHJlYWRBcnJheXMoKSB7XHJcbiAgICBmb3IgKHZhciBzID0gMCwgaSA9IDAsIGlsID0gYXJndW1lbnRzLmxlbmd0aDsgaSA8IGlsOyBpKyspIHMgKz0gYXJndW1lbnRzW2ldLmxlbmd0aDtcclxuICAgIGZvciAodmFyIHIgPSBBcnJheShzKSwgayA9IDAsIGkgPSAwOyBpIDwgaWw7IGkrKylcclxuICAgICAgICBmb3IgKHZhciBhID0gYXJndW1lbnRzW2ldLCBqID0gMCwgamwgPSBhLmxlbmd0aDsgaiA8IGpsOyBqKyssIGsrKylcclxuICA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Y2U9e3sgdXJpOiBmaWxlLmZpbGVQYXRoIH19XG4gICAgICAgICAgICBzdHlsZT17c3R5bGVzLnBkZn1cbiAgICAgICAgICAgIG9uRXJyb3I9e2Vycm9yID0+IHtcbiAgICAgICAgICAgICAgY29uc29sZS5lcnJvcihlcnJvcik7XG4gICAgICAgICAgICB9fVxuICAgICAgICAgIC8+XG4gICAgICAgICk7XG4gICAgICBjYXNlIGZpbGUuZmlsZU1pbWVUeXBlLnN0YXJ0c1dpdGgoJ2ltYWdlLycpOlxuICAgICAgICByZXR1cm4gKFxuICAgICAgICAgIDxJbWFnZVxuICAgICAgICAgICAgc291cmNlPXt7IHVyaTogZmlsZS5maWxlUGF0aCB9fVxuICAgICAgICAgICAgc3R5bGU9e3N0eWxlcy5pbWFnZX1cbiAgICAgICAgICAgIHJlc2l6ZU1vZGU9XCJjb250YWluXCJcbiAgICAgICAgICAvPlxuICAgICAgICApO1xuICAgICAgY2FzZSBmaWxlLmZpbGVNaW1lVHlwZS5zdGFydHNXaXRoKCdhdWRpby8nKTpcbiAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICA8VmlldyBzdHlsZT17c3R5bGVzLmF1ZGlvQ29udGFpbmVyfT5cbiAgICAgICAgICAgIDxCdXR0b25cbiAgICAgICAgICAgICAgdHlwZVN0eWxlPSd0ZXJjaWFyeSdcbiAgICAgICAgICAgICAgdGV4dD17aXNQbGF5aW5nID8gJ1BhdXNlIEF1ZGlvJyA6ICdQbGF5IEF1ZGlvJ31cbiAgICAgICAgICAgICAgb25QcmVzcz17dG9nZ2xlQXVkaW9QbGF5YmFja31cbiAgICAgICAgICAgIC8+XG4gICAgICAgICAgPC9WaWV3PlxuICAgICAgICApO1xuICAgICAgY2FzZSBmaWxlLmZpbGVNaW1lVHlwZS5zdGFydHNXaXRoKCd0ZXh0LycpOlxuICAgICAgICByZXR1cm4gKFxuICAgICAgICAgIDxTY3JvbGxWaWV3IHN0eWxlPXtzdHlsZXMudGV4dENvbnRhaW5lcn0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Y3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwocywgcCkpIHRbcF0gPSBzW3BdO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gdDtcclxuICAgIH1cclxuICAgIHJldHVybiBfX2Fzc2lnbi5hcHBseSh0aGlzLCBhcmd1bWVudHMpO1xyXG59XHJcblxyXG5leHBvcnQgZnVuY3Rpb24gX19yZXN0KHMsIGUpIHtcclxuICAgIHZhciB0ID0ge307XHJcbiAgICBmb3IgKHZhciBwIGluIHMpIGlmIChPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwocywgcCkgJiYgZS5pbmRleE9mKHApIDwgMClcclxuICAgICAgICB0W3BdID0gc1twXTtcclxuICAgIGlmIChzICE9IG51bGwgJiYgdHlwZW9mIE9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMgPT09IFwiZnVuY3Rpb25cIilcclxuICAgICAgICBmb3IgKHZhciBpID0gMCwgcCA9IE9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMocyk7IGkgPCBwLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgIGlmIChlLmluZGV4T2YocFtpXSkgPCAwICYmIE9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChzLCBwW2ldKSlcclxuICAgICAgICAgICAgICAgIHRbcFtpXV0gPSBzW3BbaV1dO1xyXG4gICAgICAgIH1cclxuICAgIHJldHVybiB0O1xyXG59XHJcblxyXG5leHBvcnQgZnVuY3Rpb24gX19kZWNvcmF0ZShkZWNvcmF0b3JzLCB0YXJnZXQsIGtleSwgZGVzYykge1xyXG4gICAgdmFyIGMgPSBhcmd1bWVudHMubGVuZ3RoLCByID0gYyA8IDMgPyB0YXJnZXQgOiBkZXNjID09PSBudWxsID8gZGVzYyA9IE9iamVjdC5nZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IodGFyZ2V0LCBrZXkpIDogZGVzYywgZDt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ob3BbMF0pIHtcclxuICAgICAgICAgICAgICAgIGNhc2UgMDogY2FzZSAxOiB0ID0gb3A7IGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgY2FzZSA0OiBfLmxhYmVsKys7IHJldHVybiB7IHZhbHVlOiBvcFsxXSwgZG9uZTogZmFsc2UgfTtcclxuICAgICAgICAgICAgICAgIGNhc2UgNTogXy5sYWJlbCsrOyB5ID0gb3BbMV07IG9wID0gWzBdOyBjb250aW51ZTtcclxuICAgICAgICAgICAgICAgIGNhc2UgNzogb3AgPSBfLm9wcy5wb3AoKTsgXy50cnlzLnBvcCgpOyBjb250aW51ZTtcclxuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCEodCA9IF8udHJ5cywgdCA9IHQubGVuZ3RoID4gMCAmJiB0W3QubGVuZ3RoIC0gMV0pICYmIChvcFswXSA9PT0gNiB8fCBvcFswXSA9PT0gMikpIHsgXyA9IDA7IGNvbnRpbnVlOyB9XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG9wWzBdID09PSAzICYmICghdCB8fCAob3BbMV0gPiB0WzBdICYmIG9wWzFdIDwgdFszXSkpKSB7IF8ubGFiZWwgPSBvcFsxXTsgYnJlYWs7IH1cclxuICAgICAgICAgICAgICAgICAgICBpZiAob3BbMF0gPT09IDYgJiYgXy5sYWJlbCA8IHRbMV0pIHsgXy5sYWJlbCA9IHRbMV07IHQgPSBvcDsgYnJlYWs7IH1cclxuICAgICAgICAgICAgICAgICAgICBpZiAodCAmJiBfLmxhYmVsIDwgdFsyXSkgeyBfLmxhYmVsID0gdFsyXTsgXy5vcHMucHVzaChvcCk7IGJyZWFrOyB9XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRbMl0pIF8ub3BzLnBvcCgpO1xyXG4gICAgICAgICAgICAgICAgICAgIF8udHJ5cy5wb3AoKTsgY29udGludWU7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgb3AgP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cclxuICAgIGZpbmFsbHkge1xyXG4gICAgICAgIHRyeSB7XHJcbiAgICAgICAgICAgIGlmIChyICYmICFyLmRvbmUgJiYgKG0gPSBpW1wicmV0dXJuXCJdKSkgbS5jYWxsKGkpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBmaW5hbGx5IHsgaWYgKGUpIHRocm93IGUuZXJyb3I7IH1cclxuICAgIH1cclxuICAgIHJldHVybiBhcjtcclxufVxyXG5cclxuLyoqIEBkZXByZWNhdGVkICovXHJcbmV4cG9ydCBmdW5jdGlvbiBfX3NwcmVhZCgpIHtcclxuICAgIGZvciAodmFyIGFyID0gW10sIGkgPSAwOyBpIDwgYXJndW1lbnRzLmxlbmd0aDsgaSsrKVxyXG4gICAgICAgIGFyID0gYXIuY29uY2F0KF9fcmVhZChhcmd1bWVudHNbaV0pKTtcclxuICAgIHJldHVybiBhcjtcclxufVxyXG5cclxuLyoqIEBkZXByZWNhdGVkICovXHJcbmV4cG9ydCBmdW5jdGlvbiBfX3NwcmVhZEFycmF5cygpIHtcclxuICAgIGZvciAodmFyIHMgPSAwLCBpID0gMCwgaWwgPSBhcmd1bWVudHMubGVuZ3RoOyBpIDwgaWw7IGkrKykgcyArPSBhcmd1bWVudHNbaV0ubGVuZ3RoO1xyXG4gICAgZm9yICh2YXIgciA9IEFycmF5KHMpLCBrID0gMCwgaSA9IDA7IGkgPCBpbDsgaSsrKVxyXG4gICAgICAgIGZvciAodmFyIGEgPSBhcmd1bWVudHNbaV0sIGogPSAwLCBqbCA9IGEubGVuZ3RoOyBqIDwgamw7IGorKywgaysrKVxyXG4gICAgICAgICAgICByW2tdID0gYVtqXTtcclxuICAgIHJldHVybiByO1xyXG59XHJcblxyXG5leHBvcnQgZnVuY3Rpb24gX19zcHJlYWRBcnJheSh0bywgZnJvbSwgcGFjaykge1xyXG4gICAgaWYgKHBhY2sgfHwgYXJndW1lbnRzLmxlbmd0aCA9PT0gMikgZm9yICh2YXIgaSA9IDAsIGwgPSBmcm9tLm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ydCBmdW5jdGlvbiBfX2Rpc3Bvc2VSZXNvdXJjZXMoZW52KSB7XHJcbiAgICBmdW5jdGlvbiBmYWlsKGUpIHtcclxuICAgICAgICBlbnYuZXJyb3IgPSBlbnYuaGFzRXJyb3IgPyBuZXcgX1N1cHByZXNzZWRFcnJvcihlLCBlbnYuZXJyb3IsIFwiQW4gZXJyb3Igd2FzIHN1cHByZXNzZWQgZHVyaW5nIGRpc3Bvc2FsLlwiKSA6IGU7XHJcbiAgICAgICAgZW52Lmhhc0Vycm9yID0gdHJ1ZTtcclxuICAgIH1cclxuICAgIHZhciByLCBzID0gMDtcclxuICAgIGZ1bmN0aW9uIG5leHQoKSB7XHJcbiAgICAgICAgd2hpbGUgKHIgPSBlbnYuc3RhY2sucG9wKCkpIHtcclxuICAgICAgICAgICAgdHJ5IHtcclxuICAgICAgICAgICAgICAgIGlmICghci5hc3luYyAmJiBzID09PSAxKSByZXR1cm4gcyA9IDAsIGVudi5zdGFjay5wdXNoKHIpLCBQcm9taXNlLnJlc29sdmUoKS50aGVuKG5leHQpO1xyXG4gICAgICAgICAgICAgICAgaWYgKHIuZGlzcG9zZSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHZhciByZXN1bHQgPSByLmRpc3Bvc2UuY2FsbChyLnZhbHVlKTtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoci5hc3luYykgcmV0dXJuIHMgfD0gMiwgUHJvbWlzZS5yZXNvbHZlKHJlc3VsdCkudGhlbihuZXh0LCBmdW5jdGlvbihlKSB7IGZhaWwoZSk7IHJldHVybiBuZXh0KCk7IH0pO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSBzIHw9IDE7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgY2F0Y2ggKGUpIHtcclxuICAgICAgICAgICAgICAgIGZhaWwoZSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKHMgPT09IDEpIH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FBRSxLQUFLLEVBQUUsRUFBQSxFQUN0RCxVQUFBLEtBQUssRUFBQSxFQUFJLFFBQ1JBLHlCQUFBLENBQUEsYUFBQSxDQUFDLElBQUksRUFDQyxRQUFBLENBQUEsRUFBQSxFQUFBLEtBQUssSUFDVCxtQkFBbUIsRUFBRSxtQkFBbUIsRUFDeEMsUUFBUSxFQUFFLFFBQVEsRUFDbEIsV0FBVyxFQUFFLFdBQVcsSUFDeEIsRUFDSCxFQUFBLENBQ1ksQ0FDQyxFQUNsQjtBQUNKOzs7OzsifQ==


Reviews:
user: login: etendobot
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-05T17:35:56Z
user: login: etendobot
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-06T12:26:34Z
user: login: etendobot
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-06T12:27:01Z
user: login: etendobot
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-06T14:24:46Z
user: login: etendobot
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-06T14:25:04Z
user: login: Sankku
state: APPROVED
author_association: NONE
submitted_at: 2025-03-06T15:00:05Z
user: login: etendobot
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-06T15:02:09Z
user: login: etendobot
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-06T15:02:50Z
user: login: isaiasb-etendo
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-06T15:05:42Z

Review comments:
path: subapp/src/screens/home/index.tsx
user: login: etendobot
body: # GPT Review for index.tsx
### Review

- **Estimated effort to review [1-5]:**  
2, because the changes are mostly refactoring for code readability and minor logic improvements. The PR is not large, and the changes are straightforward, focusing on code cleanup and minor enhancements.
- **Score:**  92

### Code feedback

- **File:** 
subapp/src/screens/home/index.tsx
- **Language:** 
typescript
- **Suggestion:** 
Consider using `useCallback` for the `handleGoBack` function to prevent unnecessary re-creations of the function on each render. This can improve performance, especially if the component re-renders frequently. [medium]
- **Label:** 
performance
- **Existing code:**


```typescript
const handleGoBack = () => {
    if (selectedFile && sharedFiles?.length > 1) {
      setSelectedFile(null);
    } else {
      navigationContainer.goBack();
    }
  };
```

- **Improved code:**


```typescript
const handleGoBack = useCallback(() => {
    if (selectedFile && sharedFiles?.length > 1) {
      setSelectedFile(null);
    } else {
      navigationContainer.goBack();
    }
  }, [selectedFile, sharedFiles, navigationContainer]);
```

- **File:** 
subapp/src/screens/home/index.tsx
- **Language:** 
typescript
- **Suggestion:** 
When using `keyExtractor` in `FlatList`, consider using a unique identifier from the `item` itself, such as `item.id`, instead of the index. This can help prevent potential issues with list reordering and improve performance. [important]
- **Label:** 
best practice
- **Existing code:**


```typescript
keyExtractor={(_, index) => index.toString()}
```

- **Improved code:**


```typescript
keyExtractor={(item) => item.id.toString()}
```

(Note: Ensure that `item.id` is a unique identifier available in the `IFile` interface. If not, consider adding one or using another unique property.)
created_at: 2025-03-05T17:35:56Z
author_association: CONTRIBUTOR
path: subapp/src/screens/home/index.tsx
user: login: etendobot
body: # GPT Review for index.tsx
### Review

- **Estimated effort to review [1-5]:**  
2, because the changes are mostly refactoring and code cleanup, which are straightforward to review. The logic remains largely unchanged, and the modifications improve readability and maintainability.
- **Score:**  92

### Code feedback

- **File:** 
subapp/src/screens/home/index.tsx
- **Language:** 
typescript
- **Suggestion:** 
Consider using `useCallback` for the `handleGoBack` function to prevent unnecessary re-creations of the function on each render. This can improve performance, especially if the component re-renders frequently. [medium]
- **Label:** 
performance
- **Existing code:**


```typescript
const handleGoBack = () => {
    if (selectedFile && sharedFiles?.length > 1) {
      setSelectedFile(null);
    } else {
      navigationContainer.goBack();
    }
  };
```

- **Improved code:**


```typescript
const handleGoBack = useCallback(() => {
    if (selectedFile && sharedFiles?.length > 1) {
      setSelectedFile(null);
    } else {
      navigationContainer.goBack();
    }
  }, [selectedFile, sharedFiles, navigationContainer]);
```

- **File:** 
subapp/src/screens/home/index.tsx
- **Language:** 
typescript
- **Suggestion:** 
When using `keyExtractor` in `FlatList`, consider using a unique identifier from the `item` itself, if available, instead of the index. This can help prevent potential issues with list reordering or updates. [medium]
- **Label:** 
best practice
- **Existing code:**


```typescript
keyExtractor={(_, index) => index.toString()}
```

- **Improved code:**


```typescript
keyExtractor={(item) => item.id.toString()}
```

(Note: Replace `item.id` with the actual unique identifier property of `IFile` if available.)
created_at: 2025-03-06T12:26:34Z
author_association: CONTRIBUTOR
path: web/com.etendoerp.subapp.docsmanager/dist.js
user: login: etendobot
body: # GPT Review for dist.js
### Review

- **Estimated effort to review [1-5]:**  
2, because the changes are mostly refactoring and code cleanup, which are straightforward to review. The logic remains largely unchanged, and the modifications are easy to follow.
- **Score:**  92
### Code feedback

- **File:** 
web/com.etendoerp.subapp.docsmanager/dist.js
- **Language:** 
javascript
- **Suggestion:** 
Consider using `const` instead of `let` for variables that are not reassigned. This can help prevent accidental reassignments and improve code readability. [medium]
- **Label:** 
best practice
- **Existing code:**

```javascript
let sound = null;
```
- **Improved code:**

```javascript
const sound = null;
```

- **File:** 
web/com.etendoerp.subapp.docsmanager/dist.js
- **Language:** 
javascript
- **Suggestion:** 
Use optional chaining (`?.`) to simplify the check for `sharedFiles` length. This can make the code more concise and readable. [medium]
- **Label:** 
enhancement
- **Existing code:**

```javascript
if (sharedFiles && sharedFiles.length > 0) {
    setSelectedFile(sharedFiles.length === 1 ? sharedFiles[0] : null);
}
```
- **Improved code:**

```javascript
if (sharedFiles?.length > 0) {
    setSelectedFile(sharedFiles.length === 1 ? sharedFiles[0] : null);
}
```

- **File:** 
web/com.etendoerp.subapp.docsmanager/dist.js
- **Language:** 
javascript
- **Suggestion:** 
Use arrow functions for consistency and to avoid potential issues with `this` binding in JavaScript. [medium]
- **Label:** 
best practice
- **Existing code:**

```javascript
function handleGoBack() {
    if (selectedFile && (sharedFiles === null || sharedFiles === void 0 ? void 0 : sharedFiles.length) > 1) {
        setSelectedFile(null);
    } else {
        navigationContainer.goBack();
    }
}
```
- **Improved code:**

```javascript
const handleGoBack = () => {
    if (selectedFile && sharedFiles?.length > 1) {
        setSelectedFile(null);
    } else {
        navigationContainer.goBack();
    }
};
```
created_at: 2025-03-06T12:27:01Z
author_association: CONTRIBUTOR
path: subapp/src/screens/home/index.tsx
user: login: etendobot
body: # GPT Review for index.tsx
### Review

- **Estimated effort to review [1-5]:**  
2, because the changes are mostly refactoring for code clarity and minor logic adjustments. The PR is relatively small and straightforward, focusing on improving code readability and maintainability.
- **Score:**  92

### Code feedback

- **File:** 
subapp/src/screens/home/index.tsx
- **Language:** 
typescript
- **Suggestion:** 
Consider using `useCallback` for the `handleGoBack` function to prevent unnecessary re-creations of the function on each render. This can improve performance, especially if the component re-renders frequently. [medium]
- **Label:** 
performance
- **Existing code:**


```typescript
const handleGoBack = () => {
    if (selectedFile && sharedFiles?.length > 1) {
      setSelectedFile(null);
    } else {
      navigationContainer.goBack();
    }
  };
```

- **Improved code:**


```typescript
const handleGoBack = useCallback(() => {
    if (selectedFile && sharedFiles?.length > 1) {
      setSelectedFile(null);
    } else {
      navigationContainer.goBack();
    }
  }, [selectedFile, sharedFiles, navigationContainer]);
```

- **File:** 
subapp/src/screens/home/index.tsx
- **Language:** 
typescript
- **Suggestion:** 
When using `keyExtractor` in `FlatList`, consider using a unique identifier from the `item` itself, such as `item.id`, if available, instead of the index. This can help prevent potential issues with list reordering and improve performance. [medium]
- **Label:** 
best practice
- **Existing code:**


```typescript
keyExtractor={(_, index) => index.toString()}
```

- **Improved code:**


```typescript
keyExtractor={(item) => item.id.toString()}
```
created_at: 2025-03-06T14:24:46Z
author_association: CONTRIBUTOR
path: web/com.etendoerp.subapp.docsmanager/dist.js
user: login: etendobot
body: # GPT Review for dist.js
### Review

- **Estimated effort to review [1-5]:**  
2, because the changes are mostly refactoring and code cleanup, which simplifies the logic and improves readability. The changes are straightforward and do not introduce complex logic or new features.
- **Score:**  92
### Code feedback

- **File:** 
web/com.etendoerp.subapp.docsmanager/dist.js
- **Language:** 
javascript
- **Suggestion:** 
Consider using `const` instead of `let` for variables that are not reassigned. This can help prevent accidental reassignments and improve code readability. [medium]
- **Label:** 
best practice
- **Existing code:**

```javascript
let sound = null;
```
- **Improved code:**

```javascript
const sound = null;
```

- **File:** 
web/com.etendoerp.subapp.docsmanager/dist.js
- **Language:** 
javascript
- **Suggestion:** 
Consider using optional chaining (`?.`) to simplify the code and handle potential `null` or `undefined` values more gracefully. This can make the code more concise and reduce the need for explicit null checks. [medium]
- **Label:** 
enhancement
- **Existing code:**

```javascript
if (selectedFile && (sharedFiles === null || sharedFiles === void 0 ? void 0 : sharedFiles.length) > 1) {
    setSelectedFile(null);
}
```
- **Improved code:**

```javascript
if (selectedFile && sharedFiles?.length > 1) {
    setSelectedFile(null);
}
```
created_at: 2025-03-06T14:25:04Z
author_association: CONTRIBUTOR
path: subapp/src/screens/home/index.tsx
user: login: etendobot
body: # GPT Review for index.tsx
### Review

- **Estimated effort to review [1-5]:**  
2, because the changes are mostly refactoring for code clarity and minor logic adjustments. The PR is relatively small and straightforward, focusing on improving code readability and maintainability.
- **Score:**  92

### Code feedback

- **File:** 
subapp/src/screens/home/index.tsx
- **Language:** 
typescript
- **Suggestion:** 
Consider using `useCallback` for the `handleGoBack` function to prevent unnecessary re-creations of the function on each render. This can improve performance, especially if the component re-renders frequently. [medium]
- **Label:** 
performance
- **Existing code:**


```typescript
const handleGoBack = () => {
    if (selectedFile && sharedFiles?.length > 1) {
      setSelectedFile(null);
    } else {
      navigationContainer.goBack();
    }
  };
```

- **Improved code:**


```typescript
const handleGoBack = useCallback(() => {
    if (selectedFile && sharedFiles?.length > 1) {
      setSelectedFile(null);
    } else {
      navigationContainer.goBack();
    }
  }, [selectedFile, sharedFiles, navigationContainer]);
```

- **File:** 
subapp/src/screens/home/index.tsx
- **Language:** 
typescript
- **Suggestion:** 
When using `keyExtractor` in `FlatList`, consider using a unique identifier from the `item` itself, if available, instead of the index. This can help prevent potential issues with list reordering or updates. [medium]
- **Label:** 
best practice
- **Existing code:**


```typescript
keyExtractor={(_, index) => index.toString()}
```

- **Improved code:**


```typescript
keyExtractor={(item) => item.id.toString()}
```

(Note: Replace `item.id` with the actual unique identifier property of `IFile` if available.)
created_at: 2025-03-06T15:02:09Z
author_association: CONTRIBUTOR
path: web/com.etendoerp.subapp.docsmanager/dist.js
user: login: etendobot
body: # GPT Review for dist.js
### Review

- **Estimated effort to review [1-5]:**  
2, because the changes are mostly refactoring and code cleanup, which simplifies the logic and improves readability. The changes are straightforward and do not introduce complex logic or new features.
- **Score:**  92
### Code feedback

- **File:** 
web/com.etendoerp.subapp.docsmanager/dist.js
- **Language:** 
javascript
- **Suggestion:** 
Consider using `const` instead of `let` for variables that are not reassigned, such as `sound` in the `useEffect` hook. This can help prevent accidental reassignments and improve code readability. [medium]
- **Label:** 
best practice
- **Existing code:**

```javascript
let sound = null;
```
- **Improved code:**

```javascript
const sound = null;
```

- **File:** 
web/com.etendoerp.subapp.docsmanager/dist.js
- **Language:** 
javascript
- **Suggestion:** 
In the `handleGoBack` function, consider using optional chaining (`?.`) to simplify the check for `sharedFiles` length. This can make the code more concise and easier to read. [medium]
- **Label:** 
enhancement
- **Existing code:**

```javascript
if (selectedFile && (sharedFiles === null || sharedFiles === void 0 ? void 0 : sharedFiles.length) > 1) {
    setSelectedFile(null);
}
```
- **Improved code:**

```javascript
if (selectedFile && sharedFiles?.length > 1) {
    setSelectedFile(null);
}
```

- **File:** 
web/com.etendoerp.subapp.docsmanager/dist.js
- **Language:** 
javascript
- **Suggestion:** 
In the `renderFileContent` function, consider using a `switch` statement instead of multiple `if` conditions for checking `fileMimeType`. This can improve readability and make it easier to add more cases in the future. [medium]
- **Label:** 
maintainability
- **Existing code:**

```javascript
switch (true) {
    case file.fileMimeType === 'application/pdf':
        return (React__default["default"].createElement(Pdf__default["default"], { source: { uri: file.filePath }, style: styles.pdf, onError: function (error) { return console.error(error); } }));
    case file.fileMimeType.startsWith('image/'):
        return (React__default["default"].createElement(reactNative.Image, { source: { uri: file.filePath }, style: styles.image, resizeMode: "contain" }));
    case file.fileMimeType.startsWith('audio/'):
        return (React__default["default"].createElement(reactNative.View, { style: styles.audioContainer },
            React__default["default"].createElement(etendoUiLibrary.Button, { typeStyle: 'terciary', text: isPlaying ? 'Pause Audio' : 'Play Audio', onPress: toggleAudioPlayback })));
    case file.fileMimeType.startsWith('text/'):
        return (React__default["default"].createElement(reactNative.ScrollView, { style: styles.textContainer },
            React__default["default"].createElement(reactNative.Text, { style: styles.textContent }, textContent)));
    default:
        return (React__default["default"].createElement(reactNative.View, { style: styles.unsupportedContainer },
            React__default["default"].createElement(reactNative.Text, { style: styles.unsupportedText }, "File type not supported.")));
}
```
- **Improved code:**

```javascript
switch (file.fileMimeType) {
    case 'application/pdf':
        return (React__default["default"].createElement(Pdf__default["default"], { source: { uri: file.filePath }, style: styles.pdf, onError: function (error) { return console.error(error); } }));
    case file.fileMimeType.startsWith('image/'):
        return (React__default["default"].createElement(reactNative.Image, { source: { uri: file.filePath }, style: styles.image, resizeMode: "contain" }));
    case file.fileMimeType.startsWith('audio/'):
        return (React__default["default"].createElement(reactNative.View, { style: styles.audioContainer },
            React__default["default"].createElement(etendoUiLibrary.Button, { typeStyle: 'terciary', text: isPlaying ? 'Pause Audio' : 'Play Audio', onPress: toggleAudioPlayback })));
    case file.fileMimeType.startsWith('text/'):
        return (React__default["default"].createElement(reactNative.ScrollView, { style: styles.textContainer },
            React__default["default"].createElement(reactNative.Text, { style: styles.textContent }, textContent)));
    default:
        return (React__default["default"].createElement(reactNative.View, { style: styles.unsupportedContainer },
            React__default["default"].createElement(reactNative.Text, { style: styles.unsupportedText }, "File type not supported.")));
}
```
created_at: 2025-03-06T15:02:50Z
author_association: CONTRIBUTOR

PR comments:
user: login: sonarscanetendo[bot]
created_at: 2025-03-05T17:36:00Z
body: ![Passed](https://sonar.etendo.cloud/static/communityBranchPlugin/checks/QualityGateBadge/passed.svg?sanitize=true)

# Analysis Details
## 2 Issues
- ![Bug](https://sonar.etendo.cloud/static/communityBranchPlugin/common/bug.svg?sanitize=true) 0 Bugs
- ![Vulnerability](https://sonar.etendo.cloud/static/communityBranchPlugin/common/vulnerability.svg?sanitize=true) 0 Vulnerabilities
- ![Code Smell](https://sonar.etendo.cloud/static/communityBranchPlugin/common/code_smell.svg?sanitize=true) 2 Code Smells

## Coverage and Duplications
- ![Coverage](https://sonar.etendo.cloud/static/communityBranchPlugin/checks/CoverageChart/0.svg?sanitize=true) 0.00% Coverage (0.00% Estimated after merge)
- ![Duplications](https://sonar.etendo.cloud/static/communityBranchPlugin/checks/Duplications/3.svg?sanitize=true) 0.00% Duplicated Code (0.00% Estimated after merge)

**Project ID:** etendosoftware_com.etendoerp.subapp.docsmanager_AZPQxdBDz8j2KgSjshp0

[View in SonarQube](https://sonar.etendo.cloud/dashboard?id=etendosoftware_com.etendoerp.subapp.docsmanager_AZPQxdBDz8j2KgSjshp0&pullRequest=7)


author_association: NONE
user: login: sonarscanetendo[bot]
created_at: 2025-03-06T12:26:35Z
body: ![Passed](https://sonar.etendo.cloud/static/communityBranchPlugin/checks/QualityGateBadge/passed.svg?sanitize=true)

# Analysis Details
## 2 Issues
- ![Bug](https://sonar.etendo.cloud/static/communityBranchPlugin/common/bug.svg?sanitize=true) 0 Bugs
- ![Vulnerability](https://sonar.etendo.cloud/static/communityBranchPlugin/common/vulnerability.svg?sanitize=true) 0 Vulnerabilities
- ![Code Smell](https://sonar.etendo.cloud/static/communityBranchPlugin/common/code_smell.svg?sanitize=true) 2 Code Smells

## Coverage and Duplications
- ![Coverage](https://sonar.etendo.cloud/static/communityBranchPlugin/checks/CoverageChart/0.svg?sanitize=true) 0.00% Coverage (0.00% Estimated after merge)
- ![Duplications](https://sonar.etendo.cloud/static/communityBranchPlugin/checks/Duplications/3.svg?sanitize=true) 0.00% Duplicated Code (0.00% Estimated after merge)

**Project ID:** etendosoftware_com.etendoerp.subapp.docsmanager_AZPQxdBDz8j2KgSjshp0

[View in SonarQube](https://sonar.etendo.cloud/dashboard?id=etendosoftware_com.etendoerp.subapp.docsmanager_AZPQxdBDz8j2KgSjshp0&pullRequest=7)


author_association: NONE
user: login: sonarscanetendo[bot]
created_at: 2025-03-06T14:24:44Z
body: ![Passed](https://sonar.etendo.cloud/static/communityBranchPlugin/checks/QualityGateBadge/passed.svg?sanitize=true)

# Analysis Details
## 2 Issues
- ![Bug](https://sonar.etendo.cloud/static/communityBranchPlugin/common/bug.svg?sanitize=true) 0 Bugs
- ![Vulnerability](https://sonar.etendo.cloud/static/communityBranchPlugin/common/vulnerability.svg?sanitize=true) 0 Vulnerabilities
- ![Code Smell](https://sonar.etendo.cloud/static/communityBranchPlugin/common/code_smell.svg?sanitize=true) 2 Code Smells

## Coverage and Duplications
- ![Coverage](https://sonar.etendo.cloud/static/communityBranchPlugin/checks/CoverageChart/0.svg?sanitize=true) 0.00% Coverage (0.00% Estimated after merge)
- ![Duplications](https://sonar.etendo.cloud/static/communityBranchPlugin/checks/Duplications/3.svg?sanitize=true) 0.00% Duplicated Code (0.00% Estimated after merge)

**Project ID:** etendosoftware_com.etendoerp.subapp.docsmanager_AZPQxdBDz8j2KgSjshp0

[View in SonarQube](https://sonar.etendo.cloud/dashboard?id=etendosoftware_com.etendoerp.subapp.docsmanager_AZPQxdBDz8j2KgSjshp0&pullRequest=7)


author_association: NONE
user: login: sonarscanetendo[bot]
created_at: 2025-03-06T15:02:11Z
body: ![Passed](https://sonar.etendo.cloud/static/communityBranchPlugin/checks/QualityGateBadge/passed.svg?sanitize=true)

# Analysis Details
## 2 Issues
- ![Bug](https://sonar.etendo.cloud/static/communityBranchPlugin/common/bug.svg?sanitize=true) 0 Bugs
- ![Vulnerability](https://sonar.etendo.cloud/static/communityBranchPlugin/common/vulnerability.svg?sanitize=true) 0 Vulnerabilities
- ![Code Smell](https://sonar.etendo.cloud/static/communityBranchPlugin/common/code_smell.svg?sanitize=true) 2 Code Smells

## Coverage and Duplications
- ![Coverage](https://sonar.etendo.cloud/static/communityBranchPlugin/checks/CoverageChart/0.svg?sanitize=true) 0.00% Coverage (0.00% Estimated after merge)
- ![Duplications](https://sonar.etendo.cloud/static/communityBranchPlugin/checks/Duplications/3.svg?sanitize=true) 0.00% Duplicated Code (0.00% Estimated after merge)

**Project ID:** etendosoftware_com.etendoerp.subapp.docsmanager_AZPQxdBDz8j2KgSjshp0

[View in SonarQube](https://sonar.etendo.cloud/dashboard?id=etendosoftware_com.etendoerp.subapp.docsmanager_AZPQxdBDz8j2KgSjshp0&pullRequest=7)


author_association: NONE