Browse Source

update sessao 2

master
pedro.luis@sitana.pt 5 years ago
parent
commit
85eaae7b8f
5 changed files with 33 additions and 11 deletions
  1. BIN
      dbs/social.mv.db
  2. +24
    -3
      public/scripts/main.js
  3. +1
    -1
      public/scripts/main.js.map
  4. +7
    -6
      server/services/pessoas/get.js
  5. +1
    -1
      ui/src/containers/TabelaPessoas/index.jsx

BIN
dbs/social.mv.db View File


+ 24
- 3
public/scripts/main.js View File

@ -80048,9 +80048,9 @@ var DashboardContainer = /*#__PURE__*/function (_Component) {
var counter = this.state.counter;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
className: "my-dashboard"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_TabelaPessoas_index_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
className: "my-dashboard__button"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_TabelaPessoas_index_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_MyButton_index_jsx__WEBPACK_IMPORTED_MODULE_1__["default"], {
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_MyButton_index_jsx__WEBPACK_IMPORTED_MODULE_1__["default"], {
mainRef: this.button,
text: "ReactJS \u26A1 Ant.Design \uD83D\uDC49 Click me! ".concat(counter),
click: this.click
@ -80111,6 +80111,8 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var antd_lib_table__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(antd_lib_table__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var antd_lib_tag__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! antd/lib/tag */ "./node_modules/antd/lib/tag/index.js");
/* harmony import */ var antd_lib_tag__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(antd_lib_tag__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var antd_lib_notification__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd/lib/notification */ "./node_modules/antd/lib/notification/index.js");
/* harmony import */ var antd_lib_notification__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(antd_lib_notification__WEBPACK_IMPORTED_MODULE_4__);
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@ -80128,6 +80130,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
var TabelaPessoas = function TabelaPessoas(_ref) {
var buttonRef = _ref.buttonRef,
text = _ref.text,
@ -80144,6 +80147,19 @@ var TabelaPessoas = function TabelaPessoas(_ref) {
setCarregando = _useState4[1];
Object(react__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(function () {
setCarregando(true);
var _fail = function fail() {
setCarregando(false);
antd_lib_notification__WEBPACK_IMPORTED_MODULE_4___default.a["error"]({
message: 'Tabela de Pessoas',
description: 'Houve uma falha ao carregar a tabela das pessoas..',
style: {
marginTop: 100
}
});
};
netuno.service({
method: "GET",
url: "/services/pessoas",
@ -80151,10 +80167,15 @@ var TabelaPessoas = function TabelaPessoas(_ref) {
sucess: function sucess(response) {
if (response.json) {
setTabelaDados(response.json);
setCarregando(false);
} else {
_fail();
}
},
fail: function fail(e) {
console.log("Erro ao carregar dados");
_fail();
}
});
}, []);
@ -80186,7 +80207,7 @@ var TabelaPessoas = function TabelaPessoas(_ref) {
};
TabelaPessoas.propTypes = {};
/* harmony default export */ __webpack_exports__["default"] = (MyButton);
/* harmony default export */ __webpack_exports__["default"] = (TabelaPessoas);
/***/ }),


+ 1
- 1
public/scripts/main.js.map
File diff suppressed because it is too large
View File


+ 7
- 6
server/services/pessoas/get.js View File

@ -11,6 +11,7 @@ const dbPessoas = _db.query(`
`)
const dados = _val.list()
for(const dbPessoa of dbPessoas) {
const dbComunidades = _db.query(`
SELECT
@ -21,18 +22,18 @@ for(const dbPessoa of dbPessoas) {
`, dbPessoa.getInt("id"))
const dadosComunidades = _val.list()
for(const dbComunidade of dbComunidades) {
dadosComunidades.add(
_val.map()
.set("nome", dbComunidade.getString("nome"))
)
}
dados.add(
_val.map()
.set("uid", dbPessoa.getString("uid"))
.set("nome", `${dbPessoa.getString("nome")} ${dbPessoa.getString("apelido")}`)
.set("cidade", dbPessoa)
.set("cidade", dbPessoa.getString("cidade"))
.set("comunidades", dadosComunidades)
)
}
_log.info("Pessoas Serviço")
_out.json("Pessoas Serviço")

+ 1
- 1
ui/src/containers/TabelaPessoas/index.jsx View File

@ -75,4 +75,4 @@ const TabelaPessoas = ({ buttonRef, text, click }) => {
TabelaPessoas.propTypes = {
};
export default MyButton;
export default TabelaPessoas;

Loading…
Cancel
Save