improvements

This commit is contained in:
tiago.kayaya
2021-01-13 10:02:30 +01:00
parent 6596941cdd
commit 586651e95e
18 changed files with 591 additions and 205 deletions
+188 -67
View File
@@ -1920,6 +1920,88 @@
"resolved": "https://registry.npmjs.org/@capacitor/android/-/android-2.4.0.tgz",
"integrity": "sha512-5sJicZjtuBRgtmBuV1kvWnIjlu7bnw2TGGp62UXf0ZrjvMUCYSFHBqIHZ8neffW7a3xM5cdGMUlxJ+HfA9ntAg=="
},
"@capacitor/cli": {
"version": "2.4.5",
"resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-2.4.5.tgz",
"integrity": "sha512-nv0IRd3xnif8kIvAFk+ssEkwqZ8n0DvLuB7s0CmtRvMf6Rns02TTYndtV/YkSVja4JbrKb9FrcMd2aLu9KJEIg==",
"requires": {
"chalk": "^2.3.0",
"commander": "^4.1.1",
"compare-versions": "^3.1.0",
"fs-extra": "^4.0.3",
"inquirer": "6.3.1",
"open": "^6.1.0",
"ora": "^1.3.0",
"plist": "^3.0.1",
"semver": "^5.4.1",
"which": "^1.3.0",
"xml2js": "^0.4.19"
},
"dependencies": {
"cli-cursor": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz",
"integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=",
"requires": {
"restore-cursor": "^2.0.0"
}
},
"cli-spinners": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-1.3.1.tgz",
"integrity": "sha512-1QL4544moEsDVH9T/l6Cemov/37iv1RtoKf7NJ04A60+4MREXNfx/QvavbH6QoGdsD4N4Mwy49cmaINR/o2mdg=="
},
"log-symbols": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz",
"integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==",
"requires": {
"chalk": "^2.0.1"
}
},
"mimic-fn": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz",
"integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ=="
},
"onetime": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz",
"integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=",
"requires": {
"mimic-fn": "^1.0.0"
}
},
"ora": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/ora/-/ora-1.4.0.tgz",
"integrity": "sha512-iMK1DOQxzzh2MBlVsU42G80mnrvUhqsMh74phHtDlrcTZPK0pH6o7l7DRshK+0YsxDyEuaOkziVdvM3T0QTzpw==",
"requires": {
"chalk": "^2.1.0",
"cli-cursor": "^2.1.0",
"cli-spinners": "^1.0.1",
"log-symbols": "^2.1.0"
}
},
"restore-cursor": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz",
"integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=",
"requires": {
"onetime": "^2.0.0",
"signal-exit": "^3.0.2"
}
}
}
},
"@capacitor/core": {
"version": "2.4.5",
"resolved": "https://registry.npmjs.org/@capacitor/core/-/core-2.4.5.tgz",
"integrity": "sha512-3GfDAN3s8ajglbn0X6wS+1mtmLwtaBNyvrje3qZ7mzRGVOMWLlOL+n2EeA9IlhMyp8KbQFwXr7gKUk6DjMAKUQ==",
"requires": {
"tslib": "^1.9.0"
}
},
"@capacitor/ios": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/@capacitor/ios/-/ios-2.4.0.tgz",
@@ -3362,6 +3444,11 @@
"integrity": "sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA==",
"dev": true
},
"ansi-escapes": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz",
"integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ=="
},
"ansi-html": {
"version": "0.0.7",
"resolved": "https://registry.npmjs.org/ansi-html/-/ansi-html-0.0.7.tgz",
@@ -3377,7 +3464,6 @@
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true,
"requires": {
"color-convert": "^1.9.0"
}
@@ -3655,37 +3741,6 @@
"integrity": "sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA==",
"dev": true
},
"axios": {
"version": "0.19.2",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz",
"integrity": "sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==",
"requires": {
"follow-redirects": "1.5.10"
},
"dependencies": {
"debug": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
"requires": {
"ms": "2.0.0"
}
},
"follow-redirects": {
"version": "1.5.10",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz",
"integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==",
"requires": {
"debug": "=3.1.0"
}
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
}
}
},
"axobject-query": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.0.2.tgz",
@@ -4344,7 +4399,6 @@
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
"dev": true,
"requires": {
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
@@ -4354,8 +4408,7 @@
"chardet": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz",
"integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==",
"dev": true
"integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA=="
},
"cheerio": {
"version": "1.0.0-rc.3",
@@ -4519,8 +4572,7 @@
"cli-width": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz",
"integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==",
"dev": true
"integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw=="
},
"cliui": {
"version": "5.0.0",
@@ -4672,6 +4724,11 @@
"delayed-stream": "~1.0.0"
}
},
"commander": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz",
"integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA=="
},
"commondir": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
@@ -4681,8 +4738,7 @@
"compare-versions": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz",
"integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==",
"dev": true
"integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA=="
},
"component-bind": {
"version": "1.0.0",
@@ -6533,8 +6589,7 @@
"escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
"dev": true
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
},
"eslint-scope": {
"version": "4.0.3",
@@ -6784,7 +6839,6 @@
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz",
"integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==",
"dev": true,
"requires": {
"chardet": "^0.7.0",
"iconv-lite": "^0.4.24",
@@ -6920,6 +6974,14 @@
"integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==",
"dev": true
},
"figures": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz",
"integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=",
"requires": {
"escape-string-regexp": "^1.0.5"
}
},
"file-loader": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/file-loader/-/file-loader-6.0.0.tgz",
@@ -7148,6 +7210,16 @@
"resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
"integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow=="
},
"fs-extra": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz",
"integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==",
"requires": {
"graceful-fs": "^4.1.2",
"jsonfile": "^4.0.0",
"universalify": "^0.1.0"
}
},
"fs-minipass": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz",
@@ -7403,8 +7475,7 @@
"has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
"dev": true
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0="
},
"has-symbols": {
"version": "1.0.1",
@@ -7866,7 +7937,6 @@
"version": "0.4.24",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
"dev": true,
"requires": {
"safer-buffer": ">= 2.1.2 < 3"
}
@@ -8004,6 +8074,63 @@
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.7.tgz",
"integrity": "sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ=="
},
"inquirer": {
"version": "6.3.1",
"resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.3.1.tgz",
"integrity": "sha512-MmL624rfkFt4TG9y/Jvmt8vdmOo836U7Y0Hxr2aFk3RelZEGX4Igk0KabWrcaaZaTv9uzglOqWh1Vly+FAWAXA==",
"requires": {
"ansi-escapes": "^3.2.0",
"chalk": "^2.4.2",
"cli-cursor": "^2.1.0",
"cli-width": "^2.0.0",
"external-editor": "^3.0.3",
"figures": "^2.0.0",
"lodash": "^4.17.11",
"mute-stream": "0.0.7",
"run-async": "^2.2.0",
"rxjs": "^6.4.0",
"string-width": "^2.1.0",
"strip-ansi": "^5.1.0",
"through": "^2.3.6"
},
"dependencies": {
"cli-cursor": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz",
"integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=",
"requires": {
"restore-cursor": "^2.0.0"
}
},
"mimic-fn": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz",
"integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ=="
},
"mute-stream": {
"version": "0.0.7",
"resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz",
"integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s="
},
"onetime": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz",
"integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=",
"requires": {
"mimic-fn": "^1.0.0"
}
},
"restore-cursor": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz",
"integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=",
"requires": {
"onetime": "^2.0.0",
"signal-exit": "^3.0.2"
}
}
}
},
"internal-ip": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/internal-ip/-/internal-ip-4.3.0.tgz",
@@ -8357,8 +8484,7 @@
"is-wsl": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz",
"integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=",
"dev": true
"integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0="
},
"isarray": {
"version": "1.0.0",
@@ -8696,7 +8822,6 @@
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
"integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=",
"dev": true,
"requires": {
"graceful-fs": "^4.1.6"
}
@@ -10388,6 +10513,14 @@
"mimic-fn": "^2.1.0"
}
},
"open": {
"version": "6.4.0",
"resolved": "https://registry.npmjs.org/open/-/open-6.4.0.tgz",
"integrity": "sha512-IFenVPgF70fSm1keSd2iDBIDIBZkroLeuffXq+wKTzTJlBpesFWojV9lb8mzOfaAzM1sr7HQHuO0vtV0zYekGg==",
"requires": {
"is-wsl": "^1.1.0"
}
},
"opn": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/opn/-/opn-5.5.0.tgz",
@@ -12630,8 +12763,7 @@
"run-async": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz",
"integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==",
"dev": true
"integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ=="
},
"run-parallel": {
"version": "1.1.9",
@@ -12672,8 +12804,7 @@
"safer-buffer": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
"dev": true
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
"sass": {
"version": "1.26.3",
@@ -12737,8 +12868,7 @@
"sax": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==",
"dev": true
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
},
"schema-utils": {
"version": "2.7.0",
@@ -13867,7 +13997,6 @@
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
"integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
"dev": true,
"requires": {
"ansi-regex": "^4.1.0"
},
@@ -13875,8 +14004,7 @@
"ansi-regex": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
"integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
"dev": true
"integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg=="
}
}
},
@@ -14035,7 +14163,6 @@
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"dev": true,
"requires": {
"has-flag": "^3.0.0"
}
@@ -14298,8 +14425,7 @@
"through": {
"version": "2.3.8",
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
"integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=",
"dev": true
"integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU="
},
"through2": {
"version": "2.0.5",
@@ -14336,7 +14462,6 @@
"version": "0.0.33",
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",
"integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==",
"dev": true,
"requires": {
"os-tmpdir": "~1.0.2"
}
@@ -14639,8 +14764,7 @@
"universalify": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
"integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==",
"dev": true
"integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg=="
},
"unorm": {
"version": "1.6.0",
@@ -15794,7 +15918,6 @@
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
"dev": true,
"requires": {
"isexe": "^2.0.0"
}
@@ -15943,7 +16066,6 @@
"version": "0.4.23",
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz",
"integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==",
"dev": true,
"requires": {
"sax": ">=0.6.0",
"xmlbuilder": "~11.0.0"
@@ -15952,8 +16074,7 @@
"xmlbuilder": {
"version": "11.0.1",
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz",
"integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==",
"dev": true
"integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA=="
}
}
},
+3 -1
View File
@@ -20,6 +20,8 @@
"@angular/platform-browser-dynamic": "~9.1.6",
"@angular/router": "~9.1.6",
"@capacitor/android": "^2.4.0",
"@capacitor/cli": "^2.4.5",
"@capacitor/core": "^2.4.5",
"@capacitor/ios": "^2.4.0",
"@fullcalendar/angular": "^5.3.0",
"@fullcalendar/daygrid": "^5.3.0",
@@ -36,7 +38,7 @@
"@ionic/pwa-elements": "^3.0.1",
"@ionic/storage": "^2.3.1",
"@logisticinfotech/ionic4-datepicker": "^1.4.4",
"axios": "^0.19.2",
"axios": "^0.21.1",
"cordova-ios": "6.1.0",
"cordova-plugin-camera": "^5.0.1",
"cordova-plugin-file": "^6.0.2",
+1 -1
View File
@@ -1,6 +1,6 @@
/* This file stores all the keys */
export class AuthConnstants{
/* My reference key */
public static readonly AUTH = 'user';
public static readonly AUTH = 'userDataKey';
public static readonly PROFILE = 'profile';
}
+5
View File
@@ -0,0 +1,5 @@
export class Status {
_id: string;
status: string;
success: boolean;
}
+1 -1
View File
@@ -196,7 +196,7 @@ export class AgendaPage implements OnInit {
this.eventSource=[];
if(this.profile == "mdgpr"){
this.eventService.getAllMdEvents(formatDate(startTime, 'yyyy-MM-dd HH:mm:ss', 'pt'), formatDate(endTime, 'yyyy-MM-dd HH:mm:ss', 'pt')).subscribe(response => {
this.eventsListPessoal = response.filter(data => data.CalendarName == "Pessoal");;
this.eventsListPessoal = response.filter(data => data.CalendarName == "Pessoal");
this.eventsListPessoal.forEach(element => {
this.eventSource.push({
title: element.Subject,
+21 -17
View File
@@ -36,30 +36,34 @@
<ion-list *ngSwitchCase="'Contactos'">
<ion-item-group>
<ion-item-sliding>
<ion-item *ngFor="let user of userConnectedList" (click)="openMessages()">
<!-- <ion-item *ngFor="let user of userConnectedList" (click)="openMessages()">
<ion-icon slot="start" src="assets/images/icons-chat-chat-40.svg" class="iconschatchat-40"></ion-icon>
<div>
<h3>{{user.name}}</h3>
<p>Podemos marcar reunião para amanha</p>
</div>
</ion-item>
<div class="item">
</ion-item> -->
<div *ngFor="let dm of userDirectMessages" class="item">
<div class="item-icon">
<ion-icon class="icon" slot="start" src="assets/images/icons-chat-chat-40.svg"></ion-icon>
</div>
<div (click)="openMessages()" class="item-content">
<div (click)="openMessages(dm)" class="item-content">
<div class="item-title-time">
<div class="item-title">
<ion-label>Secretário para o sector Geral</ion-label>
<ion-label *ngFor="let user of dm.usernames">
<span *ngIf="user !=loggedUser.me.username">
{{user}}
</span>
</ion-label>
</div>
<div class="item-date">15:00</div>
<div class="item-date">{{dm.lastMessage._updatedAt | date: 'HH:mm'}}</div>
</div>
<div class="item-description">
<p>Podemos marcar reunião para amanha</p>
<ion-label>{{dm.lastMessage.msg}}</ion-label>
</div>
</div>
</div>
<div class="item">
<!-- <div class="item">
<div class="item-icon">
<ion-icon class="icon" slot="start" src="assets/images/icons-chat-chat-40.svg"></ion-icon>
</div>
@@ -90,37 +94,37 @@
<p>Podemos marcar reunião para amanha</p>
</div>
</div>
</div>
</div> -->
</ion-item-sliding>
</ion-item-group>
</ion-list>
<ion-list *ngSwitchCase="'Grupos'" >
<ion-item-group>
<ion-item-sliding>
<ion-item *ngFor="let group of groupList">
<!-- <ion-item *ngFor="let group of allGroups">
<ion-icon slot="start" src="assets/images/icons-chat-group-chat-40.svg" class="iconschatgroup-chat-40"></ion-icon>
<div>
<h3>{{group.name}}</h3>
<p>Grande momento.</p>
</div>
</ion-item>
<div class="item">
</ion-item> -->
<div *ngFor="let group of allGroups" class="item">
<div class="item-icon">
<ion-icon class="icon" slot="start" src="assets/images/icons-chat-group-chat-40.svg"></ion-icon>
</div>
<div (click)="openGroupMessages()" class="item-content">
<div class="item-title-time">
<div class="item-title">
<ion-label>Secretário para o sector Produtivo</ion-label>
<ion-label>{{group.name}}</ion-label>
</div>
<div class="item-date">15:00</div>
<div class="item-date">{{group.lastMessage._updatedAt | date: 'HH:mm'}}</div>
</div>
<div class="item-description">
<p>Podemos marcar reunião para amanha</p>
<ion-label>{{group.lastMessage.u.name}}: {{group.lastMessage.msg}}</ion-label>
</div>
</div>
</div>
<div class="item">
<!-- <div class="item">
<div class="item-icon">
<ion-icon class="icon" slot="start" src="assets/images/icons-chat-group-chat-40.svg"></ion-icon>
</div>
@@ -135,7 +139,7 @@
<p>Podemos marcar reunião para amanha</p>
</div>
</div>
</div>
</div> -->
</ion-item-sliding>
</ion-item-group>
+94 -16
View File
@@ -1,3 +1,4 @@
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { ModalController } from '@ionic/angular';
import { AuthService } from 'src/app/services/auth.service';
@@ -15,51 +16,122 @@ import { NewchatPage } from './newchat/newchat.page';
styleUrls: ['./chat.page.scss'],
})
export class ChatPage implements OnInit {
headers: HttpHeaders;
options:any;
X_User_Id:any;
X_Auth_Token:any;
showLoader: boolean;
loggedUser: any;
/* Set segment variable */
segment:string;
groupList: any[];
allGroups: any[];
privateGroups: any[];
publicGroups: any[];
userConnectedList: any[];
userRooms: any[];
userChannels: any[];
userDirectMessages: any[];
result:any;
dmUsers:any;
constructor(
private http:HttpClient,
private chatService: ChatService,
private modalController: ModalController,
private authService: AuthService
) { }
private authService: AuthService,
) {
this.headers = new HttpHeaders();
this.headers = this.headers.set('X-User-Id', 'GqjNWiLrGEHRna7Zn');
this.headers = this.headers.set('X-Auth-Token', 'SJwIgtlqfloPK696fpc2VBvyDluipuIHKB_0Q6-9ycJ');
}
ngOnInit() {
this.segment = "Contactos";
this.authService.userData$.subscribe((res:any)=>{
this.loggedUser=res;
console.log(this.loggedUser);
});
this.doRefresh();
/* this.authService.getUserData(); */
this.loadJoinedRooms();
}
loadJoinedRooms(){
this.chatService.loadJoinedRooms().subscribe(res => {
console.log(res);
});
}
onSegmentChange(){
this.doRefresh();
}
doRefresh(){
/* this.getGroups(); */
this.getConnectedUsers();
this.getDirectMessages();
/* this.getConnectedRooms(); */
/* this.getConnectedChannels(); */
this.getGroups();
/* this.getConnectedUsers(); */
}
/* getGroups(){
getGroups(){
this.showLoader = true;
this.result = this.chatService.getAllPrivateGroups().subscribe((res:any)=>{
this.groupList = res.groups;
this.privateGroups = res.groups;
this.result = this.chatService.getAllUserChannels().subscribe((res:any)=>{
this.publicGroups = res.channels;
this.allGroups = this.privateGroups.concat(this.publicGroups);
this.showLoader = false;
});
});
}
getDirectMessages(){
this.showLoader = true;
this.result = this.chatService.getAllDirectMessages().subscribe((res:any)=>{
this.userDirectMessages = res.ims;
console.log(this.userDirectMessages);
this.showLoader = false;
});
}
getChatMembers(){
this.chatService.getMembers(this.userDirectMessages[0]._id).subscribe(res=> {
this.dmUsers = res['members'].filter(data => data.username != this.loggedUser.me.username)
console.log(res);
console.log(this.dmUsers);
});
}
/* getConnectedChannels(){
this.showLoader = true;
this.result = this.chatService.getAllUserChannels().subscribe((res:any)=>{
this.userChannels = res.channels;
console.log(res);
this.showLoader = false;
});
} */
getConnectedUsers(){
/* getConnectedRooms(){
this.showLoader = true;
this.result = this.chatService.getAllRooms().subscribe((res:any)=>{
this.userRooms = res.update;
console.log(res.update);
this.showLoader = false;
});
} */
/* getConnectedUsers(){
this.showLoader = true;
this.result = this.chatService.getAllConnectedUsers().subscribe((res:any)=>{
/* this.userConnectedList = res.users; */
/* console.log(res); */
this.userConnectedList = res.users;
this.showLoader = false;
});
}
});
} */
async startConversation(selectedUser) {
const modal = await this.modalController.create({
@@ -91,20 +163,26 @@ export class ChatPage implements OnInit {
await modal.present();
modal.onDidDismiss();
}
async openMessages(){
async openMessages(dm:any){
const modal = await this.modalController.create({
component: MessagesPage,
cssClass: 'group-messages',
backdropDismiss: false,
componentProps: {
dm: dm,
},
});
await modal.present();
modal.onDidDismiss();
}
async openGroupMessages(){
async openGroupMessages(user:any){
const modal = await this.modalController.create({
component: GroupMessagesPage,
cssClass: 'group-messages',
backdropDismiss: false,
componentProps: {
user: user,
},
});
await modal.present();
modal.onDidDismiss();
+18 -13
View File
@@ -4,8 +4,8 @@
<div class="header-top">
<app-btn-modal-dismiss></app-btn-modal-dismiss>
<div class="middle">
<ion-label class="title">Bruno Faria</ion-label>
<span><ion-icon class="user-status-online" name="ellipse"></ion-icon></span>
<ion-label class="title" *ngFor="let users of dmUsers">{{users.name}}</ion-label>
<span *ngIf="userPresence =='online'"><ion-icon class="user-status-online" name="ellipse"></ion-icon></span>
</div>
<div class="right">
<ion-icon (click)="openMessagesOptions()" src="assets/images/icons-menu.svg"></ion-icon>
@@ -24,8 +24,13 @@
</ion-header>
<ion-content>
<div class="messages">
<div class="incoming">
<div class="messages" #scrollMe>
<!-- <ion-infinite-scroll position="top" threshold="25%" (ionInfinite)="loadMoreMessages($event)">
<ion-infinite-scroll-content loadindSpiniter="crescent" loadingText="Carregando...">
</ion-infinite-scroll-content>
</ion-infinite-scroll> -->
<!-- <div class="incoming">
<div class="title">
<ion-label>Secretário Assuntos sociais</ion-label>
<span class="time">14:23</span>
@@ -34,17 +39,17 @@
<img src='assets/images/1.jpg' tappable>
<ion-label hidden >Investidura Filipe Nyusi</ion-label>
</div>
</div>
<div class="incoming">
</div> -->
<div *ngFor="let msg of messages" class='incoming-{{msg.u.username!=loggedUser.me.username}}'>
<div class="title">
<ion-label>Secretário Assuntos sociais</ion-label>
<span class="time">14:23</span>
<ion-label>{{msg.u.name}}</ion-label>
<span class="time">{{msg._updatedAt | date: 'HH:mm' }}</span>
</div>
<div>
<ion-label>Caros colegas, partilho o momento de confraternização do presidente Filipe Nyusi e de dua excelência, o presidente da república</ion-label>
<ion-label>{{msg.msg}}</ion-label>
</div>
</div>
<div class="incoming">
<!-- <div class="incoming">
<div class="title">
<ion-label>Presidente da República</ion-label>
<span class="time">14:23</span>
@@ -79,7 +84,7 @@
<div>
<ion-label>Caros colegas, partilho o momento de confraternização do presidente Filipe Nyusi e de dua excelência, o presidente da república</ion-label>
</div>
</div>
</div> -->
</div>
</ion-content>
@@ -93,14 +98,14 @@
</ion-col>
<ion-col size="9">
<ion-item class="ion-no-padding type-message" lines="none">
<ion-textarea placeholder="Escrever uma mensagem" auto-grow class="message-input" rows="1" [(ngModel)]="message"></ion-textarea>
<ion-textarea clearOnEdit="true" placeholder="Escrever uma mensagem" auto-grow class="message-input" rows="1" [(ngModel)]="message"></ion-textarea>
<ion-icon slot="end" src="assets/icon/icons-chat-mic.svg"></ion-icon>
</ion-item>
</ion-col>
<ion-col size="2">
<!-- [disabled]="message === ''" -->
<ion-label>
<ion-icon class="chat-icon-send" src="assets/icon/icons-chat-send.svg"></ion-icon>
<ion-icon (click)="sendMessage()" class="chat-icon-send" src="assets/icon/icons-chat-send.svg"></ion-icon>
</ion-label>
</ion-col>
</ion-row>
+16 -3
View File
@@ -100,20 +100,33 @@
font-family: Roboto;
overflow: auto;
.incoming, .outgoing{
//set scroll do bottom
position: absolute;
top: 0;
left: 0;
overflow-x: hidden;
overflow-y: auto;
width: 100%;
height: 100%;
word-wrap: break-word;
-webkit-overflow-scrolling: touch;
.incoming-true, .incoming-false{
width: 305px;
padding: 15px 20px;
border-radius: 10px;
}
.incoming{
.incoming-true{
margin: 10px 75px 10px 20px;
background: #ebebeb;
float: left;
}
}
.outgoing{
.incoming-false{
margin: 10px 20px 10px 75px;
background: #e4f4fe;
float: right;
+92 -5
View File
@@ -1,5 +1,8 @@
import { Component, OnInit } from '@angular/core';
import { ModalController, PopoverController } from '@ionic/angular';
import { AfterViewChecked, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
import { Status } from 'src/app/models/chat/status.model';
import { AuthService } from 'src/app/services/auth.service';
import { ChatService } from 'src/app/services/chat.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';
@@ -9,24 +12,108 @@ import { ContactsPage } from '../new-group/contacts/contacts.page';
templateUrl: './messages.page.html',
styleUrls: ['./messages.page.scss'],
})
export class MessagesPage implements OnInit {
export class MessagesPage implements OnInit, AfterViewChecked {
@ViewChild('scrollMe') private myScrollContainer: ElementRef;
loggedUser: any;
message = '';
messages:any;
dm:any;
userPresence='';
dmUsers:any;
constructor(
public popoverController: PopoverController,
private modalController: ModalController,
) { }
private navParams: NavParams,
private chatService: ChatService,
private authService: AuthService,
) {
this.dm = this.navParams.get('dm');
}
ngOnInit() {
this.scrollToBottom();
this.authService.userData$.subscribe((res:any)=>{
this.loggedUser=res;
console.log(this.loggedUser);
});
console.log(this.dm);
setInterval(()=>{
this.checkUserPresence();
this.loadMessages();
}, 2000);
this.getChatMembers();
}
loadUser(){
console.log('working');
}
ngAfterViewChecked() {
this.scrollToBottom();
}
scrollToBottom(): void {
try {
this.myScrollContainer.nativeElement.scrollTop = this.myScrollContainer.nativeElement.scrollHeight;
} catch(err) { }
}
loadMoreMessages(ev:any){
}
checkUserPresence(){
this.chatService.getUserPresence(this.dm.lastMessage.u._id).subscribe(res=>{
this.userPresence = res['presence'];
});
}
sendMessage(){
let body = {
"message":
{
"rid": this.dm._id, "msg": this.message
}
}
this.chatService.sendMessage(body).subscribe(res=> {
/* console.log(res); */
this.loadMessages();
});
}
loadMessages(){
this.chatService.getRoomMessages(this.dm._id).subscribe(res => {
console.log(res);
this.messages = res['messages'].reverse();
})
}
getChatMembers(){
this.chatService.getMembers(this.dm._id).subscribe(res=> {
this.dmUsers = res['members'].filter(data => data.username != this.loggedUser.me.username)
console.log(res);
console.log(this.dmUsers);
});
}
async openMessagesOptions(ev: any) {
const popover = await this.popoverController.create({
component: MessagesOptionsPage,
componentProps: {
roomId: this.dm._id,
},
cssClass: 'messages-options',
event: ev,
translucent: true
translucent: true,
});
return await popover.present();
}
+3 -1
View File
@@ -131,7 +131,9 @@ export class EventsPage implements OnInit {
if(this.profile == "mdgpr"){
this.eventService.getAllMdEvents(formatDate(new Date(), 'yyyy-MM-dd HH:mm:ss', 'pt') /* + ' 00:00:00' */, formatDate(new Date(), 'yyyy-MM-dd', 'pt') + ' 23:59:59').subscribe(res => {
this.eventsList = res;
this.currentEvent = res[0].Subject;
if(res.length > 0){
this.currentEvent = res[0].Subject;
}
this.totalEvent = this.eventsList.length;
this.showLoader = false;
});
+1 -1
View File
@@ -57,7 +57,7 @@ export class LoginPage implements OnInit {
loginRocketChat(){
this.authService.loginChat(this.postData).subscribe((res: any) =>{
this.storageService.store(res);
this.storageService.store(AuthConnstants.AUTH, res.data);
console.log('Login to Rocket chat OK');
},(error:any) =>{
console.log('Network error');
+1 -1
View File
@@ -8,6 +8,6 @@ export class UserDataResolver{
constructor(private authService: AuthService){}
resolve(){
/* return this.authService.getUserData(); */
return this.authService.getUserData();
}
}
+8 -17
View File
@@ -47,37 +47,28 @@ export class AuthService {
//Login to rocketChat server
loginChat(postData: any):Observable<any> {
const res = this.httpService.post('login', postData);
const res2 = res.subscribe(res=>{
this.storageService.store(res);
});
return res;
return this.httpService.post('login', postData);
}
//Get user data from RocketChat
//Get user data from RocketChat | global object
getUserData(){
const res = this.storageService.get('user');
console.log(res);
/* this.storageService.get(AuthConnstants.AUTH).then(res=>{
this.storageService.get(AuthConnstants.AUTH).then(res=>{
this.userData$.next(res);
}) */
});
}
/* getProfile(){
getProfile(){
this.storageService.get(AuthConnstants.PROFILE).then(res=>{
return res;
});
} */
}
logoutChat(){
//this.storageService.clear();
/* this.storageService.removeStorageItem(AuthConnstants.AUTH).then(res =>{
this.storageService.removeStorageItem(AuthConnstants.AUTH).then(res =>{
this.userData$.next('');
this.router.navigate(['']);
}) */
})
}
}
+101 -35
View File
@@ -1,4 +1,4 @@
import { HttpHeaders } from '@angular/common/http';
import { HttpHeaders, HttpParams } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from "rxjs"
import { AuthService } from './auth.service';
@@ -14,6 +14,7 @@ import { Storage } from '@ionic/storage';
export class ChatService {
headers: HttpHeaders;
options:any;
options1:any;
X_User_Id:any;
X_Auth_Token:any;
@@ -25,48 +26,113 @@ export class ChatService {
private storage: Storage,
private storageService:StorageService,) {
this.headers = new HttpHeaders();
this.storage.get('user').then((val) => {
console.log(JSON.parse(unescape(atob(val))).data.userId);
let user = JSON.parse(unescape(atob(val))).data;
this.headers = this.headers.set('X-User-Id', user.userId);
console.log(user.userId);
this.X_User_Id = user.userId;
this.headers = this.headers.set('X-Auth-Token', user.authToken);
console.log(user.authToken);
this.X_Auth_Token = user.authToken;
this.options = {
headers: {
'X-User-Id': this.X_User_Id,
'X-Auth-Token': this.X_Auth_Token
},
};
this.getAllConnectedUsers(this.options);
});
/* this.authService.userData$.subscribe((res:any)=>{
/* this.headers = this.headers.set('X-User-Id', 'GqjNWiLrGEHRna7Zn');
this.headers = this.headers.set('X-Auth-Token', 'dAM0ZOTAy8jzQA_vS25z2IrnSc6sYLfi5rmaa35YNUz'); */
-
this.authService.userData$.subscribe((res:any)=>{
this.headers = this.headers.set('X-User-Id', res.userId);
this.headers = this.headers.set('X-Auth-Token', res.authToken);
}); */
});
this.options = {
headers: {
'X-User-Id': this.X_User_Id,
'X-Auth-Token': this.X_Auth_Token
},
headers: this.headers,
};
}
getAllUsers(){
console.log(this.headers);
/* return this.http.get(environment.apiChatUrl+'users.list', this.options); */
/* getUser(){
this.storage.get('user').then((val) => {
let user = JSON.parse(unescape(atob(val))).data;
this.headers = this.headers.set('X-User-Id', user.userId);
this.headers = this.headers.set('X-Auth-Token', user.authToken);
this.options1 = {
headers: this.headers,
};
console.log(this.options1);
this.http.get(environment.apiChatUrl+'users.presence', this.options1).subscribe(res => {
console.log(res);
});
});
} */
getAllDirectMessages(){
return this.http.get(environment.apiChatUrl+'im.list', this.options);
}
getAllConnectedUsers(opts){
console.log(opts);
return this.http.get(environment.apiChatUrl+'users.presence', opts);
getAllChannels(){
return this.http.get(environment.apiChatUrl+'channels.list', this.options);
}
getAllUserChannels(){
return this.http.get(environment.apiChatUrl+'channels.list.joined', this.options);
}
getAllRooms(){
return this.http.get(environment.apiChatUrl+'rooms.get', this.options);
}
getAllPrivateGroups(){
/* return this.http.get(environment.apiChatUrl+'groups.list', this.options); */
return this.http.get(environment.apiChatUrl+'groups.list', this.options);
}
getAllUsers(){
return this.http.get(environment.apiChatUrl+'users.list', this.options);
}
getAllConnectedUsers(){
return this.http.get(environment.apiChatUrl+'users.presence', this.options);
}
//Check whether user is online or offline
getUserPresence(id:any){
let params = new HttpParams();
params = params.set("userId", id);
let opts = {
headers: this.headers,
params: params
}
return this.http.get(environment.apiChatUrl+'users.getPresence', opts);
}
//Load messages from roomId
loadJoinedRooms(){
return this.http.get(environment.apiChatUrl+'im.list', this.options);
}
//Load messages from roomId
getRoomMessages(roomId:any){
let params = new HttpParams();
params = params.set("roomId", roomId);
let opts = {
headers: this.headers,
params: params
}
return this.http.get(environment.apiChatUrl+'im.history', opts);
}
sendMessage(body:any){
let opts = {
headers: this.headers,
}
return this.http.post(environment.apiChatUrl+'chat.sendMessage', body, opts);
}
//Load members from a chat
getMembers(roomId:any){
let params = new HttpParams();
params = params.set("roomId", roomId);
let opts = {
headers: this.headers,
params: params
}
return this.http.get(environment.apiChatUrl+'im.members', opts);
}
removeChatRoom(body:any){
let opts = {
headers: this.headers,
}
return this.http.post(environment.apiChatUrl+'im.close', body, opts);
}
}
+18 -22
View File
@@ -1,37 +1,33 @@
import { Injectable } from '@angular/core';
import { Storage } from '@ionic/storage';
import { AuthConnstants } from '../config/auth-constants';
import { Plugins } from '@capacitor/core';
const { Storage } = Plugins;
@Injectable({
providedIn: 'root'
})
export class StorageService {
user: any = "Max";
storageKey = "user";
constructor(private storage: Storage) {}
constructor() {}
// set a key/value2
store(user:any){
const encryptedValue = btoa(escape(JSON.stringify(user)));
this.storage.set(AuthConnstants.AUTH, encryptedValue);
// Store the value
async store(storageKey: string, value: any) {
const encryptedValue = btoa(escape(JSON.stringify(value)));
await Storage.set({
key: storageKey,
value: encryptedValue
});
}
// Or to get a key/value pair
get(key:any){
let user = this.storage.get(key).then((val) => {
console.log(JSON.parse(unescape(atob(val))).data);
return JSON.parse(unescape(atob(val))).data;
});
return user;
// Get the value
async get(storageKey: string) {
const ret = await Storage.get({ key: storageKey });
return JSON.parse(unescape(atob(ret.value)));
}
/* async removeStorageItem(storageKey: string) {
await this.storage.remove({ key: storageKey });
} */
async removeStorageItem(storageKey: string) {
await Storage.remove({ key: storageKey });
}
// Clear storage
async clear() {
await this.storage.clear();
await Storage.clear();
}
}
@@ -4,7 +4,7 @@
<button (click)="close()" full class="btn-cancel" shape="round" >Cancelar</button>
</ion-col>
<ion-col>
<button full class="btn-delete" shape="round" >Apagar conversa</button>
<button (click)="closeChatRoom()" full class="btn-delete" shape="round" >Apagar conversa</button>
</ion-col>
</ion-row>
</ion-content>
@@ -1,5 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { PopoverController } from '@ionic/angular';
import { NavParams, PopoverController } from '@ionic/angular';
import { ChatService } from 'src/app/services/chat.service';
@Component({
selector: 'app-messages-options',
@@ -8,9 +9,16 @@ import { PopoverController } from '@ionic/angular';
})
export class MessagesOptionsPage implements OnInit {
roomId:string;
constructor(
private popoverController: PopoverController
) { }
private popoverController: PopoverController,
private chatService: ChatService,
private navParams: NavParams,
)
{
this.roomId = this.navParams.get('roomId');
}
ngOnInit() {
}
@@ -19,4 +27,12 @@ export class MessagesOptionsPage implements OnInit {
this.popoverController.dismiss();
}
closeChatRoom(){
let body = { "roomId": this.roomId }
this.chatService.removeChatRoom(body).subscribe(res=>{
console.log(res);
});
this.close();
}
}