+
{bodyshop.logo_img_path ? (

) : null}
@@ -49,80 +93,52 @@ export default function CsiContainerPage() {
{t("csi.labels.title")}
{`Hi ${job.ownr_fn || ""}!`}
- At {bodyshop.shopname || ""}, we value our customer's feedback. We
- would love to hear what you have to say. Please fill out the form
- below.
+ At {bodyshop.shopname || ""}, we value your feedback. We would love to
+ hear what you have to say. Please fill out the form below.
-
-
-
+ {submitting.error ? (
+
+ ) : null}
+
+ {submitting.submitted ? (
+
+
+
+ ) : (
+
+
+
+ )}
+
Copyright ImEX.Online. Survey ID: {surveyId}
);
}
-
-const relateddata = {
- bodyshop: {
- logo_img_path: "https://via.placeholder.com/150",
- shopname: "Kavia Test Autobody",
- address1: "123 Fake St",
- address2: "Unit #100",
- city: "Vancouver",
- state: "BC",
- zip_post: "V6B 1M9",
- country: "Canada",
- email: "snaptsoft@gmail.com",
- },
- job: {
- id: "1234",
- ro_number: "RO102384",
- ownr_fn: "Patrick",
- v_make_desc: "Toyota",
- v_model_desc: "Camry",
- v_model_yr: "2019",
- },
- csiquestion: [
- {
- name: "item1",
- type: "checkbox",
- label: "Checklist Item 1",
- required: true,
- },
- {
- name: "item2",
- type: "slider",
- label: "Checklist Item 2",
- min: 0,
- max: 5,
- required: true,
- },
- {
- name: "item3",
- type: "textarea",
- label: "Checklist Item 3",
- required: true,
- },
- {
- name: "item4",
- type: "text",
- label: "Checklist Item 4",
- required: true,
- },
- {
- name: "item5",
- type: "rate",
- label: "Checklist Item 4",
- required: true,
- },
- ],
-};
diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json
index 57167a2d2..2301a3bb6 100644
--- a/client/src/translations/en_us/common.json
+++ b/client/src/translations/en_us/common.json
@@ -250,8 +250,16 @@
}
},
"csi": {
+ "errors": {
+ "notfoundsubtitle": "We were unable to find a survey using the link you provided. Please ensure the URL is correct or reach out to your shop for more help.",
+ "notfoundtitle": "No survey found."
+ },
"labels": {
"title": "Customer Satisfaction Survey"
+ },
+ "successes": {
+ "submitted": "Your responses have been submitted successfully.",
+ "submittedsub": "Your input is highly appreciated."
}
},
"documents": {
diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json
index 2de7cdceb..7311933a7 100644
--- a/client/src/translations/es/common.json
+++ b/client/src/translations/es/common.json
@@ -250,8 +250,16 @@
}
},
"csi": {
+ "errors": {
+ "notfoundsubtitle": "",
+ "notfoundtitle": ""
+ },
"labels": {
"title": ""
+ },
+ "successes": {
+ "submitted": "",
+ "submittedsub": ""
}
},
"documents": {
diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json
index 80ee8df55..85da028cf 100644
--- a/client/src/translations/fr/common.json
+++ b/client/src/translations/fr/common.json
@@ -250,8 +250,16 @@
}
},
"csi": {
+ "errors": {
+ "notfoundsubtitle": "",
+ "notfoundtitle": ""
+ },
"labels": {
"title": ""
+ },
+ "successes": {
+ "submitted": "",
+ "submittedsub": ""
}
},
"documents": {
diff --git a/hasura/migrations/1590184694200_alter_table_public_csi_add_column_completed/down.yaml b/hasura/migrations/1590184694200_alter_table_public_csi_add_column_completed/down.yaml
new file mode 100644
index 000000000..ba51b40ae
--- /dev/null
+++ b/hasura/migrations/1590184694200_alter_table_public_csi_add_column_completed/down.yaml
@@ -0,0 +1,5 @@
+- args:
+ cascade: false
+ read_only: false
+ sql: ALTER TABLE "public"."csi" DROP COLUMN "completed";
+ type: run_sql
diff --git a/hasura/migrations/1590184694200_alter_table_public_csi_add_column_completed/up.yaml b/hasura/migrations/1590184694200_alter_table_public_csi_add_column_completed/up.yaml
new file mode 100644
index 000000000..98289ecd3
--- /dev/null
+++ b/hasura/migrations/1590184694200_alter_table_public_csi_add_column_completed/up.yaml
@@ -0,0 +1,5 @@
+- args:
+ cascade: false
+ read_only: false
+ sql: ALTER TABLE "public"."csi" ADD COLUMN "completed" timestamptz NULL;
+ type: run_sql
diff --git a/hasura/migrations/1590184702149_alter_table_public_csi_alter_column_completed/down.yaml b/hasura/migrations/1590184702149_alter_table_public_csi_alter_column_completed/down.yaml
new file mode 100644
index 000000000..6b99c635c
--- /dev/null
+++ b/hasura/migrations/1590184702149_alter_table_public_csi_alter_column_completed/down.yaml
@@ -0,0 +1,11 @@
+- args:
+ cascade: false
+ read_only: false
+ sql: ALTER TABLE "public"."csi" ALTER COLUMN "completed" TYPE timestamp with time
+ zone;
+ type: run_sql
+- args:
+ cascade: false
+ read_only: false
+ sql: alter table "public"."csi" rename column "completedon" to "completed";
+ type: run_sql
diff --git a/hasura/migrations/1590184702149_alter_table_public_csi_alter_column_completed/up.yaml b/hasura/migrations/1590184702149_alter_table_public_csi_alter_column_completed/up.yaml
new file mode 100644
index 000000000..b9953727f
--- /dev/null
+++ b/hasura/migrations/1590184702149_alter_table_public_csi_alter_column_completed/up.yaml
@@ -0,0 +1,10 @@
+- args:
+ cascade: false
+ read_only: false
+ sql: ALTER TABLE "public"."csi" ALTER COLUMN "completed" TYPE timestamptz;
+ type: run_sql
+- args:
+ cascade: false
+ read_only: false
+ sql: alter table "public"."csi" rename column "completed" to "completedon";
+ type: run_sql
diff --git a/hasura/migrations/1590184719915_update_permission_user_public_table_csi/down.yaml b/hasura/migrations/1590184719915_update_permission_user_public_table_csi/down.yaml
new file mode 100644
index 000000000..ee974fbb7
--- /dev/null
+++ b/hasura/migrations/1590184719915_update_permission_user_public_table_csi/down.yaml
@@ -0,0 +1,34 @@
+- args:
+ role: user
+ table:
+ name: csi
+ schema: public
+ type: drop_select_permission
+- args:
+ permission:
+ allow_aggregations: false
+ columns:
+ - bodyshopid
+ - created_at
+ - id
+ - jobid
+ - relateddata
+ - response
+ - updated_at
+ - valid
+ - validuntil
+ computed_fields: []
+ filter:
+ bodyshop:
+ associations:
+ _and:
+ - user:
+ authid:
+ _eq: X-Hasura-User-Id
+ - active:
+ _eq: true
+ role: user
+ table:
+ name: csi
+ schema: public
+ type: create_select_permission
diff --git a/hasura/migrations/1590184719915_update_permission_user_public_table_csi/up.yaml b/hasura/migrations/1590184719915_update_permission_user_public_table_csi/up.yaml
new file mode 100644
index 000000000..a45ce22ba
--- /dev/null
+++ b/hasura/migrations/1590184719915_update_permission_user_public_table_csi/up.yaml
@@ -0,0 +1,36 @@
+- args:
+ role: user
+ table:
+ name: csi
+ schema: public
+ type: drop_select_permission
+- args:
+ permission:
+ allow_aggregations: false
+ columns:
+ - bodyshopid
+ - completedon
+ - created_at
+ - id
+ - jobid
+ - questionset
+ - relateddata
+ - response
+ - updated_at
+ - valid
+ - validuntil
+ computed_fields: []
+ filter:
+ bodyshop:
+ associations:
+ _and:
+ - user:
+ authid:
+ _eq: X-Hasura-User-Id
+ - active:
+ _eq: true
+ role: user
+ table:
+ name: csi
+ schema: public
+ type: create_select_permission
diff --git a/hasura/migrations/1590184732654_update_permission_anonymous_public_table_csi/down.yaml b/hasura/migrations/1590184732654_update_permission_anonymous_public_table_csi/down.yaml
new file mode 100644
index 000000000..bae48de62
--- /dev/null
+++ b/hasura/migrations/1590184732654_update_permission_anonymous_public_table_csi/down.yaml
@@ -0,0 +1,22 @@
+- args:
+ role: anonymous
+ table:
+ name: csi
+ schema: public
+ type: drop_update_permission
+- args:
+ permission:
+ columns:
+ - response
+ filter:
+ valid:
+ _eq: true
+ localPresets:
+ - key: ""
+ value: ""
+ set: {}
+ role: anonymous
+ table:
+ name: csi
+ schema: public
+ type: create_update_permission
diff --git a/hasura/migrations/1590184732654_update_permission_anonymous_public_table_csi/up.yaml b/hasura/migrations/1590184732654_update_permission_anonymous_public_table_csi/up.yaml
new file mode 100644
index 000000000..f12bda76e
--- /dev/null
+++ b/hasura/migrations/1590184732654_update_permission_anonymous_public_table_csi/up.yaml
@@ -0,0 +1,24 @@
+- args:
+ role: anonymous
+ table:
+ name: csi
+ schema: public
+ type: drop_update_permission
+- args:
+ permission:
+ columns:
+ - completedon
+ - response
+ - valid
+ filter:
+ valid:
+ _eq: true
+ localPresets:
+ - key: ""
+ value: ""
+ set: {}
+ role: anonymous
+ table:
+ name: csi
+ schema: public
+ type: create_update_permission
diff --git a/hasura/migrations/metadata.yaml b/hasura/migrations/metadata.yaml
index c0d3e00c3..b5928c964 100644
--- a/hasura/migrations/metadata.yaml
+++ b/hasura/migrations/metadata.yaml
@@ -933,9 +933,11 @@ tables:
permission:
columns:
- bodyshopid
+ - completedon
- created_at
- id
- jobid
+ - questionset
- relateddata
- response
- updated_at
@@ -954,7 +956,9 @@ tables:
- role: anonymous
permission:
columns:
+ - completedon
- response
+ - valid
filter:
valid:
_eq: true