mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
realtime
This commit is contained in:
@@ -99,3 +99,5 @@ _src/
|
|||||||
-src
|
-src
|
||||||
plugin copy
|
plugin copy
|
||||||
pm2.yaml
|
pm2.yaml
|
||||||
|
doc/TypeDoc/**
|
||||||
|
doc/TypeDoc
|
||||||
|
|||||||
@@ -11,6 +11,10 @@
|
|||||||
--dark-hl-4: #6A9955;
|
--dark-hl-4: #6A9955;
|
||||||
--light-hl-5: #098658;
|
--light-hl-5: #098658;
|
||||||
--dark-hl-5: #B5CEA8;
|
--dark-hl-5: #B5CEA8;
|
||||||
|
--light-hl-6: #001080;
|
||||||
|
--dark-hl-6: #9CDCFE;
|
||||||
|
--light-hl-7: #AF00DB;
|
||||||
|
--dark-hl-7: #C586C0;
|
||||||
--light-code-background: #FFFFFF;
|
--light-code-background: #FFFFFF;
|
||||||
--dark-code-background: #1E1E1E;
|
--dark-code-background: #1E1E1E;
|
||||||
}
|
}
|
||||||
@@ -22,6 +26,8 @@
|
|||||||
--hl-3: var(--light-hl-3);
|
--hl-3: var(--light-hl-3);
|
||||||
--hl-4: var(--light-hl-4);
|
--hl-4: var(--light-hl-4);
|
||||||
--hl-5: var(--light-hl-5);
|
--hl-5: var(--light-hl-5);
|
||||||
|
--hl-6: var(--light-hl-6);
|
||||||
|
--hl-7: var(--light-hl-7);
|
||||||
--code-background: var(--light-code-background);
|
--code-background: var(--light-code-background);
|
||||||
} }
|
} }
|
||||||
|
|
||||||
@@ -32,6 +38,8 @@
|
|||||||
--hl-3: var(--dark-hl-3);
|
--hl-3: var(--dark-hl-3);
|
||||||
--hl-4: var(--dark-hl-4);
|
--hl-4: var(--dark-hl-4);
|
||||||
--hl-5: var(--dark-hl-5);
|
--hl-5: var(--dark-hl-5);
|
||||||
|
--hl-6: var(--dark-hl-6);
|
||||||
|
--hl-7: var(--dark-hl-7);
|
||||||
--code-background: var(--dark-code-background);
|
--code-background: var(--dark-code-background);
|
||||||
} }
|
} }
|
||||||
|
|
||||||
@@ -42,6 +50,8 @@
|
|||||||
--hl-3: var(--light-hl-3);
|
--hl-3: var(--light-hl-3);
|
||||||
--hl-4: var(--light-hl-4);
|
--hl-4: var(--light-hl-4);
|
||||||
--hl-5: var(--light-hl-5);
|
--hl-5: var(--light-hl-5);
|
||||||
|
--hl-6: var(--light-hl-6);
|
||||||
|
--hl-7: var(--light-hl-7);
|
||||||
--code-background: var(--light-code-background);
|
--code-background: var(--light-code-background);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,6 +62,8 @@
|
|||||||
--hl-3: var(--dark-hl-3);
|
--hl-3: var(--dark-hl-3);
|
||||||
--hl-4: var(--dark-hl-4);
|
--hl-4: var(--dark-hl-4);
|
||||||
--hl-5: var(--dark-hl-5);
|
--hl-5: var(--dark-hl-5);
|
||||||
|
--hl-6: var(--dark-hl-6);
|
||||||
|
--hl-7: var(--dark-hl-7);
|
||||||
--code-background: var(--dark-code-background);
|
--code-background: var(--dark-code-background);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,4 +73,6 @@
|
|||||||
.hl-3 { color: var(--hl-3); }
|
.hl-3 { color: var(--hl-3); }
|
||||||
.hl-4 { color: var(--hl-4); }
|
.hl-4 { color: var(--hl-4); }
|
||||||
.hl-5 { color: var(--hl-5); }
|
.hl-5 { color: var(--hl-5); }
|
||||||
|
.hl-6 { color: var(--hl-6); }
|
||||||
|
.hl-7 { color: var(--hl-7); }
|
||||||
pre, code { background: var(--code-background); }
|
pre, code { background: var(--code-background); }
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAACouuVipJrShRslLyCnbLzEkNyXdKLE41M1HSUSpILMkAiqeV5iWXZObnFeujqtDLKMnNASrLzsxLUbIyM6mNBQDt34KsTAAAAA=="
|
window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAACs1dbW/bOBL+L/m8Tq693d5dv6VJF8ihwQZ2i/uwWBiKzDZCZcmQ6GyDw/7345sskuLLDEkHhwJJY3Ge5+HMiBxRlPz7fy8o+UEv3l803dehuvjpon5q2t1Auov3v5+O1dWeRA5ejmR4bmrCGh0q+sQ+3/e7Y0vGKwG8la2mX6rx5RPdt8zie9PtLt6/dePfCJONDV+31ThG4A1Tk+zN23/+9dOJg1bfyUNT0+NAHqqh2o8zD305RFgWxla3/vavf7z55e1ff2h8GT5bvbHgvbCX44HUKOwttzgz/FK/7pivTUtWh6b+TgZPulW76kDFUScxB9hKgK1q6u+QxhaLhY6r/x+Tyb8yuwdhFsnmGNkCaJnbulP3/SMzuNJ6u5IfYTotLVwfpbngXhgjHBEX4AEPO+dP8mh4hv2NcQtrvvg7zSH/IY8Ib4R4XZguJ+huGMihHxvaDy9XO/KjIfLnav445pS55VaYqp/axxi33HLj9cnW5xE4qQUYzgk2TlX+EUgdjTlENZt/I7q/odVA16Tuh13TfVuT8djSj8PQa8Me6Y77GJUXxhShz4Qb2h9KELtRArwSIXIGePkM63Bw+YQeixlvc85ACfxXi45ig4XkD2tgkA66qp8q6isA2aHVqSjwnRTy95Y3lj9ORQGmFmSGKsjeTIkSLUHCCcNBLiUqoFvyA3Bv7i1cby8U7mwTFr2rqK9gr8aXrvYca5uRXg19LypgV4M9GcfqG/nE2jEp3TeyI5TUtHcUZHoXuJytIN5yiq2g2HrBQO7TrG+Z3bBvOiJhtPL967GradN3eXICVKbUdz+bsyrDneFuM1zlRgL5aTIt4ySPEB9J1D33ZP9IhrGMh5xgYCdJ67KucisKszl85i7VwueoVrytKiYNNjZrXdHKKAWpf8QhUYP3vcSYi7BrhgAaxtM0hfgiF0xhB3qufLMVOy+/jbq0Z0U9vTqy9is2qbOJfCU40JGVQFsOtJVA0wFEPL+wxp+F8fWYEMmoBjd+7EKGM6zG/jgIKe7Tg594K36ixlus2r6u2pWGinC2+CGtthJTDg/6/wW+0RJ3Tk2DyCeOc8tgNgIFHo08kTEBoVW3O2n8uXrUKyC54FZYpk7lXp5zzUqfZIooYc/V0HD74uJMQlPe399aI9OcmQPZ95ScMTUlQYHcXAugcyVnQGZUQmw0USN2ZKJtm+cycZDTw/Sbw2Z4X5WszwUcD9QV4oTNuMKTY/Otq9rhXB5V8P+3ng3pK+DhYvOZJT1zHpP9KjOJQZUFWaElYrFB2FSdPfiq4rfMyAvWFuaNrkKzmdAz1vJDpQZajiV/ZA2xa3HNmz8KAOR4qcJZKpzG5kp+BWMWxmnuklD6QfBC11qGVvE2Hbvk/VrVWdQTrKXhl3eaB/jxRTLSipLCWrw8IXFN19Cmai09wDozKEdHXhSUs4Bqt7s/VTjxFQ4w/Yy7WMswyM2kKMS8TAmDloOuye5Y6zeRS1BrwAH6kbSkptdtu1arrAUVmNhREWIh3My9cipO4FEZKlPGDy/l08HFEF2SLDepz9oyp3Pn8JI52QQkBeiiEw6fpgvVmJNWPjNmlZdi+ixRW4IU+dli9c/xtOTlqYL0pb9CxdDMaazFZVVG89JdifoIqzDCHs5gw8OF8tjXgayc1npZIrPRGmP8cDcvC9Syfl7OCyhHS8TEohEvSaM7W+2IVwUvKL/oYxhuKsfLMvgClUbbV68rzCQEK/u1atrjgC/IcgUqXrDOzbFmqY8vX3N1Kt6ATl7VPJNXjbVNCan+eeuNdTF+NoEO1vjFQdWSblcNaRcIqRoN1qjG2eXWPaQzq7R4AzolYurlJl6fwefcR2DcK6V9+M5G+OgtcwYld93hSG8//waZq2lvryWaGJilTR+77/5hlNuJG7tZ6DTa1E9kX8Fm5TRZkiFyq1DYSQuaGJ7JGhOYnJCc+CwsYBjKBMAnAu50fscx77zQEXB3pVzM8AAYvA7M+LMtCui3I83p/8kc0/lrSqv6aU86yrfAfzY2+sqNsThqL6x/h+7CxJ7ki+hwzeEOFQzhITkTFvQnNODJqNoz+MIKJCJORe6Y4PeGZ1QIu+M8YnRsxzAFvNMmFu/Fbpmer2Sp0bAHnsdihcwDATqXr122wAQKknuAY3nkMUNGMEUZYL7pReAxoZEWoEjghg8dPTJU2In44eVuh5wuT8vYui14LdhNGOvcgs6GiqWS3T4lh6IiAFkzYWDnaEMAboaeVMo8v6Nk7yCHBmCmDsBCg1FURzp7Ti4EdACzIfXsQ595aWedkeyYsy33THMSA33Ky+bkM8wwRuxGYZW6PAmwI/eS1AkIcbqCKacgnT017hEdwAxIjj4+8on+NvuI8nO2jz3cQN9+OTBE7OLTidu0BnvZRwpxtUW5hIM43bRI9XxUCioGyVlumSOjkDhv26QOQHggsmdvgBpALPji8FrchEhYeBJa3Ajg+9Ah8lhQPNRu2Fho3FYp0UHJAl1y09DGDnkQGTp1P8C0RW4egMbKzWXgQIJzaoyMCYAecKJIc+yAZXD7Ron0hzTH+Cs2FrKcDxWOSa/aWDwmCd8/AlThYwDsXYa8fyQkS210S3KM3ASX5RUfvRMavmEm1yv6zcRE52i35KVV6GUtGVoCPLHNdAriij88qrlM/r18xBfhynF6Xtd6vlf87XjIF+PYDcPIOCVTpYVoo4/c9vuq6TzjHP7tIBLu9V4SEuKDvCtEe6C1G2nV1eRuF53XApwzSnAuIx1t6MvVfKc+7lJpMqUBZnb4KCxBfrRIDIDIM1XV4eB965J84vPT3Ujvp2bxDkvErW2LfHzVJvTs3ghT2nDBXejKeSk91QwxAbapAgF2Ut37iZ3bnFd1NUYe0K92+6ZbTW1RYwcz2nKj6TlhATV/iiuPOMI1B2Bz0Q0zxwwqQCFektBoI402hAq7WB2foEeDBt/2X9UDYVev2WGTE5UESw2cwLgREHmhC4sJEIXDN28uUVa4AIJU6fDwIO7EZiP5hEGZSEpEuWc/J5xyGxTf118ipEFVEUZAbBFb1LIFvsaGtWIi4TupWIFeicm2UB5OcFlJuFYgJVLQLyhIBsi+yVA4PSX5wNIEA3x0OYoFzkIBlWBZ4ZQLriWC6RMTIAIEUlubTwkjSBQwhPKlTeG6TbycRsWYXcnQ45gZavWmKP2dL6pPEj6nsOMFufTARmDlZAFeJ0RDvAQU9g+zfcqEk6XdwR2fhlzW2BmolOrgTCRJVkULXCX8pD+/3N0IqGJFL05glDx84W95WFWf5/CwKlXyPSzrmfIe9gmMkqM8XGQGdncgZz42Opk/K+MERsmj6818XVk+MjwtfqX5VbxGVDx3O2nGLiCLJ3JVV9Jc59fgwXd7R/dP6BtG+Nr1IyOWr533NBqnqxR/8TGGXS3fiz2RqbfFS1g1idhf3hF4Pb16tat4BMy+gFpOuBBqDyxsLo2+RhGiAPGaRK3pTd8e911s8kbyS9DgvvpTW9j1K1IA/CI1J+ngS/EqO4RBZrAl6QIQuHZQhDyfNyXIS277+2iMFNtrDUskuaRfokZ3WqVn2LB4403wKzdY6xIjmmB1IkI2V2UlmKA+oYDp8sNrEkeHr1PL/MHLZAbvg0lPKup4zj2UVvIOfonEUswe1Fi0nQ+LJwnwPv4dJM1PsiV9NNG0tvmptuQH7X0DFcJuXkTpy1FulXlaJxWZDhTrWWhFTL7KdRX4rqClpOmqRZhukd8bJIzWoJI/zGYiBTc9qKbR9ckwoQEDWIiUrdEOXWP8eNN3HREr3GhXri8XGJArdEx/xC9Qd/jXgInWCYkhWWyEUEKc2i5eLel5aVKQ0PkeSf4qJPvy0v29TjqP41udzG0JtGl933vzuf/AxoJ3Py8ZhNV2Og6Kx7834kHyBeS8scQCNQ2CW0eqtu3/JLvbvv74g5JuNJLX1OxoCpIfpLD74CKJElt9avZ8WbHfHwaWDP3gCLPkstvBJg3V/o4bxyKyYHBYO7rC/v0PXSXAcGp1AAA="
|
||||||
File diff suppressed because one or more lines are too long
@@ -1,4 +0,0 @@
|
|||||||
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>JSFileToBase64 | gabinete-digital</title><meta name="description" content="Documentation for gabinete-digital"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">gabinete-digital</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">gabinete-digital</a></li><li><a href="JSFileToBase64.html">JSFileToBase64</a></li></ul><h1>Function JSFileToBase64</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="JSFileToBase64" class="tsd-anchor"></a><span class="tsd-kind-call-signature">JSFile<wbr/>To<wbr/>Base64</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">file</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Result</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><a href="#JSFileToBase64" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Converts a <code>File</code> object to a Base64 encoded string.</p>
|
|
||||||
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">file</span>: <span class="tsd-signature-type">File</span></span><div class="tsd-comment tsd-typography"><p>The file to be converted.</p>
|
|
||||||
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Result</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></h4><p>A promise that resolves with a <code>Result</code> object containing either the Base64 encoded string or an error.</p>
|
|
||||||
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://bitbucket.org/equilibriumito/gabinete-digital-fo/src/28bc141d389bc398728ff4bb15cacd51af677e25/src/app/utils/ToBase64.ts#lines-18">ToBase64.ts:18</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>gabinete-digital</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
||||||
@@ -33,4 +33,4 @@ ionic cap sync android</p>
|
|||||||
|
|
||||||
<a id="md:contributing" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Contributing<a href="#md:contributing" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>For major changes, please open an issue first to discuss what you would like to change.</p>
|
<a id="md:contributing" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Contributing<a href="#md:contributing" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>For major changes, please open an issue first to discuss what you would like to change.</p>
|
||||||
<p>Please make sure to update tests as appropriate.</p>
|
<p>Please make sure to update tests as appropriate.</p>
|
||||||
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#md:gabinete-digital-v01"><span>Gabinete <wbr/>Digital v0.1</span></a><ul><li><a href="#md:requirements"><span>Requirements</span></a></li><li><a href="#md:installation"><span>Installation</span></a></li><li><a href="#md:envarioment-depedencies"><span>Envarioment <wbr/>Depedencies</span></a></li><li><a href="#md:bug"><span>BUG</span></a></li><li><a href="#md:start-the-development-server"><span>Start the development server</span></a></li><li><a href="#md:build-for-production-and-launch-server"><span>build for production and launch server</span></a></li><li><a href="#md:run-test"><span>Run test</span></a></li><li><a href="#md:deploy-in-local-network"><span>Deploy in local network</span></a></li></ul><a href="#md:open-xcode"><span>Open xcode</span></a><a href="#md:android"><span>Android</span></a><ul><li><a href="#md:tag-stable-version"><span>Tag stable version</span></a></li><li><a href="#md:contributing"><span>Contributing</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="modules.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-1"></use></svg><span>gabinete-digital</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base="."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#md:gabinete-digital-v01"><span>Gabinete <wbr/>Digital v0.1</span></a><ul><li><a href="#md:requirements"><span>Requirements</span></a></li><li><a href="#md:installation"><span>Installation</span></a></li><li><a href="#md:envarioment-depedencies"><span>Envarioment <wbr/>Depedencies</span></a></li><li><a href="#md:bug"><span>BUG</span></a></li><li><a href="#md:start-the-development-server"><span>Start the development server</span></a></li><li><a href="#md:build-for-production-and-launch-server"><span>build for production and launch server</span></a></li><li><a href="#md:run-test"><span>Run test</span></a></li><li><a href="#md:deploy-in-local-network"><span>Deploy in local network</span></a></li></ul><a href="#md:open-xcode"><span>Open xcode</span></a><a href="#md:android"><span>Android</span></a><ul><li><a href="#md:tag-stable-version"><span>Tag stable version</span></a></li><li><a href="#md:contributing"><span>Contributing</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="index.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-1"></use></svg><span>gabinete-digital</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base="."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>gabinete-digital</title><meta name="description" content="Documentation for gabinete-digital"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script defer src="assets/main.js"></script><script async src="assets/icons.js" id="tsd-icons-script"></script><script async src="assets/search.js" id="tsd-search-script"></script><script async src="assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base="."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">gabinete-digital</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><h2>gabinete-digital</h2></div><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><h3 class="tsd-index-heading uppercase">Index</h3><section class="tsd-index-section"><h3 class="tsd-index-heading">Functions</h3><div class="tsd-index-list"><a href="functions/JSFileToBase64.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-64"></use></svg><span>JSFile<wbr/>To<wbr/>Base64</span></a>
|
|
||||||
</div></section></section></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="modules.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-1"></use></svg><span>gabinete-digital</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base="."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
||||||
Generated
+49
-30
@@ -248,7 +248,7 @@
|
|||||||
"protractor": "~7.0.0",
|
"protractor": "~7.0.0",
|
||||||
"ts-node": "~8.3.0",
|
"ts-node": "~8.3.0",
|
||||||
"tslint": "^6.1.3",
|
"tslint": "^6.1.3",
|
||||||
"typescript": "^4.3.5",
|
"typescript": "4.6",
|
||||||
"uk.co.workingedge.cordova.plugin.sqliteporter": "^1.1.1"
|
"uk.co.workingedge.cordova.plugin.sqliteporter": "^1.1.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -574,6 +574,22 @@
|
|||||||
"node": ">=6.9.0"
|
"node": ">=6.9.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@angular-devkit/build-angular/node_modules/@ngtools/webpack": {
|
||||||
|
"version": "12.2.18",
|
||||||
|
"resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-12.2.18.tgz",
|
||||||
|
"integrity": "sha512-6h/QSG6oZDs2BGfrozdOKqtM5daoCu05q+0gyb3owHz1u9FtMeXXKQ3sQfyFC/GNT3dTMlH6YFxsJPvMPwuy9A==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": "^12.14.1 || >=14.0.0",
|
||||||
|
"npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
|
||||||
|
"yarn": ">= 1.13.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@angular/compiler-cli": "^12.0.0",
|
||||||
|
"typescript": "~4.2.3 || ~4.3.2",
|
||||||
|
"webpack": "^5.30.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@angular-devkit/build-angular/node_modules/@types/estree": {
|
"node_modules/@angular-devkit/build-angular/node_modules/@types/estree": {
|
||||||
"version": "0.0.50",
|
"version": "0.0.50",
|
||||||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.50.tgz",
|
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.50.tgz",
|
||||||
@@ -994,6 +1010,19 @@
|
|||||||
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==",
|
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/@angular-devkit/build-optimizer/node_modules/typescript": {
|
||||||
|
"version": "4.3.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz",
|
||||||
|
"integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==",
|
||||||
|
"dev": true,
|
||||||
|
"bin": {
|
||||||
|
"tsc": "bin/tsc",
|
||||||
|
"tsserver": "bin/tsserver"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4.2.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@angular-devkit/build-webpack": {
|
"node_modules/@angular-devkit/build-webpack": {
|
||||||
"version": "0.1202.18",
|
"version": "0.1202.18",
|
||||||
"resolved": "https://registry.npmjs.org/@angular-devkit/build-webpack/-/build-webpack-0.1202.18.tgz",
|
"resolved": "https://registry.npmjs.org/@angular-devkit/build-webpack/-/build-webpack-0.1202.18.tgz",
|
||||||
@@ -7593,22 +7622,6 @@
|
|||||||
"rxjs": "^6.5.3"
|
"rxjs": "^6.5.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@ngtools/webpack": {
|
|
||||||
"version": "12.2.18",
|
|
||||||
"resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-12.2.18.tgz",
|
|
||||||
"integrity": "sha512-6h/QSG6oZDs2BGfrozdOKqtM5daoCu05q+0gyb3owHz1u9FtMeXXKQ3sQfyFC/GNT3dTMlH6YFxsJPvMPwuy9A==",
|
|
||||||
"dev": true,
|
|
||||||
"engines": {
|
|
||||||
"node": "^12.14.1 || >=14.0.0",
|
|
||||||
"npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
|
|
||||||
"yarn": ">= 1.13.0"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"@angular/compiler-cli": "^12.0.0",
|
|
||||||
"typescript": "~4.2.3 || ~4.3.2",
|
|
||||||
"webpack": "^5.30.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@ngx-translate/core": {
|
"node_modules/@ngx-translate/core": {
|
||||||
"version": "13.0.0",
|
"version": "13.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/@ngx-translate/core/-/core-13.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/@ngx-translate/core/-/core-13.0.0.tgz",
|
||||||
@@ -41957,9 +41970,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/typescript": {
|
"node_modules/typescript": {
|
||||||
"version": "4.3.5",
|
"version": "4.6.4",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.4.tgz",
|
||||||
"integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==",
|
"integrity": "sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg==",
|
||||||
"bin": {
|
"bin": {
|
||||||
"tsc": "bin/tsc",
|
"tsc": "bin/tsc",
|
||||||
"tsserver": "bin/tsserver"
|
"tsserver": "bin/tsserver"
|
||||||
@@ -44629,6 +44642,13 @@
|
|||||||
"@babel/types": "^7.14.5"
|
"@babel/types": "^7.14.5"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@ngtools/webpack": {
|
||||||
|
"version": "12.2.18",
|
||||||
|
"resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-12.2.18.tgz",
|
||||||
|
"integrity": "sha512-6h/QSG6oZDs2BGfrozdOKqtM5daoCu05q+0gyb3owHz1u9FtMeXXKQ3sQfyFC/GNT3dTMlH6YFxsJPvMPwuy9A==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {}
|
||||||
|
},
|
||||||
"@types/estree": {
|
"@types/estree": {
|
||||||
"version": "0.0.50",
|
"version": "0.0.50",
|
||||||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.50.tgz",
|
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.50.tgz",
|
||||||
@@ -44951,6 +44971,12 @@
|
|||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz",
|
||||||
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==",
|
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
|
},
|
||||||
|
"typescript": {
|
||||||
|
"version": "4.3.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz",
|
||||||
|
"integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==",
|
||||||
|
"dev": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -49842,13 +49868,6 @@
|
|||||||
"tslib": "^2.0.0"
|
"tslib": "^2.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@ngtools/webpack": {
|
|
||||||
"version": "12.2.18",
|
|
||||||
"resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-12.2.18.tgz",
|
|
||||||
"integrity": "sha512-6h/QSG6oZDs2BGfrozdOKqtM5daoCu05q+0gyb3owHz1u9FtMeXXKQ3sQfyFC/GNT3dTMlH6YFxsJPvMPwuy9A==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {}
|
|
||||||
},
|
|
||||||
"@ngx-translate/core": {
|
"@ngx-translate/core": {
|
||||||
"version": "13.0.0",
|
"version": "13.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/@ngx-translate/core/-/core-13.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/@ngx-translate/core/-/core-13.0.0.tgz",
|
||||||
@@ -76457,9 +76476,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"typescript": {
|
"typescript": {
|
||||||
"version": "4.3.5",
|
"version": "4.6.4",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.4.tgz",
|
||||||
"integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA=="
|
"integrity": "sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg=="
|
||||||
},
|
},
|
||||||
"ua-parser-js": {
|
"ua-parser-js": {
|
||||||
"version": "0.7.31",
|
"version": "0.7.31",
|
||||||
|
|||||||
+1
-1
@@ -265,7 +265,7 @@
|
|||||||
"protractor": "~7.0.0",
|
"protractor": "~7.0.0",
|
||||||
"ts-node": "~8.3.0",
|
"ts-node": "~8.3.0",
|
||||||
"tslint": "^6.1.3",
|
"tslint": "^6.1.3",
|
||||||
"typescript": "^4.3.5",
|
"typescript": "4.6",
|
||||||
"uk.co.workingedge.cordova.plugin.sqliteporter": "^1.1.1"
|
"uk.co.workingedge.cordova.plugin.sqliteporter": "^1.1.1"
|
||||||
},
|
},
|
||||||
"description": "An Ionic project",
|
"description": "An Ionic project",
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import { Storage } from '@ionic/storage';
|
|||||||
import { register } from 'swiper/element/bundle';
|
import { register } from 'swiper/element/bundle';
|
||||||
import { DomSanitizer } from '@angular/platform-browser';
|
import { DomSanitizer } from '@angular/platform-browser';
|
||||||
import { ScreenOrientation } from "@ionic-native/screen-orientation/ngx";
|
import { ScreenOrientation } from "@ionic-native/screen-orientation/ngx";
|
||||||
import { ChatServiceService } from 'src/app/module/chat/chat-service.service'
|
|
||||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||||
parse: {
|
parse: {
|
||||||
dateInput: "YYYY-MMMM-DD HH:mm"
|
dateInput: "YYYY-MMMM-DD HH:mm"
|
||||||
@@ -39,7 +38,6 @@ export class AppComponent {
|
|||||||
private storage: Storage,
|
private storage: Storage,
|
||||||
private sanitizer: DomSanitizer,
|
private sanitizer: DomSanitizer,
|
||||||
private screenOrientation: ScreenOrientation,
|
private screenOrientation: ScreenOrientation,
|
||||||
private ChatServiceService: ChatServiceService
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
window["sanitizer"] = this.sanitizer
|
window["sanitizer"] = this.sanitizer
|
||||||
|
|||||||
@@ -2,33 +2,49 @@ import { Injectable } from '@angular/core';
|
|||||||
import { Camera, CameraResultType, CameraSource } from '@capacitor/camera';
|
import { Camera, CameraResultType, CameraSource } from '@capacitor/camera';
|
||||||
import { err, ok } from 'neverthrow';
|
import { err, ok } from 'neverthrow';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parameters for taking a picture.
|
||||||
|
* @typedef {Object} takePictureParams
|
||||||
|
* @property {number} [quality=90] - The quality of the picture, from 0 to 100.
|
||||||
|
* @property {CameraResultType} cameraResultType - The result type of the photo, e.g., Base64, URI.
|
||||||
|
*/
|
||||||
|
export type takePictureParams = {
|
||||||
|
quality?: number;
|
||||||
|
cameraResultType: CameraResultType;
|
||||||
|
};
|
||||||
|
|
||||||
type takePictureParams = {
|
/**
|
||||||
quality?: number
|
* Service for handling camera functionality.
|
||||||
cameraResultType: CameraResultType
|
* This service provides methods to interact with the device's camera.
|
||||||
}
|
*/
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class CameraService {
|
export class CameraService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an instance of CameraService.
|
||||||
|
*/
|
||||||
constructor() { }
|
constructor() { }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Takes a picture using the device's camera.
|
||||||
|
* @param {takePictureParams} params - The parameters for taking the picture.
|
||||||
|
* @param {number} [params.quality=90] - The quality of the picture, from 0 to 100.
|
||||||
|
* @param {CameraResultType} params.cameraResultType - The result type of the photo.
|
||||||
|
* @returns {Promise<ok<File> | err<any>>} A promise that resolves with an `ok` result containing the file or an `err` result containing the error.
|
||||||
|
*/
|
||||||
async takePicture({quality = 90, cameraResultType }: takePictureParams) {
|
async takePicture({quality = 90, cameraResultType }: takePictureParams) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const file = await Camera.getPhoto({
|
const file = await Camera.getPhoto({
|
||||||
quality: quality,
|
quality: quality,
|
||||||
// allowEditing: true,
|
|
||||||
resultType: cameraResultType,
|
resultType: cameraResultType,
|
||||||
source: CameraSource.Camera
|
source: CameraSource.Camera
|
||||||
});
|
});
|
||||||
|
|
||||||
return ok(file)
|
return ok(file);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return err(e)
|
return err(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Camera, CameraResultType, CameraSource } from '@capacitor/camera';
|
||||||
|
import { err, ok } from 'neverthrow';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parameters for picking a picture.
|
||||||
|
* @typedef {Object} PickPictureParams
|
||||||
|
* @property {number} [quality=90] - The quality of the picture, from 0 to 100. Defaults to 90.
|
||||||
|
* @property {CameraResultType} [cameraResultType=CameraResultType.DataUrl] - The result type of the photo. Defaults to `CameraResultType.DataUrl`.
|
||||||
|
*/
|
||||||
|
type PickPictureParams = {
|
||||||
|
quality?: number;
|
||||||
|
cameraResultType?: CameraResultType;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Service for handling file picking functionality.
|
||||||
|
* This service provides methods to pick a picture from the device's photo library.
|
||||||
|
*/
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class FilePickerService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an instance of FilePickerService.
|
||||||
|
*/
|
||||||
|
constructor() { }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Picks a picture from the device's photo library.
|
||||||
|
* @param {PickPictureParams} params - The parameters for picking the picture.
|
||||||
|
* @param {number} [params.quality=90] - The quality of the picture, from 0 to 100. Defaults to 90.
|
||||||
|
* @param {CameraResultType} [params.cameraResultType=CameraResultType.DataUrl] - The result type of the photo. Defaults to `CameraResultType.DataUrl`.
|
||||||
|
* @returns {Promise<ok<File> | err<any>>} A promise that resolves with an `ok` result containing the file or an `err` result containing the error.
|
||||||
|
*/
|
||||||
|
async getPicture({quality = 90, cameraResultType = CameraResultType.DataUrl }: PickPictureParams) {
|
||||||
|
try {
|
||||||
|
const file = await Camera.getPhoto({
|
||||||
|
quality: quality,
|
||||||
|
resultType: cameraResultType,
|
||||||
|
source: CameraSource.Photos
|
||||||
|
});
|
||||||
|
|
||||||
|
return ok(file);
|
||||||
|
} catch (e) {
|
||||||
|
return err(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { FilePicker, PickFilesResult } from '@capawesome/capacitor-file-picker';
|
||||||
|
import { err, ok, Result } from 'neverthrow';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class FilePickerMobileService {
|
||||||
|
|
||||||
|
constructor() { }
|
||||||
|
|
||||||
|
async getFile({types, multiple, readData}): Promise<Result<PickFilesResult, any>> {
|
||||||
|
try {
|
||||||
|
|
||||||
|
const result = await FilePicker.pickFiles({
|
||||||
|
types: ['application/pdf', 'application/doc', 'application/docx','application/xls', 'application/xlsx', 'application/ppt',
|
||||||
|
'application/pptx', 'application/txt'],
|
||||||
|
multiple: false,
|
||||||
|
readData: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
return ok(result)
|
||||||
|
} catch (e) {
|
||||||
|
return err(e)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,10 +3,7 @@ import { Camera, CameraResultType, CameraSource } from '@capacitor/camera';
|
|||||||
import { err, ok, Result } from 'neverthrow';
|
import { err, ok, Result } from 'neverthrow';
|
||||||
import { FileType } from 'src/app/models/fileType';
|
import { FileType } from 'src/app/models/fileType';
|
||||||
|
|
||||||
type PickPictureParams = {
|
|
||||||
quality?: number,
|
|
||||||
cameraResultType?: CameraResultType
|
|
||||||
}
|
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -30,19 +27,4 @@ export class FilePickerWebService {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
async getPicture({quality = 90, cameraResultType =CameraResultType.DataUrl }: PickPictureParams) {
|
|
||||||
try {
|
|
||||||
const file = await Camera.getPhoto({
|
|
||||||
quality: quality,
|
|
||||||
// allowEditing: true,
|
|
||||||
resultType: cameraResultType,
|
|
||||||
source: CameraSource.Photos
|
|
||||||
});
|
|
||||||
|
|
||||||
return ok(file)
|
|
||||||
} catch (e) {
|
|
||||||
return err(e)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
export enum StartRecordingResultError {
|
||||||
|
NoSpeaker,
|
||||||
|
NeedPermission,
|
||||||
|
alreadyRecording
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum StopRecordingResultError {
|
||||||
|
haventStartYet,
|
||||||
|
NoValue,
|
||||||
|
UnknownError
|
||||||
|
}
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
import { Injectable } from '@angular/core';
|
|
||||||
import { UserTypingAsyncService } from 'src/app/module/chat/data/async/socket/user-typing-async.service'
|
|
||||||
|
|
||||||
@Injectable({
|
|
||||||
providedIn: 'root'
|
|
||||||
})
|
|
||||||
export class ChatServiceService {
|
|
||||||
|
|
||||||
constructor(
|
|
||||||
private UserTypingAsyncService: UserTypingAsyncService
|
|
||||||
) { }
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { SignalRService } from 'src/app/module/chat/infra/socket/signal-r.service'
|
import { SignalRService } from 'src/app/module/chat/infra/socket/signal-r.service'
|
||||||
import { SyncMessageRepositoryService } from './data/service/sync-repository/sync-message-repository.service';
|
import { SyncMessageRepositoryService } from './data/service/sync-repository/sync-message-repository.service';
|
||||||
|
import { UserTypingAsyncService } from 'src/app/module/chat/data/async/socket/user-typing-async.service'
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
|
||||||
@@ -16,7 +18,8 @@ export class ChatModule {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private message: SyncMessageRepositoryService,
|
private message: SyncMessageRepositoryService,
|
||||||
private SignalRService: SignalRService
|
private SignalRService: SignalRService,
|
||||||
|
private UserTypingAsyncService: UserTypingAsyncService
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
import { TestBed } from '@angular/core/testing';
|
|
||||||
|
|
||||||
import { MessageRepositoryAyncService } from './message-repository-aync.service';
|
|
||||||
|
|
||||||
describe('MessageRepositoryAyncService', () => {
|
|
||||||
let service: MessageRepositoryAyncService;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
TestBed.configureTestingModule({});
|
|
||||||
service = TestBed.inject(MessageRepositoryAyncService);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should be created', () => {
|
|
||||||
expect(service).toBeTruthy();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -3,10 +3,9 @@ import { Injectable } from '@angular/core';
|
|||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class MessageRepositoryAyncService {
|
export class MessageRepositorySyncService {
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
||||||
// alert('hellor')
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Observable, Subject } from 'rxjs';
|
||||||
|
import { DexieRepository } from 'src/app/infra/repository/dexie/dexie-repository.service';
|
||||||
|
import { chatDatabase } from '../../../infra/database/dexie/service';
|
||||||
|
import { Observable as DexieObservable, PromiseExtended } from 'Dexie';
|
||||||
|
import { AttachmentTable } from '../../../infra/database/dexie/schema/attachment';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class AttachmentLocalDataSourceService extends DexieRepository<AttachmentTable> {
|
||||||
|
|
||||||
|
messageSubject = new Subject();
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super(chatDatabase.attachment)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
+14
-1
@@ -2,7 +2,6 @@ import { Injectable } from '@angular/core';
|
|||||||
import { err, ok } from 'neverthrow';
|
import { err, ok } from 'neverthrow';
|
||||||
import { SignalRService } from '../../../infra/socket/signal-r.service';
|
import { SignalRService } from '../../../infra/socket/signal-r.service';
|
||||||
|
|
||||||
|
|
||||||
interface msgObj {
|
interface msgObj {
|
||||||
roomId: string;
|
roomId: string;
|
||||||
senderId: string;
|
senderId: string;
|
||||||
@@ -35,4 +34,18 @@ export class MessageLiveDataSourceService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
listenToMessages() {
|
||||||
|
return this.messageLiveSignalRDataSourceService.getMessage()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
listenToDeleteMessages() {
|
||||||
|
return this.messageLiveSignalRDataSourceService.getMessageDelete()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
listenToUpdateMessages() {
|
||||||
|
return this.messageLiveSignalRDataSourceService.getMessageUpdate()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Dexie, EntityTable, liveQuery } from 'Dexie';
|
import { liveQuery } from 'Dexie';
|
||||||
import { err, ok, Result } from 'neverthrow';
|
import { err, ok, Result } from 'neverthrow';
|
||||||
import { from, Observable, Subject } from 'rxjs';
|
import { Observable, Subject } from 'rxjs';
|
||||||
import { filter } from 'rxjs/operators';
|
import { filter } from 'rxjs/operators';
|
||||||
import { MessageInputDTO } from '../../dto/message/messageInputDtO';
|
|
||||||
import { MessageEntity } from '../../../domain/entity/message';
|
import { MessageEntity } from '../../../domain/entity/message';
|
||||||
import { DexieRepository } from 'src/app/infra/repository/dexie/dexie-repository.service';
|
import { DexieRepository } from 'src/app/infra/repository/dexie/dexie-repository.service';
|
||||||
import { MessageTable } from 'src/app/module/chat/infra/database/dexie/schema/message';
|
import { MessageTable } from 'src/app/module/chat/infra/database/dexie/schema/message';
|
||||||
import { chatDatabase } from '../../../infra/database/dexie/service';
|
import { chatDatabase } from '../../../infra/database/dexie/service';
|
||||||
|
import { Observable as DexieObservable, PromiseExtended } from 'Dexie';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -61,7 +61,7 @@ export class MessageLocalDataSourceService extends DexieRepository<MessageTable>
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async sendMessage(data: MessageInputDTO) {
|
async sendMessage(data: MessageTable) {
|
||||||
|
|
||||||
(data as MessageTable).sending = true
|
(data as MessageTable).sending = true
|
||||||
|
|
||||||
@@ -76,9 +76,8 @@ export class MessageLocalDataSourceService extends DexieRepository<MessageTable>
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// @ValidateSchema(tableSchema)
|
// @ValidateSchema(tableSchema)
|
||||||
async createMessage(data: MessageInputDTO) {
|
async createMessage(data: MessageTable) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const result = await chatDatabase.message.add(data)
|
const result = await chatDatabase.message.add(data)
|
||||||
@@ -90,7 +89,7 @@ export class MessageLocalDataSourceService extends DexieRepository<MessageTable>
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async createManyMessage(data: MessageInputDTO[]) {
|
async createManyMessage(data: MessageTable[]) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const result = await chatDatabase.message.bulkAdd(data)
|
const result = await chatDatabase.message.bulkAdd(data)
|
||||||
@@ -147,12 +146,12 @@ export class MessageLocalDataSourceService extends DexieRepository<MessageTable>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getItems(roomId: string) {
|
getItems(roomId: string): PromiseExtended<MessageEntity[]> {
|
||||||
return chatDatabase.message.where('roomId').equals(roomId).toArray()
|
return chatDatabase.message.where('roomId').equals(roomId).sortBy('$id') as any
|
||||||
}
|
}
|
||||||
|
|
||||||
getItemsLive(roomId: string) {
|
getItemsLive(roomId: string): DexieObservable<MessageEntity[]> {
|
||||||
return liveQuery(() => chatDatabase.message.where('roomId').equals(roomId).sortBy('$id'))
|
return liveQuery(() => chatDatabase.message.where('roomId').equals(roomId).sortBy('$id') as any)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class MessageMemoryDataSourceService {
|
||||||
|
|
||||||
|
messages: {[roomId: string]: string[]} = {}
|
||||||
|
|
||||||
|
constructor() {}
|
||||||
|
}
|
||||||
@@ -31,4 +31,10 @@ export class MessageRemoteDataSourceService {
|
|||||||
return await this.httpService.get(`${this.baseUrl}/Room/${id}/Messages`);
|
return await this.httpService.get(`${this.baseUrl}/Room/${id}/Messages`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@APIReturn(MessageOutPutDTOSchema, 'get/Messages/attachment')
|
||||||
|
async getAttachment(id: string): DataSourceReturn<MessageOutPutDTO> {
|
||||||
|
return await this.httpService.get(`${this.baseUrl}/attachment/${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { WebSocketMessage, WebSocketService } from '../../../infra/socket/socket';
|
import { SignalRService } from '../../../infra/socket/signal-r.service';
|
||||||
import { err, ok } from 'neverthrow';
|
import { AddMemberToRoomInputDTO } from '../../dto/room/addMemberToRoomInputDto';
|
||||||
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class RoomLiveDataSourceService {
|
export class RoomLiveDataSourceService {
|
||||||
|
|
||||||
// constructor(private socket: WebSocketService) {}
|
constructor(
|
||||||
|
private socket: SignalRService,
|
||||||
|
) {}
|
||||||
|
|
||||||
// async getRoomById(data: WebSocketMessage) {
|
// async getRoomById(data: WebSocketMessage) {
|
||||||
|
|
||||||
@@ -24,4 +26,19 @@ export class RoomLiveDataSourceService {
|
|||||||
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
async addMemberToRoom(data: AddMemberToRoomInputDTO) {
|
||||||
|
|
||||||
|
const result = await this.socket.sendData({
|
||||||
|
method: 'AddRoomMember',
|
||||||
|
data: {
|
||||||
|
requestId: uuidv4(),
|
||||||
|
roomId: data.id,
|
||||||
|
members: data.members
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
console.log({result})
|
||||||
|
|
||||||
|
return result
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-1
@@ -12,9 +12,20 @@ import { TypingTable } from '../../../infra/database/dexie/schema/typing';
|
|||||||
})
|
})
|
||||||
export class UserTypingLocalDataSourceService {
|
export class UserTypingLocalDataSourceService {
|
||||||
|
|
||||||
constructor() { }
|
constructor() {
|
||||||
|
this.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async clear() {
|
||||||
|
try {
|
||||||
|
const result = await chatDatabase.typing.clear()
|
||||||
|
return ok(result)
|
||||||
|
} catch (e) {
|
||||||
|
return err(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async addUserTyping(data: TypingTable) {
|
async addUserTyping(data: TypingTable) {
|
||||||
|
|
||||||
data.id = data.chatRoomId + '@' + data.userName
|
data.id = data.chatRoomId + '@' + data.userName
|
||||||
|
|||||||
@@ -10,14 +10,15 @@ export const MessageInputDTOSchema = z.object({
|
|||||||
oneShot: z.boolean(),
|
oneShot: z.boolean(),
|
||||||
requireUnlock: z.boolean(),
|
requireUnlock: z.boolean(),
|
||||||
requestId: z.string(),
|
requestId: z.string(),
|
||||||
attachments: z.array(z.object({
|
attachment: z.object({
|
||||||
fileType: z.nativeEnum(MessageAttachmentFileType),
|
fileType: z.nativeEnum(MessageAttachmentFileType),
|
||||||
source: z.nativeEnum(MessageAttachmentSource),
|
source: z.nativeEnum(MessageAttachmentSource),
|
||||||
file: z.string(),
|
file: z.string(),
|
||||||
fileName: z.string(),
|
fileName: z.string(),
|
||||||
applicationId: z.string(),
|
applicationId: z.string(),
|
||||||
docId: z.string()
|
docId: z.string(),
|
||||||
})).optional()
|
mimeType: z.string().optional()
|
||||||
|
}).optional()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ export const MessageOutPutDataDTOSchema = z.object({
|
|||||||
message: z.string().nullable(),
|
message: z.string().nullable(),
|
||||||
messageType: z.number(),
|
messageType: z.number(),
|
||||||
sentAt: z.string(),
|
sentAt: z.string(),
|
||||||
deliverAt: z.string().datetime().nullable(),
|
|
||||||
canEdit: z.boolean(),
|
canEdit: z.boolean(),
|
||||||
oneShot: z.boolean(),
|
oneShot: z.boolean(),
|
||||||
requireUnlock: z.boolean(),
|
requireUnlock: z.boolean(),
|
||||||
@@ -39,10 +38,11 @@ export const MessageOutPutDataDTOSchema = z.object({
|
|||||||
attachments: z.array(z.object({
|
attachments: z.array(z.object({
|
||||||
fileType: z.nativeEnum(MessageAttachmentFileType),
|
fileType: z.nativeEnum(MessageAttachmentFileType),
|
||||||
source: z.nativeEnum(MessageAttachmentSource),
|
source: z.nativeEnum(MessageAttachmentSource),
|
||||||
file: z.string(),
|
file: z.string().optional(),
|
||||||
fileName: z.string(),
|
fileName: z.string().optional(),
|
||||||
applicationId: z.string().optional(),
|
applicationId: z.string().optional(),
|
||||||
docId: z.string().optional()
|
docId: z.string().optional(),
|
||||||
|
id: z.string()
|
||||||
}))
|
}))
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { MessageRemoteDataSourceService } from '../data-source/message/message-remote-data-source.service';
|
import { MessageRemoteDataSourceService } from '../data-source/message/message-remote-data-source.service';
|
||||||
import { MessageLiveDataSourceService } from '../data-source/message/message-live-data-source.service';
|
|
||||||
import { MessageLocalDataSourceService } from '../data-source/message/message-local-data-source.service';
|
|
||||||
import { SessionStore } from 'src/app/store/session.service';
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
import { SignalRService } from '../../infra/socket/signal-r.service';
|
import { SignalRService } from '../../infra/socket/signal-r.service';
|
||||||
import { v4 as uuidv4 } from 'uuid'
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
@@ -14,7 +12,10 @@ import { InstanceId } from '../../domain/chat-service.service';
|
|||||||
import { MessageMapper } from '../../domain/mapper/messageMapper';
|
import { MessageMapper } from '../../domain/mapper/messageMapper';
|
||||||
import { MessageOutPutDataDTO } from '../dto/message/messageOutputDTO';
|
import { MessageOutPutDataDTO } from '../dto/message/messageOutputDTO';
|
||||||
import { MessageTable } from 'src/app/module/chat/infra/database/dexie/schema/message';
|
import { MessageTable } from 'src/app/module/chat/infra/database/dexie/schema/message';
|
||||||
|
import { MessageLocalDataSourceService } from '../data-source/message/message-local-data-source.service';
|
||||||
|
import { MessageLiveDataSourceService } from '../data-source/message/message-live-signalr-data-source.service';
|
||||||
|
import { AttachmentLocalDataSourceService } from 'src/app/module/chat/data/data-source/attachment/message-local-data-source.service'
|
||||||
|
import { Subject } from 'rxjs';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -25,7 +26,8 @@ export class MessageRepositoryService {
|
|||||||
private messageRemoteDataSourceService: MessageRemoteDataSourceService,
|
private messageRemoteDataSourceService: MessageRemoteDataSourceService,
|
||||||
private messageLiveDataSourceService: MessageLiveDataSourceService,
|
private messageLiveDataSourceService: MessageLiveDataSourceService,
|
||||||
private messageLiveSignalRDataSourceService: SignalRService,
|
private messageLiveSignalRDataSourceService: SignalRService,
|
||||||
private messageLocalDataSourceService: MessageLocalDataSourceService
|
private messageLocalDataSourceService: MessageLocalDataSourceService,
|
||||||
|
private AttachmentLocalDataSourceService: AttachmentLocalDataSourceService
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
|
||||||
@@ -37,17 +39,30 @@ export class MessageRepositoryService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async sendMessage(entity: MessageEntity) {
|
|
||||||
|
|
||||||
const requestId = InstanceId +'@'+ uuidv4();
|
async createMessage(entity: MessageEntity) {
|
||||||
|
//const requestId = InstanceId +'@'+ uuidv4();
|
||||||
|
|
||||||
|
const localActionResult = await this.messageLocalDataSourceService.sendMessage(entity)
|
||||||
|
|
||||||
|
return localActionResult.map(e => {
|
||||||
|
entity.$id = e
|
||||||
|
return entity
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
async sendMessage(entity: MessageEntity) {
|
||||||
|
const messageSubject = new Subject<MessageTable | string>();
|
||||||
|
|
||||||
const roomId = entity.roomId
|
const roomId = entity.roomId
|
||||||
|
|
||||||
entity.sending = true
|
entity.sending = true
|
||||||
const localActionResult = await this.messageLocalDataSourceService.sendMessage(entity)
|
const localActionResult = await this.messageLocalDataSourceService.sendMessage(entity)
|
||||||
|
|
||||||
if(localActionResult.isOk()) {
|
if(localActionResult.isOk()) {
|
||||||
const DTO = MessageMapper.fromDomain(entity, requestId)
|
const DTO = MessageMapper.fromDomain(entity, entity.requestId)
|
||||||
const sendMessageResult = await this.messageLiveSignalRDataSourceService.sendMessage<MessageOutPutDataDTO>(DTO)
|
const sendMessageResult = await this.messageLiveSignalRDataSourceService.sendMessage<MessageOutPutDataDTO>(DTO)
|
||||||
|
// return this sendMessageResult
|
||||||
|
|
||||||
if(sendMessageResult.isOk()) {
|
if(sendMessageResult.isOk()) {
|
||||||
|
|
||||||
@@ -62,6 +77,8 @@ export class MessageRepositoryService {
|
|||||||
$id : localActionResult.value
|
$id : localActionResult.value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// console.log('sendMessageResult.value', sendMessageResult.value)
|
||||||
|
// this.attachment(sendMessageResult.value.attachments[0].id)
|
||||||
return this.messageLocalDataSourceService.update(localActionResult.value, {...clone, sending: false, roomId: entity.roomId})
|
return this.messageLocalDataSourceService.update(localActionResult.value, {...clone, sending: false, roomId: entity.roomId})
|
||||||
} else {
|
} else {
|
||||||
await this.messageLocalDataSourceService.update(localActionResult.value, {sending: false, $id: localActionResult.value})
|
await this.messageLocalDataSourceService.update(localActionResult.value, {sending: false, $id: localActionResult.value})
|
||||||
@@ -113,12 +130,14 @@ export class MessageRepositoryService {
|
|||||||
|
|
||||||
if(result.isOk()) {
|
if(result.isOk()) {
|
||||||
|
|
||||||
const { addedItems, changedItems } = messageListDetermineChanges(result.value.data, localResult)
|
const { addedItems, changedItems, deletedItems } = messageListDetermineChanges(result.value.data, localResult)
|
||||||
|
|
||||||
|
console.log({addedItems, changedItems});
|
||||||
|
|
||||||
for(const message of changedItems) {
|
for(const message of changedItems) {
|
||||||
let clone: MessageTable = message
|
let clone: MessageTable = message
|
||||||
clone.roomId = id
|
clone.roomId = id
|
||||||
await this.messageLocalDataSourceService.findOrUpdate(clone)
|
this.messageLocalDataSourceService.findOrUpdate(clone)
|
||||||
}
|
}
|
||||||
|
|
||||||
for(const message of addedItems) {
|
for(const message of addedItems) {
|
||||||
@@ -126,7 +145,14 @@ export class MessageRepositoryService {
|
|||||||
clone.roomId = id
|
clone.roomId = id
|
||||||
|
|
||||||
}
|
}
|
||||||
await this.messageLocalDataSourceService.createManyMessage(addedItems.reverse())
|
this.messageLocalDataSourceService.createManyMessage(addedItems.reverse())
|
||||||
|
|
||||||
|
|
||||||
|
for(const message of deletedItems) {
|
||||||
|
this.messageLocalDataSourceService.deleteByMessageId(message.id)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
@@ -135,6 +161,10 @@ export class MessageRepositoryService {
|
|||||||
return this.messageLocalDataSourceService.getItemsLive(roomId)
|
return this.messageLocalDataSourceService.getItemsLive(roomId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getItems (roomId: string) {
|
||||||
|
return this.messageLocalDataSourceService.getItems(roomId)
|
||||||
|
}
|
||||||
|
|
||||||
subscribeToNewMessages(roomId: any) {
|
subscribeToNewMessages(roomId: any) {
|
||||||
return this.messageLocalDataSourceService.subscribeToNewMessage(roomId)
|
return this.messageLocalDataSourceService.subscribeToNewMessage(roomId)
|
||||||
}
|
}
|
||||||
@@ -147,4 +177,9 @@ export class MessageRepositoryService {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
attachment(roomId: string) {
|
||||||
|
console.log('attachment')
|
||||||
|
return this.messageRemoteDataSourceService.getAttachment(roomId)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import { MessageLiveDataSourceService } from '../data-source/message/message-liv
|
|||||||
import { MemberListUPdateStatusInputDTO } from '../../domain/use-case/socket/member-list-update-status-use-case.service';
|
import { MemberListUPdateStatusInputDTO } from '../../domain/use-case/socket/member-list-update-status-use-case.service';
|
||||||
import { MemberSetAdminDTO } from '../../domain/use-case/member-admin-use-case.service';
|
import { MemberSetAdminDTO } from '../../domain/use-case/member-admin-use-case.service';
|
||||||
import { MemberListMapper } from '../../domain/mapper/memberLIstMapper';
|
import { MemberListMapper } from '../../domain/mapper/memberLIstMapper';
|
||||||
|
import { SignalRService } from '../../infra/socket/signal-r.service';
|
||||||
|
|
||||||
|
|
||||||
function date(isoDateString) {
|
function date(isoDateString) {
|
||||||
@@ -43,8 +44,7 @@ export class RoomRepositoryService {
|
|||||||
private roomRemoteDataSourceService: RoomRemoteDataSourceService,
|
private roomRemoteDataSourceService: RoomRemoteDataSourceService,
|
||||||
// private roomMemoryDataSourceService: Store<RoomRemoteDataSourceState>,
|
// private roomMemoryDataSourceService: Store<RoomRemoteDataSourceState>,
|
||||||
private roomLocalDataSourceService: RoomLocalDataSourceService,
|
private roomLocalDataSourceService: RoomLocalDataSourceService,
|
||||||
private roomLiveDataSourceService: RoomLiveDataSourceService,
|
private roomLiveSignalRDataSourceService: RoomLiveDataSourceService,
|
||||||
private messageLiveDataSourceService: MessageLiveDataSourceService,
|
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
@captureAndReraiseAsync('RoomRepositoryService/list')
|
@captureAndReraiseAsync('RoomRepositoryService/list')
|
||||||
@@ -223,9 +223,12 @@ export class RoomRepositoryService {
|
|||||||
|
|
||||||
@captureAndReraiseAsync('RoomRepositoryService/addMemberToRoom')
|
@captureAndReraiseAsync('RoomRepositoryService/addMemberToRoom')
|
||||||
async addMemberToRoom(data: AddMemberToRoomInputDTO) {
|
async addMemberToRoom(data: AddMemberToRoomInputDTO) {
|
||||||
const result = await this.roomRemoteDataSourceService.addMemberToRoom(data)
|
|
||||||
|
|
||||||
return result
|
return this.roomLiveSignalRDataSourceService.addMemberToRoom(data)
|
||||||
|
|
||||||
|
// const result = await this.roomRemoteDataSourceService.addMemberToRoom(data)
|
||||||
|
|
||||||
|
// return result
|
||||||
}
|
}
|
||||||
|
|
||||||
async updateMemberStatus(data: MemberListUPdateStatusInputDTO) {
|
async updateMemberStatus(data: MemberListUPdateStatusInputDTO) {
|
||||||
|
|||||||
@@ -9,10 +9,13 @@ import { SignalRService } from '../infra/socket/signal-r.service';
|
|||||||
import { SocketMessageDeleteUseCaseService } from 'src/app/module/chat/domain/use-case/socket/socket-message-delete-use-case.service';
|
import { SocketMessageDeleteUseCaseService } from 'src/app/module/chat/domain/use-case/socket/socket-message-delete-use-case.service';
|
||||||
import { SocketMessageUpdateUseCaseService } from 'src/app/module/chat/domain/use-case/socket/socket-message-update-use-case.service';
|
import { SocketMessageUpdateUseCaseService } from 'src/app/module/chat/domain/use-case/socket/socket-message-update-use-case.service';
|
||||||
import { SocketMessageCreateUseCaseService } from 'src/app/module/chat/domain/use-case/socket/socket-message-create-use-case.service';
|
import { SocketMessageCreateUseCaseService } from 'src/app/module/chat/domain/use-case/socket/socket-message-create-use-case.service';
|
||||||
|
import { ListenMessageByRoomIdNewUseCase } from 'src/app/module/chat/domain/use-case/listen-message-by-roomId.service';
|
||||||
import { MemberListUpdateStatusUseCaseService } from 'src/app/module/chat/domain/use-case/socket/member-list-update-status-use-case.service';
|
import { MemberListUpdateStatusUseCaseService } from 'src/app/module/chat/domain/use-case/socket/member-list-update-status-use-case.service';
|
||||||
|
import { ListenMessageDeleteByRoomIdService } from './use-case/listene-message-delete-by-roomId.service';
|
||||||
|
import { ListenMessageUpdateByRoomIdUseCase } from './use-case/listen-message-update-by-roomId.service';
|
||||||
|
import { ListenSendMessageUseCase } from './use-case/listen-send-message.service'
|
||||||
import { filter } from 'rxjs/operators';
|
import { filter } from 'rxjs/operators';
|
||||||
import { v4 as uuidv4 } from 'uuid'
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
import { MessageInputDTO } from '../data/dto/message/messageInputDtO';
|
|
||||||
import { MessageEntity } from './entity/message';
|
import { MessageEntity } from './entity/message';
|
||||||
|
|
||||||
export const InstanceId = uuidv4();
|
export const InstanceId = uuidv4();
|
||||||
@@ -33,7 +36,11 @@ export class ChatServiceService {
|
|||||||
private SocketMessageCreateUseCaseService: SocketMessageCreateUseCaseService,
|
private SocketMessageCreateUseCaseService: SocketMessageCreateUseCaseService,
|
||||||
private MemberListUpdateStatusUseCaseService: MemberListUpdateStatusUseCaseService,
|
private MemberListUpdateStatusUseCaseService: MemberListUpdateStatusUseCaseService,
|
||||||
private MemberAdminUseCaseService: MemberAdminUseCaseService,
|
private MemberAdminUseCaseService: MemberAdminUseCaseService,
|
||||||
private MessageCreateUseCaseService: MessageCreateUseCaseService
|
private MessageCreateUseCaseService: MessageCreateUseCaseService,
|
||||||
|
private ListenMessageByRoomIdNewUseCase: ListenMessageByRoomIdNewUseCase,
|
||||||
|
private ListenMessageDeleteService: ListenMessageDeleteByRoomIdService,
|
||||||
|
private ListenMessageUpdateByRoomIdUseCase: ListenMessageUpdateByRoomIdUseCase,
|
||||||
|
private ListenSendMessageUseCase: ListenSendMessageUseCase
|
||||||
) {
|
) {
|
||||||
this.messageLiveSignalRDataSourceService.getMessageDelete()
|
this.messageLiveSignalRDataSourceService.getMessageDelete()
|
||||||
.pipe()
|
.pipe()
|
||||||
@@ -106,9 +113,26 @@ export class ChatServiceService {
|
|||||||
return this.MemberAdminUseCaseService.execute(input)
|
return this.MemberAdminUseCaseService.execute(input)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sendMessage(input: MessageEntity) {
|
sendMessage(input: MessageEntity) {
|
||||||
return this.MessageCreateUseCaseService.execute(input);
|
return this.MessageCreateUseCaseService.execute(input);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
listenToIncomingMessage(roomId:string) {
|
||||||
|
return this.ListenMessageByRoomIdNewUseCase.execute({roomId})
|
||||||
|
}
|
||||||
|
|
||||||
|
listenToDeleteMessage(roomId: string) {
|
||||||
|
return this.ListenMessageDeleteService.execute({roomId})
|
||||||
|
}
|
||||||
|
|
||||||
|
listenToUpdateMessage(roomId: string) {
|
||||||
|
return this.ListenMessageUpdateByRoomIdUseCase.execute({roomId})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
listenToSendMessage(roomId: string) {
|
||||||
|
return this.ListenSendMessageUseCase.execute({roomId})
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,11 +21,15 @@ const MessageEntitySchema = z.object({
|
|||||||
attachments: z.array(z.object({
|
attachments: z.array(z.object({
|
||||||
fileType: z.nativeEnum(MessageAttachmentFileType),
|
fileType: z.nativeEnum(MessageAttachmentFileType),
|
||||||
source: z.nativeEnum(MessageAttachmentSource),
|
source: z.nativeEnum(MessageAttachmentSource),
|
||||||
|
file: z.string().optional(),
|
||||||
|
fileName: z.string().optional(),
|
||||||
|
applicationId: z.string().optional(),
|
||||||
|
docId: z.string().optional()
|
||||||
|
})),
|
||||||
|
attachmentsSource: z.array(z.object({
|
||||||
file: z.string(),
|
file: z.string(),
|
||||||
fileName: z.string(),
|
id: z.string(),
|
||||||
applicationId: z.string(),
|
})),
|
||||||
docId: z.string()
|
|
||||||
}))
|
|
||||||
})
|
})
|
||||||
|
|
||||||
type Message = z.infer<typeof MessageEntitySchema>;
|
type Message = z.infer<typeof MessageEntitySchema>;
|
||||||
@@ -56,8 +60,19 @@ export class MessageEntity implements Message {
|
|||||||
file?: string,
|
file?: string,
|
||||||
fileName: string,
|
fileName: string,
|
||||||
applicationId?: string,
|
applicationId?: string,
|
||||||
docId?: string
|
docId?: string,
|
||||||
}[]
|
mimeType?: string,
|
||||||
|
description?: string
|
||||||
|
}[] = []
|
||||||
|
|
||||||
|
attachmentsSource: {
|
||||||
|
id: string,
|
||||||
|
file: string
|
||||||
|
}[] = []
|
||||||
|
|
||||||
|
reactions = []
|
||||||
|
|
||||||
|
requestId: string
|
||||||
|
|
||||||
constructor() {}
|
constructor() {}
|
||||||
|
|
||||||
@@ -67,4 +82,8 @@ export class MessageEntity implements Message {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get hasAttachment() {
|
||||||
|
return this.attachments.length >= 1
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export class MessageMapper {
|
|||||||
roomId: entity.roomId,
|
roomId: entity.roomId,
|
||||||
senderId: entity.sender.wxUserId,
|
senderId: entity.sender.wxUserId,
|
||||||
requestId: requestId,
|
requestId: requestId,
|
||||||
attachments: entity.attachments
|
attachment: entity.attachments[0]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { filter, map } from 'rxjs/operators';
|
||||||
|
import { InstanceId } from '../chat-service.service';
|
||||||
|
import { MessageLiveDataSourceService } from 'src/app/module/chat/data/data-source/message/message-live-signalr-data-source.service'
|
||||||
|
import { MessageEntity } from '../entity/message';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class ListenMessageByRoomIdNewUseCase {
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private MessageLiveDataSourceService: MessageLiveDataSourceService
|
||||||
|
) { }
|
||||||
|
|
||||||
|
execute({roomId}: {roomId: string}) {
|
||||||
|
|
||||||
|
return this.MessageLiveDataSourceService.listenToMessages().pipe(
|
||||||
|
filter((message) => !message?.requestId?.startsWith(InstanceId) && message?.roomId == roomId),
|
||||||
|
map(message => Object.assign(new MessageEntity(), message))
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { filter } from 'rxjs/operators';
|
||||||
|
import { MessageLiveDataSourceService } from '../../data/data-source/message/message-live-signalr-data-source.service';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class ListenMessageUpdateByRoomIdUseCase {
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private messageLiveSignalRDataSourceService: MessageLiveDataSourceService,
|
||||||
|
) { }
|
||||||
|
|
||||||
|
execute({roomId}) {
|
||||||
|
return this.messageLiveSignalRDataSourceService.listenToUpdateMessages().pipe(
|
||||||
|
filter((message) => roomId == message?.roomId )
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { MessageLiveDataSourceService } from 'src/app/module/chat/data/data-source/message/message-live-signalr-data-source.service'
|
||||||
|
import { InstanceId } from '../chat-service.service';
|
||||||
|
import { filter, map } from 'rxjs/operators';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class ListenSendMessageUseCase {
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private MessageLiveDataSourceService: MessageLiveDataSourceService
|
||||||
|
) { }
|
||||||
|
|
||||||
|
execute({roomId}: {roomId: string}) {
|
||||||
|
|
||||||
|
return this.MessageLiveDataSourceService.listenToMessages().pipe(
|
||||||
|
filter((message) => message?.requestId?.startsWith(InstanceId) && message?.roomId == roomId),
|
||||||
|
map(message => message)
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { SignalRService } from '../../infra/socket/signal-r.service';
|
||||||
|
import { filter } from 'rxjs/operators';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class ListenMessageDeleteByRoomIdService {
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private messageLiveSignalRDataSourceService: SignalRService,
|
||||||
|
) { }
|
||||||
|
|
||||||
|
execute({roomId}) {
|
||||||
|
return this.messageLiveSignalRDataSourceService.getMessageDelete().pipe(
|
||||||
|
filter((message) => {
|
||||||
|
|
||||||
|
console.log({message}, 'delete')
|
||||||
|
return roomId == message?.roomId
|
||||||
|
} )
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,6 +3,8 @@ import { MessageEntity } from '../entity/message';
|
|||||||
import { SessionStore } from 'src/app/store/session.service';
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
import { MessageRepositoryService } from "src/app/module/chat/data/repository/message-respository.service"
|
import { MessageRepositoryService } from "src/app/module/chat/data/repository/message-respository.service"
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
|
import { InstanceId } from '../chat-service.service';
|
||||||
|
|
||||||
const MessageInputUseCaseSchema = z.object({
|
const MessageInputUseCaseSchema = z.object({
|
||||||
memberId: z.number(),
|
memberId: z.number(),
|
||||||
@@ -26,6 +28,8 @@ export class MessageCreateUseCaseService {
|
|||||||
|
|
||||||
input.sendAttemp++;
|
input.sendAttemp++;
|
||||||
|
|
||||||
|
input.requestId = InstanceId +'@'+ uuidv4();
|
||||||
|
|
||||||
const result = await this.MessageRepositoryService.sendMessage(input)
|
const result = await this.MessageRepositoryService.sendMessage(input)
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { MessageEntity } from '../entity/message';
|
||||||
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
|
import { MessageRepositoryService } from "src/app/module/chat/data/repository/message-respository.service"
|
||||||
|
import { z } from 'zod';
|
||||||
|
|
||||||
|
const MessageInputUseCaseSchema = z.object({
|
||||||
|
memberId: z.number(),
|
||||||
|
roomId: z.string(),
|
||||||
|
message: z.string()
|
||||||
|
})
|
||||||
|
|
||||||
|
export type MessageInputUseCase = z.infer< typeof MessageInputUseCaseSchema>
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class MessageCreateUseCaseService {
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private MessageRepositoryService: MessageRepositoryService
|
||||||
|
) { }
|
||||||
|
|
||||||
|
|
||||||
|
async execute(input: MessageEntity) {
|
||||||
|
|
||||||
|
const result = await this.MessageRepositoryService.createMessage(input)
|
||||||
|
|
||||||
|
if(result.isOk()) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
import { Injectable } from '@angular/core';
|
|
||||||
import { SyncMessageRepositoryService } from 'src/app/module/chat/data/service/sync-repository/sync-message-repository.service'
|
|
||||||
@Injectable({
|
|
||||||
providedIn: 'root'
|
|
||||||
})
|
|
||||||
export class SyncLocalMessageService {
|
|
||||||
|
|
||||||
constructor(
|
|
||||||
private SyncMessageRepositoryService: SyncMessageRepositoryService
|
|
||||||
) { }
|
|
||||||
|
|
||||||
|
|
||||||
async execute() {
|
|
||||||
return this.SyncMessageRepositoryService.sendLocalMessages()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import { z } from "zod";
|
||||||
|
import { EntityTable } from 'Dexie';
|
||||||
|
|
||||||
|
export const AttachmentTableSchema = z.object({
|
||||||
|
id: z.string(),
|
||||||
|
$id: z.string(),
|
||||||
|
messageId: z.string(),
|
||||||
|
file: z.string(),
|
||||||
|
})
|
||||||
|
|
||||||
|
export type AttachmentTable = z.infer<typeof AttachmentTableSchema>
|
||||||
|
export type DexieAttachmentsTableSchema = EntityTable<AttachmentTable, '$id'>;
|
||||||
|
export const AttachmentTableColumn = '++$id, id, messageId, file'
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
import { z } from "zod";
|
import { nativeEnum, z } from "zod";
|
||||||
import { EntityTable } from 'Dexie';
|
import { EntityTable } from 'Dexie';
|
||||||
|
import { MessageAttachmentFileType, MessageAttachmentSource } from "src/app/module/chat/data/dto/message/messageOutputDTO";
|
||||||
|
|
||||||
export const MessageTable = z.object({
|
export const MessageTable = z.object({
|
||||||
$id: z.number().optional(),
|
$id: z.number().optional(),
|
||||||
@@ -25,7 +26,14 @@ export const MessageTable = z.object({
|
|||||||
sender: z.object({}),
|
sender: z.object({}),
|
||||||
}).array().optional(),
|
}).array().optional(),
|
||||||
info: z.array(z.object({})).optional(),
|
info: z.array(z.object({})).optional(),
|
||||||
attachments: z.array(z.object({})).optional()
|
attachments: z.array(z.object({
|
||||||
|
fileType: z.nativeEnum(MessageAttachmentFileType),
|
||||||
|
source: z.nativeEnum(MessageAttachmentSource),
|
||||||
|
file: z.string().optional(),
|
||||||
|
fileName: z.string().optional(),
|
||||||
|
applicationId: z.string().optional(),
|
||||||
|
docId: z.string().optional()
|
||||||
|
})).optional()
|
||||||
})
|
})
|
||||||
|
|
||||||
export type MessageTable = z.infer<typeof MessageTable>
|
export type MessageTable = z.infer<typeof MessageTable>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { DexieMembersTableSchema, MemberTableColumn } from './schema/members';
|
|||||||
import { DexieRoomsTableSchema, RoomTableColumn } from './schema/room';
|
import { DexieRoomsTableSchema, RoomTableColumn } from './schema/room';
|
||||||
import { DexieTypingsTableSchema, TypingTableColumn } from './schema/typing';
|
import { DexieTypingsTableSchema, TypingTableColumn } from './schema/typing';
|
||||||
import { MessageEntity } from '../../../domain/entity/message';
|
import { MessageEntity } from '../../../domain/entity/message';
|
||||||
|
import { AttachmentTable, AttachmentTableColumn, DexieAttachmentsTableSchema } from './schema/attachment';
|
||||||
// import DexieMemory from 'dexie-in-memory';
|
// import DexieMemory from 'dexie-in-memory';
|
||||||
|
|
||||||
// Database declaration (move this to its own module also)
|
// Database declaration (move this to its own module also)
|
||||||
@@ -12,14 +13,16 @@ export const chatDatabase = new Dexie('chat-database-infra') as Dexie & {
|
|||||||
message: DexieMessageTable,
|
message: DexieMessageTable,
|
||||||
members: DexieMembersTableSchema,
|
members: DexieMembersTableSchema,
|
||||||
room: DexieRoomsTableSchema,
|
room: DexieRoomsTableSchema,
|
||||||
typing: DexieTypingsTableSchema
|
typing: DexieTypingsTableSchema,
|
||||||
|
attachment: DexieAttachmentsTableSchema,
|
||||||
};
|
};
|
||||||
|
|
||||||
chatDatabase.version(1).stores({
|
chatDatabase.version(1).stores({
|
||||||
message: messageTableColumn,
|
message: messageTableColumn,
|
||||||
members: MemberTableColumn,
|
members: MemberTableColumn,
|
||||||
room: RoomTableColumn,
|
room: RoomTableColumn,
|
||||||
typing: TypingTableColumn
|
typing: TypingTableColumn,
|
||||||
|
attachment: AttachmentTableColumn
|
||||||
});
|
});
|
||||||
|
|
||||||
chatDatabase.message.mapToClass(MessageEntity)
|
chatDatabase.message.mapToClass(MessageEntity)
|
||||||
|
|||||||
@@ -15,12 +15,12 @@ const { App } = Plugins;
|
|||||||
const SignalRInputSchema = z.object({
|
const SignalRInputSchema = z.object({
|
||||||
method: z.string(),
|
method: z.string(),
|
||||||
data: z.object({
|
data: z.object({
|
||||||
requestId: z.string()
|
requestId: z.string(),
|
||||||
})
|
}).catchall(z.unknown()), // Allows any additional properties with unknown values
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
export type ISignalRInput = z.infer<typeof SignalRInputSchema>
|
export type ISignalRInput = z.infer<typeof SignalRInputSchema>;
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -92,6 +92,7 @@ export class SignalRService {
|
|||||||
})
|
})
|
||||||
|
|
||||||
this.connection.getMessageDelete().subscribe((data) => {
|
this.connection.getMessageDelete().subscribe((data) => {
|
||||||
|
console.log('delete middleware', data)
|
||||||
this.messageDelete.next(data)
|
this.messageDelete.next(data)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -306,7 +306,7 @@ export class SignalRConnection {
|
|||||||
console.log('DeleteMessage', _message)
|
console.log('DeleteMessage', _message)
|
||||||
this.messageDelete.next(_message);
|
this.messageDelete.next(_message);
|
||||||
this.sendDataSubject.next({
|
this.sendDataSubject.next({
|
||||||
method: 'ReceiveMessage',
|
method: 'DeleteMessage',
|
||||||
data: _message
|
data: _message
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
</ion-refresher>
|
</ion-refresher>
|
||||||
<div class="main-content">
|
<div class="main-content">
|
||||||
<ion-progress-bar class="position-absolute" type="indeterminate" *ngIf="loading"></ion-progress-bar>
|
<ion-progress-bar class="position-absolute" type="indeterminate" *ngIf="loading"></ion-progress-bar>
|
||||||
<ion-virtual-scroll [items]="ChatSystemService.users | filter:textSearch: 'name' " approxItemHeight="70px" [headerFn]="separateLetter">
|
<!-- <ion-virtual-scroll [items]="ChatSystemService.users | filter:textSearch: 'name' " approxItemHeight="70px" [headerFn]="separateLetter">
|
||||||
|
|
||||||
<div class="item-divider" *virtualHeader="let header">
|
<div class="item-divider" *virtualHeader="let header">
|
||||||
<ion-label>{{header}}</ion-label>
|
<ion-label>{{header}}</ion-label>
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</ion-virtual-scroll>
|
</ion-virtual-scroll> -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|||||||
@@ -54,14 +54,28 @@
|
|||||||
|
|
||||||
<div class="d-flex justify-content-between">
|
<div class="d-flex justify-content-between">
|
||||||
<div>
|
<div>
|
||||||
{{ message.message }}
|
<div>
|
||||||
</div>
|
{{ message.message }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div *ngFor="let attachment of message.attachments">
|
||||||
|
<div *ngIf="attachment.fileType == 1">
|
||||||
|
|
||||||
|
<ion-icon src="assets/icon/webtrix.svg" class="file-icon font-25"></ion-icon>
|
||||||
|
<ion-label>{{ attachment.fileName}}</ion-label>
|
||||||
|
<!-- <ion-icon *ngIf="ThemeService.currentTheme == 'default' && attachment.type != 'webtrix' && !( msg.downloadLoader == true || msg.uploadingFile == true ) " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && attachment.type != 'webtrix' && !( msg.downloadLoader == true || msg.uploadingFile == true ) " class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||||
|
<ion-icon *ngIf="( msg.downloadLoader == true || msg.uploadingFile == true )" class="icon-download" src="assets/gif/theme/{{ThemeService.currentTheme}}/Blocks-loader.svg" slot="end"></ion-icon> -->
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<div class="message-item-options d-flex justify-content-end">
|
<div class="message-item-options d-flex justify-content-end">
|
||||||
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer"></fa-icon>
|
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer"></fa-icon>
|
||||||
<mat-menu #beforeMenu="matMenu" xPosition="before">
|
<mat-menu #beforeMenu="matMenu" xPosition="before">
|
||||||
<button (click)="messageDelete({messageId: message.id })" class="menuButton">Apagar mensagem</button>
|
<button (click)="messageDelete(message)" class="menuButton">Apagar mensagem</button>
|
||||||
<button (click)="editMessage(message)" class="menuButton">Editar mensagem</button>
|
<button (click)="editMessage(message)" class="menuButton">Editar mensagem</button>
|
||||||
<button (click)="toggleEmojiPicker(message)" class="menuButton">Reagir mensagem</button>
|
<button (click)="toggleEmojiPicker(message)" class="menuButton">Reagir mensagem</button>
|
||||||
</mat-menu>
|
</mat-menu>
|
||||||
@@ -128,7 +142,7 @@
|
|||||||
</div>
|
</div>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
</div>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|
||||||
<ion-footer>
|
<ion-footer>
|
||||||
@@ -170,26 +184,17 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button #recordbtn *ngIf="!textField && !lastAudioRecorded"
|
<button #recordbtn *ngIf="textField == '' && !lastAudioRecorded" (click)="startRecording()" class="btn-no-color">
|
||||||
(click)="startRecording()" class="btn-no-color">
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/default/icons-chat-record-audio.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send"
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-record-audio.svg"></ion-icon>
|
||||||
src="assets/icon/theme/default/icons-chat-record-audio.svg"></ion-icon>
|
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send"
|
|
||||||
src="assets/icon/theme/gov/icons-chat-record-audio.svg"></ion-icon>
|
|
||||||
</button>
|
</button>
|
||||||
<button *ngIf="textField" class="btn-no-color" (click)="sendMessage()"
|
<button *ngIf="textField != ''" class="btn-no-color" (click)="sendMessage()">
|
||||||
class="btn-no-color">
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send"
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
||||||
src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send"
|
|
||||||
src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
|
||||||
</button>
|
</button>
|
||||||
<button *ngIf="!textField && lastAudioRecorded"
|
<button *ngIf="textField == '' && lastAudioRecorded" class="btn-no-color" (click)="sendAudio(lastAudioRecorded)">
|
||||||
(click)="sendAudio(lastAudioRecorded)" class="btn-no-color">
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send"
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
||||||
src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send"
|
|
||||||
src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -13,14 +13,11 @@ import { ChatOptionsPopoverPage } from 'src/app/shared/popover/chat-options-popo
|
|||||||
import { MessagesOptionsPage } from 'src/app/shared/popover/messages-options/messages-options.page';
|
import { MessagesOptionsPage } from 'src/app/shared/popover/messages-options/messages-options.page';
|
||||||
import { ChatMessageStore } from 'src/app/store/chat/chat-message.service';
|
import { ChatMessageStore } from 'src/app/store/chat/chat-message.service';
|
||||||
import { ChatUserStorage } from 'src/app/store/chat/chat-user.service';
|
import { ChatUserStorage } from 'src/app/store/chat/chat-user.service';
|
||||||
import { environment } from 'src/environments/environment';
|
|
||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
|
|
||||||
import { VoiceRecorder, RecordingData, GenericResponse } from 'capacitor-voice-recorder';
|
import { VoiceRecorder, RecordingData, GenericResponse } from 'capacitor-voice-recorder';
|
||||||
import { Haptics, ImpactStyle } from '@capacitor/haptics';
|
import { Haptics, ImpactStyle } from '@capacitor/haptics';
|
||||||
import { ViewEventPage } from 'src/app/modals/view-event/view-event.page';
|
import { ViewEventPage } from 'src/app/modals/view-event/view-event.page';
|
||||||
// import { ChatSystemService } from 'src/app/services/chat/chat-system.service'
|
|
||||||
// import { MessageService } from 'src/app/services/chat/message.service';
|
|
||||||
import { FileType } from 'src/app/models/fileType';
|
import { FileType } from 'src/app/models/fileType';
|
||||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||||
import { Storage } from '@ionic/storage';
|
import { Storage } from '@ionic/storage';
|
||||||
@@ -52,8 +49,12 @@ import { tap } from 'rxjs/operators';
|
|||||||
import { MessageEntity } from 'src/app/module/chat/domain/entity/message';
|
import { MessageEntity } from 'src/app/module/chat/domain/entity/message';
|
||||||
import { MemberTable } from 'src/app/module/chat/infra/database/dexie/schema/members';
|
import { MemberTable } from 'src/app/module/chat/infra/database/dexie/schema/members';
|
||||||
import { TypingTable } from 'src/app/module/chat/infra/database/dexie/schema/typing';
|
import { TypingTable } from 'src/app/module/chat/infra/database/dexie/schema/typing';
|
||||||
|
import { CameraService } from 'src/app/infra/camera/camera.service'
|
||||||
|
import { MessageAttachmentFileType, MessageAttachmentSource } from 'src/app/module/chat/data/dto/message/messageOutputDTO';
|
||||||
|
import { compressImageBase64 } from 'src/app/utils/imageCompressore';
|
||||||
|
import { FilePickerService } from 'src/app/infra/file-picker/file-picker.service'
|
||||||
|
import { FilePickerMobileService } from 'src/app/infra/file-picker/mobile/file-picker-mobile.service'
|
||||||
|
import { AttachmentsPageRoutingModule } from '../../events/attachments/attachments-routing.module';
|
||||||
|
|
||||||
const IMAGE_DIR = 'stored-images';
|
const IMAGE_DIR = 'stored-images';
|
||||||
|
|
||||||
@@ -155,7 +156,10 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
private roomRepositoryService: RoomRepositoryService,
|
private roomRepositoryService: RoomRepositoryService,
|
||||||
private messageRepositoryService: MessageRepositoryService,
|
private messageRepositoryService: MessageRepositoryService,
|
||||||
private userTypingServiceRepository: UserTypingServiceRepository,
|
private userTypingServiceRepository: UserTypingServiceRepository,
|
||||||
private chatServiceService: ChatServiceService
|
private chatServiceService: ChatServiceService,
|
||||||
|
private CameraService: CameraService,
|
||||||
|
private FilePickerService: FilePickerService,
|
||||||
|
private FilePickerMobileService: FilePickerMobileService
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
|
||||||
@@ -439,8 +443,20 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sendMessage() {
|
sendMessage() {
|
||||||
// this.ChatSystemService.getDmRoom(this.roomId).send({}).then(() => {
|
const message = new MessageEntity();
|
||||||
// })
|
message.message = this.textField
|
||||||
|
message.roomId = this.roomId
|
||||||
|
|
||||||
|
message.sender = {
|
||||||
|
userPhoto: '',
|
||||||
|
wxeMail: SessionStore.user.Email,
|
||||||
|
wxFullName: SessionStore.user.FullName,
|
||||||
|
wxUserId: SessionStore.user.UserId
|
||||||
|
}
|
||||||
|
|
||||||
|
this.chatServiceService.sendMessage(message)
|
||||||
|
|
||||||
|
this.textField = ''
|
||||||
}
|
}
|
||||||
|
|
||||||
/* sendMessage(msg) {
|
/* sendMessage(msg) {
|
||||||
@@ -472,30 +488,26 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
|
|
||||||
//Converting base64 to blob
|
//Converting base64 to blob
|
||||||
const encodedData = btoa(this.audioRecorded);
|
const encodedData = btoa(this.audioRecorded);
|
||||||
const blob = this.fileService.base64toBlob(encodedData, recordData.value.mimeType)
|
|
||||||
|
|
||||||
|
const message = new MessageEntity();
|
||||||
|
message.roomId = this.roomId
|
||||||
|
|
||||||
const validation = await this.FileValidatorService.validateAudioFromBlob(blob)
|
message.sender = {
|
||||||
|
userPhoto: '',
|
||||||
|
wxeMail: SessionStore.user.Email,
|
||||||
|
wxFullName: SessionStore.user.FullName,
|
||||||
|
wxUserId: SessionStore.user.UserId
|
||||||
|
}
|
||||||
|
|
||||||
const formData = new FormData();
|
message.attachments = [{
|
||||||
formData.append("blobFile", blob);
|
file: encodedData,
|
||||||
|
fileName: "audio",
|
||||||
|
source: MessageAttachmentSource.Device,
|
||||||
|
fileType: MessageAttachmentFileType.Audio
|
||||||
|
}]
|
||||||
|
|
||||||
|
this.chatServiceService.sendMessage(message)
|
||||||
|
|
||||||
// this.ChatSystemService.getDmRoom(roomId).send({
|
|
||||||
// file: {
|
|
||||||
// "type": "application/audio",
|
|
||||||
// "msDuration": audioFile.value.msDuration,
|
|
||||||
// "mimeType": audioFile.value.mimeType,
|
|
||||||
// },
|
|
||||||
// attachments: [{
|
|
||||||
// "title": sanitize(fileName),
|
|
||||||
// "title_link_download": true,
|
|
||||||
// "type": "audio"
|
|
||||||
// }],
|
|
||||||
// temporaryData: formData,
|
|
||||||
// attachmentsModelData: {
|
|
||||||
// fileBase64: encodedData,
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
|
|
||||||
});
|
});
|
||||||
this.deleteRecording();
|
this.deleteRecording();
|
||||||
@@ -689,51 +701,47 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async takePicture() {
|
async takePictureMobile() {
|
||||||
|
|
||||||
const roomId = this.roomId
|
const picture = await this.CameraService.takePicture({
|
||||||
|
cameraResultType: CameraResultType.DataUrl,
|
||||||
|
quality: 90
|
||||||
|
})
|
||||||
|
|
||||||
const file = await Camera.getPhoto({
|
if(picture.isOk()) {
|
||||||
quality: 90,
|
const file = picture.value
|
||||||
// allowEditing: true,
|
|
||||||
resultType: CameraResultType.Base64,
|
|
||||||
source: CameraSource.Camera
|
|
||||||
});
|
|
||||||
|
|
||||||
var imageBase64 = 'data:image/jpeg;base64,' + file.base64String
|
const compressedImage = await compressImageBase64(
|
||||||
|
file.dataUrl,
|
||||||
|
800, // maxWidth
|
||||||
|
800, // maxHeight
|
||||||
|
0.9 // quality
|
||||||
|
)
|
||||||
|
|
||||||
|
if(compressedImage.isOk()) {
|
||||||
|
|
||||||
const compressedImage = await this.compressImageBase64(
|
const message = new MessageEntity();
|
||||||
imageBase64,
|
message.roomId = this.roomId
|
||||||
800, // maxWidth
|
|
||||||
800, // maxHeight
|
|
||||||
0.9 // quality
|
|
||||||
).then((picture) => {
|
|
||||||
console.log('Selected: ', picture)
|
|
||||||
imageBase64 = picture
|
|
||||||
});
|
|
||||||
|
|
||||||
//console.log(imageBase64)
|
message.sender = {
|
||||||
const blob = this.dataURItoBlob(imageBase64)
|
userPhoto: '',
|
||||||
|
wxeMail: SessionStore.user.Email,
|
||||||
|
wxFullName: SessionStore.user.FullName,
|
||||||
|
wxUserId: SessionStore.user.UserId
|
||||||
|
}
|
||||||
|
|
||||||
const formData = new FormData();
|
message.attachments = [{
|
||||||
formData.append("blobFile", blob);
|
file: compressedImage.value,
|
||||||
|
fileName: "foto",
|
||||||
|
source: MessageAttachmentSource.Device,
|
||||||
|
fileType: MessageAttachmentFileType.Image
|
||||||
|
}]
|
||||||
|
|
||||||
// this.ChatSystemService.getDmRoom(roomId).send({
|
this.chatServiceService.sendMessage(message)
|
||||||
// file: {
|
|
||||||
// "type": "application/img",
|
}
|
||||||
// "guid": ''
|
|
||||||
// },
|
}
|
||||||
// attachments: [{
|
|
||||||
// "title": "file.jpg",
|
|
||||||
// "text": "description",
|
|
||||||
// "title_link_download": false,
|
|
||||||
// }],
|
|
||||||
// temporaryData: formData,
|
|
||||||
// attachmentsModelData: {
|
|
||||||
// fileBase64: imageBase64,
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -762,13 +770,6 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async addImageMobile() {
|
|
||||||
this.addFileToChatMobile(['image/apng', 'image/jpeg', 'image/png'])
|
|
||||||
}
|
|
||||||
|
|
||||||
async addImage() {
|
|
||||||
this.addFileToChat(['image/apng', 'image/jpeg', 'image/png'])
|
|
||||||
}
|
|
||||||
|
|
||||||
async addFile() {
|
async addFile() {
|
||||||
this.addFileToChat(['.doc', '.docx', '.pdf'])
|
this.addFileToChat(['.doc', '.docx', '.pdf'])
|
||||||
@@ -791,85 +792,130 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
|
|
||||||
if (data.selected) {
|
if (data.selected) {
|
||||||
|
|
||||||
// this.ChatSystemService.getDmRoom(roomId).send({
|
const message = new MessageEntity();
|
||||||
// file: {
|
message.message = this.textField
|
||||||
// "name": res.data.selected.Assunto,
|
message.roomId = this.roomId
|
||||||
// "type": "application/webtrix",
|
|
||||||
// "ApplicationId": res.data.selected.ApplicationType,
|
message.sender = {
|
||||||
// "DocId": res.data.selected.Id,
|
userPhoto: '',
|
||||||
// "Assunto": res.data.selected.Assunto,
|
wxeMail: SessionStore.user.Email,
|
||||||
// },
|
wxFullName: SessionStore.user.FullName,
|
||||||
// temporaryData: res,
|
wxUserId: SessionStore.user.UserId
|
||||||
// attachments: [{
|
}
|
||||||
// "title": res.data.selected.Assunto,
|
message.attachments = [{
|
||||||
// "description": res.data.selected.DocTypeDesc,
|
fileName: res.data.selected.Assunto,
|
||||||
// // "title_link": url_no_options,
|
source: MessageAttachmentSource.Webtrix,
|
||||||
// "title_link_download": true,
|
fileType: MessageAttachmentFileType.Doc,
|
||||||
// "thumb_url": "https://static.ichimura.ed.jp/uploads/2017/10/pdf-icon.png",
|
applicationId: res.data.selected.ApplicationType,
|
||||||
// // "message_link": url_no_options,
|
docId: res.data.selected.Id,
|
||||||
// "text": res.data.selected.DocTypeDesc,
|
}]
|
||||||
// "type": "webtrix"
|
|
||||||
// }],
|
this.chatServiceService.sendMessage(message)
|
||||||
// })
|
this.textField = ''
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async addFileToChatMobile(types: typeof FileType[]) {
|
async pickPicture() {
|
||||||
const roomId = this.roomId
|
|
||||||
|
|
||||||
const file = await Camera.getPhoto({
|
const file = await this.FilePickerService.getPicture({
|
||||||
quality: 90,
|
cameraResultType: CameraResultType.Base64
|
||||||
// allowEditing: true,
|
})
|
||||||
resultType: CameraResultType.Base64,
|
|
||||||
source: CameraSource.Photos
|
|
||||||
});
|
|
||||||
|
|
||||||
//const imageData = await this.fileToBase64Service.convert(file)
|
if(file.isOk()) {
|
||||||
//
|
|
||||||
|
|
||||||
var imageBase64 = 'data:image/jpeg;base64,' + file.base64String
|
var base64 = 'data:image/jpeg;base64,' + file.value.base64String
|
||||||
|
if (file.value.format == "jpeg" || file.value.format == "png" || file.value.format == "gif") {
|
||||||
|
|
||||||
|
const compressedImage = await compressImageBase64(
|
||||||
|
base64,
|
||||||
|
800, // maxWidth
|
||||||
|
800, // maxHeight
|
||||||
|
0.9 // quality
|
||||||
|
)
|
||||||
|
|
||||||
const compressedImage = await this.compressImageBase64(
|
if(compressedImage.isOk()) {
|
||||||
imageBase64,
|
|
||||||
800, // maxWidth
|
|
||||||
800, // maxHeight
|
|
||||||
0.9 // quality
|
|
||||||
).then((picture) => {
|
|
||||||
console.log('Selected: ', picture)
|
|
||||||
imageBase64 = picture
|
|
||||||
});
|
|
||||||
|
|
||||||
//console.log(imageBase64)
|
const message = new MessageEntity();
|
||||||
|
message.roomId = this.roomId
|
||||||
|
|
||||||
const response = await fetch(imageBase64);
|
message.sender = {
|
||||||
const blob = await response.blob();
|
userPhoto: '',
|
||||||
|
wxeMail: SessionStore.user.Email,
|
||||||
|
wxFullName: SessionStore.user.FullName,
|
||||||
|
wxUserId: SessionStore.user.UserId
|
||||||
|
}
|
||||||
|
|
||||||
const formData = new FormData();
|
message.attachments = [{
|
||||||
//console.log('add file', formData)
|
file: compressedImage.value,
|
||||||
formData.append("blobFile", blob);
|
fileName: "foto",
|
||||||
//console.log('add file', formData)
|
source: MessageAttachmentSource.Device,
|
||||||
|
fileType: MessageAttachmentFileType.Image
|
||||||
|
}]
|
||||||
|
|
||||||
// this.ChatSystemService.getDmRoom(roomId).send({
|
this.chatServiceService.sendMessage(message)
|
||||||
// file: {
|
}
|
||||||
// "type": "application/img",
|
}
|
||||||
// "guid": ''
|
|
||||||
// },
|
}
|
||||||
// temporaryData: formData,
|
|
||||||
// attachments: [{
|
|
||||||
// "title": file.path,
|
|
||||||
// "text": "description",
|
|
||||||
// "title_link_download": false,
|
|
||||||
// }],
|
|
||||||
// attachmentsModelData: {
|
|
||||||
// fileBase64: imageBase64,
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// async addFileToChatMobile() {
|
||||||
|
// const roomId = this.roomId
|
||||||
|
|
||||||
|
// const file = await Camera.getPhoto({
|
||||||
|
// quality: 90,
|
||||||
|
// // allowEditing: true,
|
||||||
|
// resultType: CameraResultType.Base64,
|
||||||
|
// source: CameraSource.Photos
|
||||||
|
// });
|
||||||
|
|
||||||
|
// //const imageData = await this.fileToBase64Service.convert(file)
|
||||||
|
// //
|
||||||
|
|
||||||
|
// var imageBase64 = 'data:image/jpeg;base64,' + file.base64String
|
||||||
|
|
||||||
|
|
||||||
|
// const compressedImage = await this.compressImageBase64(
|
||||||
|
// imageBase64,
|
||||||
|
// 800, // maxWidth
|
||||||
|
// 800, // maxHeight
|
||||||
|
// 0.9 // quality
|
||||||
|
// ).then((picture) => {
|
||||||
|
// console.log('Selected: ', picture)
|
||||||
|
// imageBase64 = picture
|
||||||
|
// });
|
||||||
|
|
||||||
|
// //console.log(imageBase64)
|
||||||
|
|
||||||
|
// const response = await fetch(imageBase64);
|
||||||
|
// const blob = await response.blob();
|
||||||
|
|
||||||
|
// const formData = new FormData();
|
||||||
|
// //console.log('add file', formData)
|
||||||
|
// formData.append("blobFile", blob);
|
||||||
|
// //console.log('add file', formData)
|
||||||
|
|
||||||
|
// // this.ChatSystemService.getDmRoom(roomId).send({
|
||||||
|
// // file: {
|
||||||
|
// // "type": "application/img",
|
||||||
|
// // "guid": ''
|
||||||
|
// // },
|
||||||
|
// // temporaryData: formData,
|
||||||
|
// // attachments: [{
|
||||||
|
// // "title": file.path,
|
||||||
|
// // "text": "description",
|
||||||
|
// // "title_link_download": false,
|
||||||
|
// // }],
|
||||||
|
// // attachmentsModelData: {
|
||||||
|
// // fileBase64: imageBase64,
|
||||||
|
// // }
|
||||||
|
// // })
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
getFileReader(): FileReader {
|
getFileReader(): FileReader {
|
||||||
const fileReader = new FileReader();
|
const fileReader = new FileReader();
|
||||||
const zoneOriginalInstance = (fileReader as any)["__zone_symbol__originalInstance"];
|
const zoneOriginalInstance = (fileReader as any)["__zone_symbol__originalInstance"];
|
||||||
@@ -890,7 +936,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
async addFileToChat(types: typeof FileType[]) {
|
async addFileToChat(types) {
|
||||||
console.log('add file ')
|
console.log('add file ')
|
||||||
const roomId = this.roomId
|
const roomId = this.roomId
|
||||||
|
|
||||||
@@ -906,29 +952,25 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
|
|
||||||
console.log('RESULT', resultt.files[0].data)
|
console.log('RESULT', resultt.files[0].data)
|
||||||
|
|
||||||
const blobb = this.fileService.base64toBlob(resultt.files[0].data, resultt.files[0].mimeType)
|
const message = new MessageEntity();
|
||||||
const blob = new Blob([resultt.files[0].data], {type: resultt.files[0].mimeType});
|
message.roomId = this.roomId
|
||||||
|
|
||||||
const formDataa = new FormData();
|
message.sender = {
|
||||||
formDataa.append('blobFile', blobb);
|
userPhoto: '',
|
||||||
/* console.log('add file', fileBase64) */
|
wxeMail: SessionStore.user.Email,
|
||||||
|
wxFullName: SessionStore.user.FullName,
|
||||||
|
wxUserId: SessionStore.user.UserId
|
||||||
|
}
|
||||||
|
|
||||||
|
message.attachments = [{
|
||||||
|
file: resultt.files[0].data,
|
||||||
|
fileName: resultt.files[0].name,
|
||||||
|
source: MessageAttachmentSource.Device,
|
||||||
|
fileType: MessageAttachmentFileType.Doc
|
||||||
|
}]
|
||||||
|
|
||||||
|
this.chatServiceService.sendMessage(message)
|
||||||
|
|
||||||
// this.ChatSystemService.getDmRoom(roomId).send({
|
|
||||||
// file: {
|
|
||||||
// "type": resultt.files[0].mimeType,
|
|
||||||
// "guid": '',
|
|
||||||
// },
|
|
||||||
// attachments: [{
|
|
||||||
// "title": sanitize(resultt.files[0].name),
|
|
||||||
// "name": sanitize(resultt.files[0].name),
|
|
||||||
// // "text": "description",
|
|
||||||
// "title_link_download": false,
|
|
||||||
// }],
|
|
||||||
// temporaryData: formDataa,
|
|
||||||
// attachmentsModelData: {
|
|
||||||
// fileBase64: '',
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
return
|
return
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -937,17 +979,6 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
console.log(file)
|
console.log(file)
|
||||||
|
|
||||||
|
|
||||||
/* const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch ((error) => {
|
|
||||||
console.error(error);
|
|
||||||
})));
|
|
||||||
const blob = this.fileService.base64toBlob(encodedData, file.type)
|
|
||||||
|
|
||||||
const fileBase64 = await this._getBase64(file)
|
|
||||||
|
|
||||||
const formData = new FormData();
|
|
||||||
formData.append('blobFile', blob);
|
|
||||||
console.log('add file', fileBase64) */
|
|
||||||
|
|
||||||
const fileName = file.name
|
const fileName = file.name
|
||||||
|
|
||||||
const validation = this.FileValidatorService.fileNameValidation(fileName)
|
const validation = this.FileValidatorService.fileNameValidation(fileName)
|
||||||
@@ -962,24 +993,27 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
|
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append('blobFile', blob);
|
formData.append('blobFile', blob);
|
||||||
/* console.log('add file', fileBase64) */
|
|
||||||
|
|
||||||
// this.ChatSystemService.getDmRoom(roomId).send({
|
|
||||||
// file: {
|
const message = new MessageEntity();
|
||||||
// "type": file.type,
|
message.roomId = this.roomId
|
||||||
// "guid": '',
|
|
||||||
// },
|
message.sender = {
|
||||||
// attachments: [{
|
userPhoto: '',
|
||||||
// "title": sanitize(fileName),
|
wxeMail: SessionStore.user.Email,
|
||||||
// "name": sanitize(fileName),
|
wxFullName: SessionStore.user.FullName,
|
||||||
// // "text": "description",
|
wxUserId: SessionStore.user.UserId
|
||||||
// "title_link_download": false,
|
}
|
||||||
// }],
|
|
||||||
// temporaryData: formData,
|
message.attachments = [{
|
||||||
// attachmentsModelData: {
|
file: encodedData,
|
||||||
// fileBase64: encodedData,
|
fileName: "doc",
|
||||||
// }
|
source: MessageAttachmentSource.Device,
|
||||||
// });
|
fileType: MessageAttachmentFileType.Doc
|
||||||
|
}]
|
||||||
|
|
||||||
|
this.chatServiceService.sendMessage(message)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.toastService._badRequest("Ficheiro inválido")
|
this.toastService._badRequest("Ficheiro inválido")
|
||||||
}
|
}
|
||||||
@@ -1022,11 +1056,11 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
this.bookMeeting();
|
this.bookMeeting();
|
||||||
}
|
}
|
||||||
else if (res['data'] == 'take-picture') {
|
else if (res['data'] == 'take-picture') {
|
||||||
this.takePicture()
|
this.takePictureMobile()
|
||||||
}
|
}
|
||||||
else if (res['data'] == 'add-picture') {
|
else if (res['data'] == 'add-picture') {
|
||||||
console.log('add-picture')
|
console.log('add-picture')
|
||||||
this.addImageMobile()
|
this.pickPicture()
|
||||||
}
|
}
|
||||||
else if (res['data'] == 'add-document') {
|
else if (res['data'] == 'add-document') {
|
||||||
this.addFile()
|
this.addFile()
|
||||||
@@ -1447,6 +1481,3 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
this.userTypingServiceRepository.addUserTyping(this.roomId)
|
this.userTypingServiceRepository.addUserTyping(this.roomId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
// import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
|
|
||||||
import { ContactRepositoryService } from 'src/app/services/Repositorys/contacts/repository/contacts-repository.service';
|
import { ContactRepositoryService } from 'src/app/services/Repositorys/contacts/repository/contacts-repository.service';
|
||||||
import { UserContacts } from 'src/app/services/Repositorys/contacts/data-source/contacts-data-source.service';
|
import { UserContacts } from 'src/app/services/Repositorys/contacts/data-source/contacts-data-source.service';
|
||||||
import { RoomRepositoryService } from 'src/app/module/chat/data/repository/room-repository.service'
|
import { RoomRepositoryService } from 'src/app/module/chat/data/repository/room-repository.service'
|
||||||
@@ -26,7 +25,6 @@ export class GroupContactsPage implements OnInit {
|
|||||||
@Output() openGroupMessage:EventEmitter<any> = new EventEmitter<any>();
|
@Output() openGroupMessage:EventEmitter<any> = new EventEmitter<any>();
|
||||||
@Output() openGroupContacts:EventEmitter<any> = new EventEmitter<any>();
|
@Output() openGroupContacts:EventEmitter<any> = new EventEmitter<any>();
|
||||||
|
|
||||||
|
|
||||||
currentMembers:UserContacts[];
|
currentMembers:UserContacts[];
|
||||||
allChatUsers: UserContacts[] = [];
|
allChatUsers: UserContacts[] = [];
|
||||||
userContainer: {[key: string]: ( UserContacts & {isChecked: boolean})[] } = {}
|
userContainer: {[key: string]: ( UserContacts & {isChecked: boolean})[] } = {}
|
||||||
@@ -59,13 +57,13 @@ export class GroupContactsPage implements OnInit {
|
|||||||
id: this.roomId,
|
id: this.roomId,
|
||||||
members: this.selectedUsers
|
members: this.selectedUsers
|
||||||
})
|
})
|
||||||
if(addMembers.isOk()) {
|
// if(addMembers.isOk()) {
|
||||||
// this.addContacts(this.roomId);
|
// // this.addContacts(this.roomId);
|
||||||
this.openGroupMessage.emit(this.roomId);
|
// this.openGroupMessage.emit(this.roomId);
|
||||||
this.RoomRepositoryService.getRoomById(this.roomId)
|
// this.RoomRepositoryService.getRoomById(this.roomId)
|
||||||
} else if(addMembers.error instanceof HttpRequest) {
|
// } else if(addMembers.error instanceof HttpRequest) {
|
||||||
this.httpErrorHandle.httpStatusHandle(addMembers.error)
|
// this.httpErrorHandle.httpStatusHandle(addMembers.error)
|
||||||
}
|
// }
|
||||||
} else {
|
} else {
|
||||||
this.openGroupMessage.emit(this.roomId);
|
this.openGroupMessage.emit(this.roomId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<div class="main-header">
|
<div class="main-header">
|
||||||
<div class="header-top">
|
<div class="header-top">
|
||||||
<div class="middle">
|
<div class="middle">
|
||||||
<ion-label class="title">{{ ChatSystemService.getGroupRoom(roomId).name.split('-').join(' ') }}</ion-label>
|
<!-- <ion-label class="title">{{ ChatSystemService.getGroupRoom(roomId).name.split('-').join(' ') }}</ion-label> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<!-- <div (click)=" ChatSystemService.getGroupRoom(this.roomId).deleteAll()">delete all</div> -->
|
<!-- <div (click)=" ChatSystemService.getGroupRoom(this.roomId).deleteAll()">delete all</div> -->
|
||||||
@@ -18,11 +18,11 @@
|
|||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/icon/icons-user.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/icon/icons-user.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/icon/theme/gov/icons-user.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/icon/theme/gov/icons-user.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="header-bottom-contacts" *ngIf="ChatSystemService.getGroupRoom(roomId)">
|
<!-- <div class="header-bottom-contacts" *ngIf="ChatSystemService.getGroupRoom(roomId)">
|
||||||
<ion-label class="contacts-list" *ngFor="let member of ChatSystemService.getGroupRoom(roomId).membersExcludeMe; let last = last" >
|
<ion-label class="contacts-list" *ngFor="let member of ChatSystemService.getGroupRoom(roomId).membersExcludeMe; let last = last" >
|
||||||
{{member.name}}<span *ngIf="!last">, </span>
|
{{member.name}}<span *ngIf="!last">, </span>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
<ion-label>A conversa original mantêm-se como chat individual</ion-label>
|
<ion-label>A conversa original mantêm-se como chat individual</ion-label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of ChatSystemService.getGroupRoom(roomId).messages; let last = last">
|
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of []; let last = last">
|
||||||
<div class="message-item incoming-{{msg.u.username!=sessionStore.user.UserName}} max-width-45" *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'au' && msg.t != 'ru' && msg.msg !=''" [class.dateLabel]="msg.dateLabel">
|
<div class="message-item incoming-{{msg.u.username!=sessionStore.user.UserName}} max-width-45" *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'au' && msg.t != 'ru' && msg.msg !=''" [class.dateLabel]="msg.dateLabel">
|
||||||
<div class="message-item-options d-flex justify-content-end" *ngIf="!msg.dateLabel">
|
<div class="message-item-options d-flex justify-content-end" *ngIf="!msg.dateLabel">
|
||||||
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer"></fa-icon>
|
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer"></fa-icon>
|
||||||
@@ -213,7 +213,7 @@
|
|||||||
{{last ? scrollToBottom() : ''}}
|
{{last ? scrollToBottom() : ''}}
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="msg.t == 'au' && msg.msg != sessionStore.user.UserName">
|
<div *ngIf="msg.t == 'au' && msg.msg != sessionStore.user.UserName">
|
||||||
<div *ngFor="let user of ChatSystemService.users">
|
<div *ngFor="let user of []">
|
||||||
<div *ngIf="msg.msg == user.username" class="info-text-leave">
|
<div *ngIf="msg.msg == user.username" class="info-text-leave">
|
||||||
<ion-label>Adicionou {{user.name}}</ion-label><br />
|
<ion-label>Adicionou {{user.name}}</ion-label><br />
|
||||||
</div>
|
</div>
|
||||||
@@ -252,15 +252,15 @@
|
|||||||
|
|
||||||
<ion-footer>
|
<ion-footer>
|
||||||
|
|
||||||
<div class="typing" *ngIf="ChatSystemService.getGroupRoom(roomId).otherUserType == true">
|
|
||||||
|
|
||||||
<ngx-letters-avatar *ngIf="showAvatar"
|
<!-- <div class="typing" >
|
||||||
|
<ngx-letters-avatar *ngIf="showAvatar"
|
||||||
[avatarName]= "ChatSystemService.getGroupRoom(roomId).name"
|
[avatarName]= "ChatSystemService.getGroupRoom(roomId).name"
|
||||||
[width]="30"
|
[width]="30"
|
||||||
[circular]="true"
|
[circular]="true"
|
||||||
fontFamily="Roboto"></ngx-letters-avatar>
|
fontFamily="Roboto"></ngx-letters-avatar>
|
||||||
{{ ChatSystemService.getGroupRoom(roomId).userThatIsTyping }} está a escrever...
|
{{ ChatSystemService.getGroupRoom(roomId).userThatIsTyping }} está a escrever...
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
<div class="width-100 pl-20 pr-20">
|
<div class="width-100 pl-20 pr-20">
|
||||||
<span *ngIf="!lastAudioRecorded">{{durationDisplay}}</span>
|
<span *ngIf="!lastAudioRecorded">{{durationDisplay}}</span>
|
||||||
@@ -298,7 +298,7 @@
|
|||||||
|
|
||||||
<div class="width-100">
|
<div class="width-100">
|
||||||
<div *ngIf="!recording && !lastAudioRecorded" class="type-message">
|
<div *ngIf="!recording && !lastAudioRecorded" class="type-message">
|
||||||
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" (keyup.enter)="sendMessage()" clearOnEdit="true" placeholder="Escrever uma mensagem" class="message-input" rows="1" [(ngModel)]="ChatSystemService.getGroupRoom(roomId).message" (ionChange)="ChatSystemService.getGroupRoom(roomId).sendTyping()"></ion-textarea>
|
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" (keyup.enter)="sendMessage()" clearOnEdit="true" placeholder="Escrever uma mensagem" class="message-input" rows="1" ></ion-textarea>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="recording" class="d-flex align-items-center justify-content-center">
|
<div *ngIf="recording" class="d-flex align-items-center justify-content-center">
|
||||||
<button (click)="stopRecording()" class="btn-no-color d-flex align-items-center justify-content-center">
|
<button (click)="stopRecording()" class="btn-no-color d-flex align-items-center justify-content-center">
|
||||||
@@ -307,7 +307,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="btn-send">
|
<!-- <div class="btn-send">
|
||||||
<button #recordbtn *ngIf="!ChatSystemService.getGroupRoom(roomId).message && !lastAudioRecorded" (click)="startRecording()" class="btn-no-color">
|
<button #recordbtn *ngIf="!ChatSystemService.getGroupRoom(roomId).message && !lastAudioRecorded" (click)="startRecording()" class="btn-no-color">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/default/icons-chat-record-audio.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/default/icons-chat-record-audio.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-record-audio.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-record-audio.svg"></ion-icon>
|
||||||
@@ -320,7 +320,7 @@
|
|||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
</ion-footer>
|
</ion-footer>
|
||||||
|
|
||||||
|
|||||||
@@ -44,14 +44,30 @@
|
|||||||
<div class="messages height-100 width-100 d-flex flex-column" #scrollMe >
|
<div class="messages height-100 width-100 d-flex flex-column" #scrollMe >
|
||||||
|
|
||||||
<div
|
<div
|
||||||
*ngFor="let message of (roomMessage$ | async)" class="messages-list-item-wrapper"
|
*ngFor="let message of messages1[roomId]" class="messages-list-item-wrapper"
|
||||||
[ngClass]="{'my-message': message.sender.wxUserId === sessionStore.user.UserId, 'other-message': message.sender.wxUserId !== sessionStore.user.UserId}"
|
[ngClass]="{'my-message': message.sender.wxUserId === sessionStore.user.UserId, 'other-message': message.sender.wxUserId !== sessionStore.user.UserId}"
|
||||||
>
|
>
|
||||||
<div class="message-container">
|
<div class="message-container">
|
||||||
|
|
||||||
<div class="d-flex justify-content-between">
|
<div class="d-flex justify-content-between">
|
||||||
<div>
|
<div>
|
||||||
{{ message.message }}
|
<div>
|
||||||
|
{{ message.message }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div *ngFor="let attachment of message.attachment">
|
||||||
|
<div *ngIf="attachment.fileType == 1">
|
||||||
|
|
||||||
|
<ion-icon src="assets/icon/webtrix.svg" class="file-icon font-25"></ion-icon>
|
||||||
|
<ion-label>{{ attachment.fileName}}</ion-label>
|
||||||
|
<!-- <ion-icon *ngIf="ThemeService.currentTheme == 'default' && attachment.type != 'webtrix' && !( msg.downloadLoader == true || msg.uploadingFile == true ) " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && attachment.type != 'webtrix' && !( msg.downloadLoader == true || msg.uploadingFile == true ) " class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||||
|
<ion-icon *ngIf="( msg.downloadLoader == true || msg.uploadingFile == true )" class="icon-download" src="assets/gif/theme/{{ThemeService.currentTheme}}/Blocks-loader.svg" slot="end"></ion-icon> -->
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
import { AfterViewInit, Component, ElementRef, EventEmitter, HostListener, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core';
|
import { AfterViewInit, Component, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core';
|
||||||
import { AnimationController, GestureController, IonRange, ModalController, PopoverController } from '@ionic/angular';
|
import { AnimationController, GestureController, IonRange, ModalController, PopoverController } from '@ionic/angular';
|
||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
import { ChatOptionsPopoverPage } from 'src/app/shared/popover/chat-options-popover/chat-options-popover.page';
|
|
||||||
import { MessagesOptionsPage } from 'src/app/shared/popover/messages-options/messages-options.page';
|
|
||||||
import { ContactsPage } from '../new-group/contacts/contacts.page';
|
import { ContactsPage } from '../new-group/contacts/contacts.page';
|
||||||
import { ChatOptionsFeaturesPage } from 'src/app/modals/chat-options-features/chat-options-features.page';
|
import { ChatOptionsFeaturesPage } from 'src/app/modals/chat-options-features/chat-options-features.page';
|
||||||
import { ChatMessageStore } from 'src/app/store/chat/chat-message.service';
|
import { ChatMessageStore } from 'src/app/store/chat/chat-message.service';
|
||||||
@@ -12,12 +10,10 @@ import { FileService } from 'src/app/services/functions/file.service';
|
|||||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||||
import { ThemeService } from 'src/app/services/theme.service';
|
import { ThemeService } from 'src/app/services/theme.service';
|
||||||
import { ViewEventPage } from 'src/app/modals/view-event/view-event.page';
|
import { ViewEventPage } from 'src/app/modals/view-event/view-event.page';
|
||||||
import { Storage } from '@ionic/storage';
|
|
||||||
import { FileType } from 'src/app/models/fileType';
|
import { FileType } from 'src/app/models/fileType';
|
||||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||||
import { Camera, CameraResultType, CameraSource } from '@capacitor/camera';
|
import { CameraResultType } from '@capacitor/camera';
|
||||||
import { DocumentViewer, DocumentViewerOptions } from '@ionic-native/document-viewer';
|
import { RecordingData } from 'capacitor-voice-recorder';
|
||||||
import { VoiceRecorder, RecordingData, GenericResponse } from 'capacitor-voice-recorder';
|
|
||||||
import { Filesystem, Directory } from '@capacitor/filesystem';
|
import { Filesystem, Directory } from '@capacitor/filesystem';
|
||||||
import { DomSanitizer } from '@angular/platform-browser';
|
import { DomSanitizer } from '@angular/platform-browser';
|
||||||
import { Platform } from '@ionic/angular';
|
import { Platform } from '@ionic/angular';
|
||||||
@@ -29,7 +25,7 @@ import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
|
|||||||
import { PermissionService } from 'src/app/services/permission.service';
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
import { ChatPopoverPage } from '../../popover/chat-popover/chat-popover.page';
|
import { ChatPopoverPage } from '../../popover/chat-popover/chat-popover.page';
|
||||||
import { Observable as DexieObservable } from 'Dexie';
|
import { Observable as DexieObservable } from 'Dexie';
|
||||||
import { Observable, Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
import { MessageRepositoryService } from 'src/app/module/chat/data/repository/message-respository.service'
|
import { MessageRepositoryService } from 'src/app/module/chat/data/repository/message-respository.service'
|
||||||
import { RoomRepositoryService } from 'src/app/module/chat/data/repository/room-repository.service'
|
import { RoomRepositoryService } from 'src/app/module/chat/data/repository/room-repository.service'
|
||||||
import { MessageTable } from 'src/app/module/chat/infra/database/dexie/schema/message';
|
import { MessageTable } from 'src/app/module/chat/infra/database/dexie/schema/message';
|
||||||
@@ -45,9 +41,10 @@ import { JSFileToBase64 } from 'src/app/utils/ToBase64';
|
|||||||
import { CameraService } from 'src/app/infra/camera/camera.service'
|
import { CameraService } from 'src/app/infra/camera/camera.service'
|
||||||
import { compressImageBase64 } from '../../../utils/imageCompressore';
|
import { compressImageBase64 } from '../../../utils/imageCompressore';
|
||||||
import { FilePickerWebService } from 'src/app/infra/file-picker/web/file-picker-web.service'
|
import { FilePickerWebService } from 'src/app/infra/file-picker/web/file-picker-web.service'
|
||||||
|
import { FilePickerService } from 'src/app/infra/file-picker/file-picker.service'
|
||||||
import { allowedDocExtension } from 'src/app/utils/allowedDocExtension';
|
import { allowedDocExtension } from 'src/app/utils/allowedDocExtension';
|
||||||
import { SpeakerService, StartRecordingResultError, StopRecordingResultError } from 'src/app/infra/speaker/speaker.service'
|
import { SpeakerService, StartRecordingResultError, StopRecordingResultError } from 'src/app/infra/speaker/speaker.service'
|
||||||
const IMAGE_DIR = 'stored-images';
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-messages',
|
selector: 'app-messages',
|
||||||
templateUrl: './messages.page.html',
|
templateUrl: './messages.page.html',
|
||||||
@@ -59,7 +56,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
@ViewChild('scrollMe') private myScrollContainer: ElementRef;
|
@ViewChild('scrollMe') private myScrollContainer: ElementRef;
|
||||||
@ViewChild('message-item') messageContainer: ElementRef;
|
@ViewChild('message-item') messageContainer: ElementRef;
|
||||||
|
|
||||||
messages: any;
|
|
||||||
dm: any;
|
dm: any;
|
||||||
userPresence = '';
|
userPresence = '';
|
||||||
dmUsers: any;
|
dmUsers: any;
|
||||||
@@ -116,6 +112,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
roomName: any;
|
roomName: any;
|
||||||
isAdmin = true;
|
isAdmin = true;
|
||||||
roomCountDownDate: string;
|
roomCountDownDate: string;
|
||||||
|
audioMimeType = ''
|
||||||
|
|
||||||
textField = ''
|
textField = ''
|
||||||
|
|
||||||
@@ -132,18 +129,24 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
totalMessage = 0
|
totalMessage = 0
|
||||||
recordData:RecordingData
|
recordData:RecordingData
|
||||||
|
|
||||||
|
messages: MessageEntity[] = []
|
||||||
|
|
||||||
|
messageReceiveSubject: Subscription
|
||||||
|
messageDeleteSubject: Subscription
|
||||||
|
messageUpdateSubject: Subscription
|
||||||
|
messageSendSubject: Subscription
|
||||||
|
|
||||||
|
messages1: {[key: string]: MessageEntity[]} = {}
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public popoverController: PopoverController,
|
public popoverController: PopoverController,
|
||||||
private modalController: ModalController,
|
private modalController: ModalController,
|
||||||
/* private navParams: NavParams, */
|
|
||||||
private animationController: AnimationController,
|
private animationController: AnimationController,
|
||||||
private toastService: ToastService,
|
private toastService: ToastService,
|
||||||
private timeService: TimeService,
|
private timeService: TimeService,
|
||||||
private fileService: FileService,
|
private fileService: FileService,
|
||||||
private gestureController: GestureController,
|
private gestureController: GestureController,
|
||||||
public ThemeService: ThemeService,
|
public ThemeService: ThemeService,
|
||||||
private storage: Storage,
|
|
||||||
// public RochetChatConnectorService: RochetChatConnectorService,
|
|
||||||
private sanitiser: DomSanitizer,
|
private sanitiser: DomSanitizer,
|
||||||
private file: File,
|
private file: File,
|
||||||
private platform: Platform,
|
private platform: Platform,
|
||||||
@@ -155,6 +158,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
private chatServiceService: ChatServiceService,
|
private chatServiceService: ChatServiceService,
|
||||||
private CameraService: CameraService,
|
private CameraService: CameraService,
|
||||||
private FilePickerWebService: FilePickerWebService,
|
private FilePickerWebService: FilePickerWebService,
|
||||||
|
private FilePickerService: FilePickerService,
|
||||||
private SpeakerService: SpeakerService
|
private SpeakerService: SpeakerService
|
||||||
) {
|
) {
|
||||||
// update
|
// update
|
||||||
@@ -163,9 +167,13 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
|
|
||||||
ngOnChanges(changes: SimpleChanges): void {
|
ngOnChanges(changes: SimpleChanges): void {
|
||||||
this.roomData$ = this.roomRepositoryService.getItemByIdLive(this.roomId)
|
this.roomData$ = this.roomRepositoryService.getItemByIdLive(this.roomId)
|
||||||
|
this.getMessages()
|
||||||
|
this.listenToIncomingMessage()
|
||||||
|
this.listenToDeleteMessage()
|
||||||
|
this.listenToUpdateMessage();
|
||||||
|
this.listenToSendMessage()
|
||||||
|
|
||||||
this.roomMessage$ = this.messageRepositoryService.getItemsLive(this.roomId)
|
this.roomMessage$ = this.messageRepositoryService.getItemsLive(this.roomId)
|
||||||
|
|
||||||
this.roomMembers$ = this.roomRepositoryService.getRoomMemberByIdLive(this.roomId) as any
|
this.roomMembers$ = this.roomRepositoryService.getRoomMemberByIdLive(this.roomId) as any
|
||||||
this.roomStatus$ = this.roomRepositoryService.getRoomStatus(this.roomId)
|
this.roomStatus$ = this.roomRepositoryService.getRoomStatus(this.roomId)
|
||||||
this.roomRepositoryService.getRoomById(this.roomId)
|
this.roomRepositoryService.getRoomById(this.roomId)
|
||||||
@@ -179,25 +187,77 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
|
|
||||||
(this.myInputRef.nativeElement as HTMLDivElement).innerHTML = '::'+ uniqueArray
|
(this.myInputRef.nativeElement as HTMLDivElement).innerHTML = '::'+ uniqueArray
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
this.newMessagesStream?.unsubscribe()
|
async getMessages() {
|
||||||
this.newMessagesStream = this.messageRepositoryService.subscribeToNewMessages(this.roomId).subscribe((e) => {
|
this.messages1[this.roomId] = []
|
||||||
|
|
||||||
setTimeout(() => {
|
const messages = await this.messageRepositoryService.getItems(this.roomId)
|
||||||
this.scrollToBottomClicked()
|
this.messages1[this.roomId].unshift(...messages)
|
||||||
}, 200)
|
}
|
||||||
|
|
||||||
setTimeout(() => {
|
listenToIncomingMessage() {
|
||||||
this.scrollToBottomClicked()
|
this.messageReceiveSubject?.unsubscribe();
|
||||||
}, 500)
|
this.messageReceiveSubject = this.chatServiceService.listenToIncomingMessage(this.roomId).subscribe((message) => {
|
||||||
|
this.messages1[this.roomId].push(message as MessageEntity)
|
||||||
|
this.scrollToBottomClicked()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
})
|
listenToDeleteMessage() {
|
||||||
|
this.messageDeleteSubject?.unsubscribe();
|
||||||
|
|
||||||
//this.userTyping$ = this.userTypingMemoryDataSource.select(state => state) as any
|
this.messageDeleteSubject = this.chatServiceService.listenToDeleteMessage(this.roomId).subscribe((deleteMessage) => {
|
||||||
|
console.log('delete class', deleteMessage);
|
||||||
|
|
||||||
// let a = this.userTypingMemoryDataSource.select(state => state).subscribe((e) => {
|
const index = this.messages1[this.roomId].findIndex(e => e?.id === deleteMessage.id); // Use triple equals for comparison
|
||||||
// this.userTyping$ = e as any
|
|
||||||
// })
|
if (index !== -1) { // Check if the item was found
|
||||||
|
console.log('delete ==')
|
||||||
|
this.messages1[this.roomId].splice(index, 1);
|
||||||
|
// console.log('removed index', index);
|
||||||
|
} else {
|
||||||
|
// console.log('message not found');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
listenToUpdateMessage() {
|
||||||
|
this.messageUpdateSubject?.unsubscribe();
|
||||||
|
|
||||||
|
this.messageUpdateSubject = this.chatServiceService.listenToUpdateMessage(this.roomId).subscribe((updateMessage) => {
|
||||||
|
console.log('update message', updateMessage);
|
||||||
|
|
||||||
|
const index = this.messages1[this.roomId].findIndex(e => e?.id === updateMessage.id); // Use triple equals for comparison
|
||||||
|
|
||||||
|
if (index !== -1) { // Check if the item was found
|
||||||
|
console.log('update ==')
|
||||||
|
this.messages1[this.roomId][index].message = updateMessage.message
|
||||||
|
this.messages1[this.roomId][index].reactions = updateMessage.reactions
|
||||||
|
} else {
|
||||||
|
// console.log('message not found');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
listenToSendMessage() {
|
||||||
|
this.messageSendSubject?.unsubscribe();
|
||||||
|
|
||||||
|
this.messageSendSubject = this.chatServiceService.listenToSendMessage(this.roomId).subscribe((updateMessage) => {
|
||||||
|
console.log('update message', updateMessage);
|
||||||
|
|
||||||
|
const index = this.messages1[this.roomId].findIndex(e => e?.requestId === updateMessage.requestId); // Use triple equals for comparison
|
||||||
|
|
||||||
|
if (index !== -1) { // Check if the item was found
|
||||||
|
console.log('update ==')
|
||||||
|
|
||||||
|
this.messages1[this.roomId][index].id = updateMessage.id
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// console.log('message not found');
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -409,9 +469,9 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
this.recording = false;
|
this.recording = false;
|
||||||
const recordData = stop.value
|
const recordData = stop.value
|
||||||
this.recordData = recordData
|
this.recordData = recordData
|
||||||
|
this.audioMimeType = recordData.value.mimeType
|
||||||
if (recordData.value.recordDataBase64.includes('data:audio')) {
|
if (recordData.value.recordDataBase64.includes('data:audio')) {
|
||||||
console.log({recordData})
|
console.log({recordData})
|
||||||
|
|
||||||
this.audioRecordedDataUrl = recordData.value.recordDataBase64
|
this.audioRecordedDataUrl = recordData.value.recordDataBase64
|
||||||
this.audioRecordedSafe = this.sanitiser.bypassSecurityTrustResourceUrl(recordData.value.recordDataBase64);
|
this.audioRecordedSafe = this.sanitiser.bypassSecurityTrustResourceUrl(recordData.value.recordDataBase64);
|
||||||
}
|
}
|
||||||
@@ -448,11 +508,16 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
file: encodedData,
|
file: encodedData,
|
||||||
fileName: "audio",
|
fileName: "audio",
|
||||||
source: MessageAttachmentSource.Device,
|
source: MessageAttachmentSource.Device,
|
||||||
fileType: MessageAttachmentFileType.Audio
|
fileType: MessageAttachmentFileType.Audio,
|
||||||
|
mimeType: this.audioMimeType
|
||||||
|
|
||||||
}]
|
}]
|
||||||
|
|
||||||
this.chatServiceService.sendMessage(message)
|
this.chatServiceService.sendMessage(message)
|
||||||
|
this.messages1[this.roomId].push(message)
|
||||||
|
setTimeout(() => {
|
||||||
|
this.scrollToBottomClicked()
|
||||||
|
}, 100)
|
||||||
|
|
||||||
this.deleteRecording();
|
this.deleteRecording();
|
||||||
}
|
}
|
||||||
@@ -490,7 +555,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
await modal.present();
|
await modal.present();
|
||||||
}
|
}
|
||||||
|
|
||||||
sendMessage() {
|
async sendMessage() {
|
||||||
|
|
||||||
const message = new MessageEntity();
|
const message = new MessageEntity();
|
||||||
message.message = this.textField
|
message.message = this.textField
|
||||||
@@ -503,9 +568,16 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
wxUserId: SessionStore.user.UserId
|
wxUserId: SessionStore.user.UserId
|
||||||
}
|
}
|
||||||
|
|
||||||
this.chatServiceService.sendMessage(message)
|
|
||||||
|
|
||||||
this.textField = ''
|
this.textField = ''
|
||||||
|
this.messages1[this.roomId].push(message)
|
||||||
|
setTimeout(() => {
|
||||||
|
this.scrollToBottomClicked()
|
||||||
|
}, 100)
|
||||||
|
const data = await this.chatServiceService.sendMessage(message)
|
||||||
|
|
||||||
|
|
||||||
|
console.log({data})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -676,9 +748,14 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
file: compressedImage.value,
|
file: compressedImage.value,
|
||||||
fileName: "foto",
|
fileName: "foto",
|
||||||
source: MessageAttachmentSource.Device,
|
source: MessageAttachmentSource.Device,
|
||||||
fileType: MessageAttachmentFileType.Image
|
fileType: MessageAttachmentFileType.Image,
|
||||||
|
mimeType: picture.value.format
|
||||||
}]
|
}]
|
||||||
|
|
||||||
|
this.messages1[this.roomId].push(message)
|
||||||
|
setTimeout(() => {
|
||||||
|
this.scrollToBottomClicked()
|
||||||
|
}, 100)
|
||||||
this.chatServiceService.sendMessage(message)
|
this.chatServiceService.sendMessage(message)
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -729,6 +806,10 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
docId: res.data.selected.Id,
|
docId: res.data.selected.Id,
|
||||||
}]
|
}]
|
||||||
|
|
||||||
|
this.messages1[this.roomId].push(message)
|
||||||
|
setTimeout(() => {
|
||||||
|
this.scrollToBottomClicked()
|
||||||
|
}, 100)
|
||||||
this.chatServiceService.sendMessage(message)
|
this.chatServiceService.sendMessage(message)
|
||||||
this.textField = ''
|
this.textField = ''
|
||||||
|
|
||||||
@@ -740,7 +821,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
|
|
||||||
async pickPicture() {
|
async pickPicture() {
|
||||||
|
|
||||||
const file = await this.FilePickerWebService.getPicture({
|
const file = await this.FilePickerService.getPicture({
|
||||||
cameraResultType: CameraResultType.Base64
|
cameraResultType: CameraResultType.Base64
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -769,12 +850,19 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
}
|
}
|
||||||
|
|
||||||
message.attachments = [{
|
message.attachments = [{
|
||||||
file: compressedImage.value,
|
file: file.value.base64String,
|
||||||
fileName: "foto",
|
fileName: "foto",
|
||||||
source: MessageAttachmentSource.Device,
|
source: MessageAttachmentSource.Device,
|
||||||
fileType: MessageAttachmentFileType.Image
|
fileType: MessageAttachmentFileType.Image,
|
||||||
|
mimeType: 'image/'+file.value.format,
|
||||||
|
description: ''
|
||||||
|
|
||||||
}]
|
}]
|
||||||
|
|
||||||
|
this.messages1[this.roomId].push(message)
|
||||||
|
setTimeout(() => {
|
||||||
|
this.scrollToBottomClicked()
|
||||||
|
}, 100)
|
||||||
this.chatServiceService.sendMessage(message)
|
this.chatServiceService.sendMessage(message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -821,9 +909,14 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
file: fileBase64.value,
|
file: fileBase64.value,
|
||||||
fileName: file.value.name,
|
fileName: file.value.name,
|
||||||
source: MessageAttachmentSource.Device,
|
source: MessageAttachmentSource.Device,
|
||||||
fileType: MessageAttachmentFileType.Doc
|
fileType: MessageAttachmentFileType.Doc,
|
||||||
|
mimeType: file.value.type
|
||||||
}]
|
}]
|
||||||
|
|
||||||
|
this.messages1[this.roomId].push(message)
|
||||||
|
setTimeout(() => {
|
||||||
|
this.scrollToBottomClicked()
|
||||||
|
}, 100)
|
||||||
this.chatServiceService.sendMessage(message)
|
this.chatServiceService.sendMessage(message)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
-2
@@ -1,7 +1,11 @@
|
|||||||
{
|
{
|
||||||
// Comments are supported, like tsconfig.json
|
// Comments are supported, like tsconfig.json
|
||||||
"entryPoints": [
|
"entryPoints": [
|
||||||
"./src/app/utils/*.ts"
|
"./src/app/utils/*.ts",
|
||||||
|
"./src/app/infra/camera/*.ts",
|
||||||
|
"./src/app/infra/**/*.ts",
|
||||||
|
"./src/app/module/**/*.ts",
|
||||||
|
//"./src/app/infra/repository/dexie/dexie-repository.service.ts",
|
||||||
] ,
|
] ,
|
||||||
"out": "doc/TypeDoc"
|
"out": "doc/TypeDoc",
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user