Pārlūkot izejas kodu

Merge branch 'development' of gogs.softpar.inf.br:Softpar/sfp_front_vue_serprati_associado_app into development

Gustavo Zanatta 1 dienu atpakaļ
vecāks
revīzija
0a0ec07b30

+ 23 - 4
package-lock.json

@@ -11,7 +11,7 @@
         "@bufbuild/protobuf": "^2.5.1",
         "@capacitor/app": "^8.1.0",
         "@capacitor/core": "^8.3.4",
-        "@capacitor/filesystem": "^8.1.2",
+        "@capacitor/filesystem": "^8.1.3",
         "@capacitor/keyboard": "^8.0.3",
         "@capacitor/share": "^8.0.1",
         "@capacitor/status-bar": "^8.0.2",
@@ -327,14 +327,15 @@
       "resolved": "https://registry.npmjs.org/@capacitor/core/-/core-8.3.4.tgz",
       "integrity": "sha512-CqRQCkb6HXxcx/N7s+hHTN6ef2CmamFiRMITwm4qB840ph56mS42bzUgn6tKCP+RZjdDweiRHj9ytDDeN6jFag==",
       "license": "MIT",
+      "peer": true,
       "dependencies": {
         "tslib": "^2.1.0"
       }
     },
     "node_modules/@capacitor/filesystem": {
-      "version": "8.1.2",
-      "resolved": "https://registry.npmjs.org/@capacitor/filesystem/-/filesystem-8.1.2.tgz",
-      "integrity": "sha512-doaaMfGoFR2hWU6aV6u83I+5ZsGyJVq+Gz4r9lMpJzUKMm1eMu0hLnFdV1aXZlU9FlK/RndFrVD8oRZfNOqWgQ==",
+      "version": "8.1.3",
+      "resolved": "https://registry.npmjs.org/@capacitor/filesystem/-/filesystem-8.1.3.tgz",
+      "integrity": "sha512-GNBlRkaXEEb+6WP/YsDXr2zygyOHoieuye6viyd2ZkEdBwfseG41jxfarVxLWH0r0owhyNUbwJ/Qi8fubqr6wA==",
       "license": "MIT",
       "dependencies": {
         "@capacitor/synapse": "^1.0.4"
@@ -2672,6 +2673,7 @@
       "integrity": "sha512-dVd04UKsfpINUnK0yBoYHDF3xu7xVH4BuDotC/xGuycx4CgbP48X/KF/586bcObxT0HENHXEU8Nqtu6NR+eKhw==",
       "devOptional": true,
       "license": "MIT",
+      "peer": true,
       "dependencies": {
         "@types/body-parser": "*",
         "@types/express-serve-static-core": "^4.17.33",
@@ -2991,6 +2993,7 @@
       "integrity": "sha512-TlGPkLFLVOY3T7fZrwdvKpjprR3s4fxRln0ORDo1VQ7HHyxJwTlrjKU3kpVWTlaAjIEuCTokmjkZnr8Tpc925w==",
       "dev": true,
       "license": "MIT",
+      "peer": true,
       "dependencies": {
         "@rolldown/pluginutils": "1.0.0-beta.53"
       },
@@ -3190,6 +3193,7 @@
       "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz",
       "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
       "license": "MIT",
+      "peer": true,
       "bin": {
         "acorn": "bin/acorn"
       },
@@ -3772,6 +3776,7 @@
         }
       ],
       "license": "MIT",
+      "peer": true,
       "dependencies": {
         "baseline-browser-mapping": "^2.9.0",
         "caniuse-lite": "^1.0.30001759",
@@ -3997,6 +4002,7 @@
       "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.5.1.tgz",
       "integrity": "sha512-GIjfiT9dbmHRiYi6Nl2yFCq7kkwdkp1W/lp2J99rX0yo9tgJGn3lKQATztIjb5tVtevcBtIdICNWqlq5+E8/Pw==",
       "license": "MIT",
+      "peer": true,
       "dependencies": {
         "@kurkle/color": "^0.3.0"
       },
@@ -5023,6 +5029,7 @@
       "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.2.tgz",
       "integrity": "sha512-LEyamqS7W5HB3ujJyvi0HQK/dtVINZvd5mAAp9eT5S/ujByGjiZLCzPcHVzuXbpJDJF/cxwHlfceVUDZ2lnSTw==",
       "license": "MIT",
+      "peer": true,
       "dependencies": {
         "@eslint-community/eslint-utils": "^4.8.0",
         "@eslint-community/regexpp": "^4.12.1",
@@ -5099,6 +5106,7 @@
       "integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==",
       "dev": true,
       "license": "MIT",
+      "peer": true,
       "bin": {
         "eslint-config-prettier": "bin/cli.js"
       },
@@ -6726,6 +6734,7 @@
       "integrity": "sha512-1e4qoRgnn448pRuMvKGsFFymUCquZV0mpGgOyIKNgD3JVDTsVJyRBGH/Fm0tBb8WsWGgmB1mDe6/yJMQM37DUA==",
       "dev": true,
       "license": "MIT",
+      "peer": true,
       "dependencies": {
         "acorn": "^8.5.0",
         "eslint-visitor-keys": "^3.0.0",
@@ -7634,6 +7643,7 @@
       "resolved": "https://registry.npmjs.org/pinia/-/pinia-3.0.4.tgz",
       "integrity": "sha512-l7pqLUFTI/+ESXn6k3nu30ZIzW5E2WZF/LaHJEpoq6ElcLD+wduZoB2kBN19du6K/4FDpPMazY2wJr+IndBtQw==",
       "license": "MIT",
+      "peer": true,
       "dependencies": {
         "@vue/devtools-api": "^7.7.7"
       },
@@ -7697,6 +7707,7 @@
         }
       ],
       "license": "MIT",
+      "peer": true,
       "dependencies": {
         "nanoid": "^3.3.11",
         "picocolors": "^1.1.1",
@@ -7742,6 +7753,7 @@
       "integrity": "sha512-v6UNi1+3hSlVvv8fSaoUbggEM5VErKmmpGA7Pl3HF8V6uKY7rvClBOJlH6yNwQtfTueNkGVpOv/mtWL9L4bgRA==",
       "dev": true,
       "license": "MIT",
+      "peer": true,
       "bin": {
         "prettier": "bin/prettier.cjs"
       },
@@ -7987,6 +7999,7 @@
       "resolved": "https://registry.npmjs.org/quasar/-/quasar-2.18.6.tgz",
       "integrity": "sha512-ZlK+vJXOBPSFDCNQDBDNwSI+AHoqaFPxK8ve6mhsYLhMKWI5b8zsGY9VU1xYjngO2aBvU4fvGWXy4tTbzrBk8Q==",
       "license": "MIT",
+      "peer": true,
       "engines": {
         "node": ">= 10.18.1",
         "npm": ">= 6.13.4",
@@ -8327,6 +8340,7 @@
       "integrity": "sha512-iTNAbFSlRpcHeeWu73ywU/8KuU/LZmNCSxp6fjQkJBD3ivUb8tpDrXhIxEzA05HlYMEwmtaUnb3RP+YNv162OQ==",
       "dev": true,
       "license": "MIT",
+      "peer": true,
       "dependencies": {
         "@types/estree": "1.0.8"
       },
@@ -9718,6 +9732,7 @@
       "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==",
       "devOptional": true,
       "license": "Apache-2.0",
+      "peer": true,
       "bin": {
         "tsc": "bin/tsc",
         "tsserver": "bin/tsserver"
@@ -9926,6 +9941,7 @@
       "integrity": "sha512-dZwN5L1VlUBewiP6H9s2+B3e3Jg96D0vzN+Ry73sOefebhYr9f94wwkMNN/9ouoU8pV1BqA1d1zGk8928cx0rg==",
       "dev": true,
       "license": "MIT",
+      "peer": true,
       "dependencies": {
         "esbuild": "^0.27.0",
         "fdir": "^6.5.0",
@@ -10612,6 +10628,7 @@
       "resolved": "https://registry.npmjs.org/vue/-/vue-3.5.25.tgz",
       "integrity": "sha512-YLVdgv2K13WJ6n+kD5owehKtEXwdwXuj2TTyJMsO7pSeKw2bfRNZGjhB7YzrpbMYj5b5QsUebHpOqR3R3ziy/g==",
       "license": "MIT",
+      "peer": true,
       "dependencies": {
         "@vue/compiler-dom": "3.5.25",
         "@vue/compiler-sfc": "3.5.25",
@@ -10652,6 +10669,7 @@
       "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-10.4.0.tgz",
       "integrity": "sha512-Vxi9pJdbN3ZnVGLODVtZ7y4Y2kzAAE2Cm0CZ3ZDRvydVYxZ6VrnBhLikBsRS+dpwj4Jv4UCv21PTEwF5rQ9WXg==",
       "license": "MIT",
+      "peer": true,
       "dependencies": {
         "debug": "^4.4.0",
         "eslint-scope": "^8.2.0 || ^9.0.0",
@@ -11019,6 +11037,7 @@
       "integrity": "sha512-odxVsHAkZYYglR30aPYRY4nUGJnoJ2y1ww2HDvZALo0BDETv9kWbi16J52eHs+PWRNmF4ub6nZqfVOeesOvntg==",
       "dev": true,
       "license": "MIT",
+      "peer": true,
       "dependencies": {
         "eslint-visitor-keys": "^3.0.0",
         "yaml": "^2.0.0"

+ 1 - 1
package.json

@@ -22,7 +22,7 @@
     "@bufbuild/protobuf": "^2.5.1",
     "@capacitor/app": "^8.1.0",
     "@capacitor/core": "^8.3.4",
-    "@capacitor/filesystem": "^8.1.2",
+    "@capacitor/filesystem": "^8.1.3",
     "@capacitor/keyboard": "^8.0.3",
     "@capacitor/share": "^8.0.1",
     "@capacitor/status-bar": "^8.0.2",

+ 12 - 12
src/components/CompleteProfileDialog.vue

@@ -216,18 +216,18 @@ const form = ref({
   admission_date: "",
 });
 
-const canSave = computed(() => {
-  return (
-    (!!initialUser.value.terms_accepted_at || termsAccepted.value) &&
-    !!localPhotoUrl.value &&
-    !!form.value.name?.trim() &&
-    !!form.value.cpf?.trim() &&
-    !!form.value.email?.trim() &&
-    !!form.value.phone?.trim() &&
-    !!form.value.position_id &&
-    !!form.value.sector_id
-  );
-});
+ const canSave = computed(() => {
+   return (
+     (!!initialUser.value.terms_accepted_at || termsAccepted.value) &&
+     !!localPhotoUrl.value &&
+     !!form.value.name?.trim() &&
+     !!form.value.cpf?.trim() &&
+     !!form.value.email?.trim() &&
+     !!form.value.phone?.trim() &&
+     !!form.value.position_id &&
+     !!form.value.sector_id
+   );
+ });
 
 const onAvatarSelected = async (event) => {
   const selected = event.target.files?.[0];

+ 79 - 0
src/pages/associado/carteirinha/CarteirinhaPage.vue

@@ -76,6 +76,85 @@
         </div>
       </q-card>
 
+      <q-card
+          v-for="dependent in user?.dependents ?? []"
+          :key="`dependent-${dependent.id}`"
+          flat
+          class="associado-card"
+          :class="isVertical ? 'card-vertical' : 'card-horizontal'"
+        >
+          <div class="card-logo-row text-center">
+            <img
+              :src="LogoSerPratiParceiro"
+              class="card-logo"
+              alt="SerPrati"
+            />
+          </div>
+
+          <div
+            class="card-body"
+            :class="isVertical ? 'card-body--vertical' : 'card-body--horizontal'"
+          >
+            <q-avatar
+              class="card-avatar"
+              :size="isVertical ? '100px' : '76px'"
+            >
+              <q-icon
+                name="mdi-account"
+                color="white"
+                :size="isVertical ? '64px' : '40px'"
+              />
+            </q-avatar>
+
+            <div class="card-info">
+
+              <div class="card-info__row">
+                <span class="card-info__label">
+                  {{ $t('common.terms.name') }}
+                </span>
+
+                <span class="card-info__value">
+                  {{ dependent.name ?? '—' }}
+                </span>
+              </div>
+
+              <div class="card-info__row q-pt-sm">
+                <span class="card-info__label">
+                  Parentesco
+                </span>
+
+                <span class="card-info__value">
+                  {{ dependent.kinship ?? '—' }}
+                </span>
+              </div>
+
+              <div class="card-info__row q-pt-sm">
+                <span class="card-info__label">
+                  Status
+                </span>
+
+                <span class="card-info__value">
+                  {{ dependent.status ? $t(`associado.dependent_statuses.${dependent.status}`) : '—' }}
+                </span>
+              </div>
+
+              <div
+                v-if="dependent.expiry_date"
+                class="card-info__row q-pt-sm"
+              >
+                <span class="card-info__label">
+                  {{ $t('associado.validity') }}
+                </span>
+
+                <span class="card-info__value">
+                  {{ dependent.expiry_date }}
+                </span>
+              </div>
+
+            </div>
+          </div>
+        </q-card>
+
       <q-btn
         round
         flat